Merge pull request #258 from seaweedchan/v3
Fappe Tyme keybind fix, Catalog Settings shortcut, catalog keybind
@ -2,7 +2,7 @@
|
||||
|
||||
- The top and bottom original board lists are now optional, disabled by default.
|
||||
- The button to show a hidden announcement is now inside the header's menu.
|
||||
- Reorganized Header menu:<br>
|
||||
- Reorganized Header menu:<br>
|
||||
- Added the `board-replace` setting to Custom Board Navigation ricing.
|
||||
- Added the option `Cooldown Prediction`, enabled by default.
|
||||
- Added the option `Hide Unread Count at (0)`, disabled by default.
|
||||
|
||||
194
Gruntfile.js
@ -1,194 +0,0 @@
|
||||
module.exports = function(grunt) {
|
||||
|
||||
var pkg = grunt.file.readJSON('package.json');
|
||||
var concatOptions = {
|
||||
process: {
|
||||
data: pkg
|
||||
}
|
||||
};
|
||||
var shellOptions = {
|
||||
stdout: true,
|
||||
stderr: true,
|
||||
failOnError: true
|
||||
};
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: pkg,
|
||||
concat: {
|
||||
coffee: {
|
||||
options: concatOptions,
|
||||
src: [
|
||||
'src/config.coffee',
|
||||
'src/globals.coffee',
|
||||
'lib/ui.coffee',
|
||||
'lib/$.coffee',
|
||||
'lib/polyfill.coffee',
|
||||
'src/features.coffee',
|
||||
'src/qr.coffee',
|
||||
'src/report.coffee',
|
||||
'src/databoard.coffee',
|
||||
'src/main.coffee'
|
||||
],
|
||||
dest: 'tmp-<%= pkg.type %>/script.coffee'
|
||||
},
|
||||
crx: {
|
||||
options: concatOptions,
|
||||
files: {
|
||||
'builds/crx/manifest.json': 'src/manifest.json',
|
||||
'builds/crx/script.js': [
|
||||
'src/banner.js',
|
||||
'tmp-<%= pkg.type %>/script.js'
|
||||
]
|
||||
}
|
||||
},
|
||||
userjs: {
|
||||
options: concatOptions,
|
||||
src: [
|
||||
'src/metadata.js',
|
||||
'src/banner.js',
|
||||
'tmp-<%= pkg.type %>/script.js'
|
||||
],
|
||||
dest: 'builds/<%= pkg.name %>.js'
|
||||
},
|
||||
userscript: {
|
||||
options: concatOptions,
|
||||
files: {
|
||||
'builds/<%= pkg.name %>.meta.js': 'src/metadata.js',
|
||||
'builds/<%= pkg.name %>.user.js': [
|
||||
'src/metadata.js',
|
||||
'src/banner.js',
|
||||
'tmp-<%= pkg.type %>/script.js'
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
copy: {
|
||||
crx: {
|
||||
src: 'img/*.png',
|
||||
dest: 'builds/crx/',
|
||||
expand: true,
|
||||
flatten: true
|
||||
}
|
||||
},
|
||||
coffee: {
|
||||
script: {
|
||||
src: 'tmp-<%= pkg.type %>/script.coffee',
|
||||
dest: 'tmp-<%= pkg.type %>/script.js'
|
||||
}
|
||||
},
|
||||
concurrent: {
|
||||
build: ['build-crx', 'build-userjs', 'build-userscript']
|
||||
},
|
||||
shell: {
|
||||
commit: {
|
||||
options: shellOptions,
|
||||
command: [
|
||||
'git checkout <%= pkg.meta.mainBranch %>',
|
||||
'git commit -am "Release <%= pkg.meta.name %> v<%= pkg.version %>."',
|
||||
'git tag -a <%= pkg.version %> -m "<%= pkg.meta.name %> v<%= pkg.version %>."',
|
||||
'git tag -af stable-v3 -m "<%= pkg.meta.name %> v<%= pkg.version %>."'
|
||||
].join(' && ')
|
||||
},
|
||||
push: {
|
||||
options: shellOptions,
|
||||
command: 'git push origin --tags -f && git push origin --all'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
all: {
|
||||
options: {
|
||||
interrupt: true
|
||||
},
|
||||
files: [
|
||||
'Gruntfile.js',
|
||||
'package.json',
|
||||
'lib/**/*',
|
||||
'src/**/*',
|
||||
'css/**/*',
|
||||
'img/**/*'
|
||||
],
|
||||
tasks: 'build'
|
||||
}
|
||||
},
|
||||
compress: {
|
||||
crx: {
|
||||
options: {
|
||||
archive: 'builds/<%= pkg.name %>.zip',
|
||||
level: 9,
|
||||
pretty: true
|
||||
},
|
||||
expand: true,
|
||||
flatten: true,
|
||||
src: 'builds/crx/*',
|
||||
dest: '/'
|
||||
}
|
||||
},
|
||||
clean: {
|
||||
builds: 'builds',
|
||||
tmpcrx: 'tmp-crx',
|
||||
tmpuserjs: 'tmp-userjs',
|
||||
tmpuserscript: 'tmp-userscript'
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-bump');
|
||||
grunt.loadNpmTasks('grunt-concurrent');
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-coffee');
|
||||
grunt.loadNpmTasks('grunt-contrib-compress');
|
||||
grunt.loadNpmTasks('grunt-contrib-concat');
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-shell');
|
||||
|
||||
grunt.registerTask('default', ['build']);
|
||||
|
||||
grunt.registerTask('set-build', 'Set the build type variable', function(type) {
|
||||
pkg.type = type;
|
||||
grunt.log.ok('pkg.type = %s', type);
|
||||
});
|
||||
grunt.registerTask('build', ['concurrent:build']);
|
||||
grunt.registerTask('build-crx', [
|
||||
'set-build:crx',
|
||||
'concat:coffee',
|
||||
'coffee:script',
|
||||
'concat:crx',
|
||||
'copy:crx',
|
||||
'clean:tmpcrx'
|
||||
]);
|
||||
grunt.registerTask('build-userjs', [
|
||||
'set-build:userjs',
|
||||
'concat:coffee',
|
||||
'coffee:script',
|
||||
'concat:userjs',
|
||||
'clean:tmpuserjs'
|
||||
]);
|
||||
grunt.registerTask('build-userscript', [
|
||||
'set-build:userscript',
|
||||
'concat:coffee',
|
||||
'coffee:script',
|
||||
'concat:userscript',
|
||||
'clean:tmpuserscript'
|
||||
]);
|
||||
|
||||
grunt.registerTask('release', ['shell:commit', 'shell:push', 'build-crx', 'compress:crx']);
|
||||
grunt.registerTask('patch', ['bump', 'reloadPkg', 'updcl:3', 'release']);
|
||||
grunt.registerTask('minor', ['bump:minor', 'reloadPkg', 'updcl:2', 'release']);
|
||||
grunt.registerTask('major', ['bump:major', 'reloadPkg', 'updcl:1', 'release']);
|
||||
|
||||
grunt.registerTask('reloadPkg', 'Reload the package', function() {
|
||||
// Update the `pkg` object with the new version.
|
||||
pkg = grunt.file.readJSON('package.json');
|
||||
grunt.config.data.pkg = concatOptions.process.data = pkg;
|
||||
grunt.log.ok('pkg reloaded.');
|
||||
});
|
||||
|
||||
grunt.registerTask('updcl', 'Update the changelog', function(i) {
|
||||
// i is the number of #s for markdown.
|
||||
var version = new Array(+i + 1).join('#') + ' ' + pkg.version + ' - *' + grunt.template.today('yyyy-mm-dd') + '*';
|
||||
grunt.file.write('CHANGELOG.md', version + '\n\n' + grunt.file.read('CHANGELOG.md'));
|
||||
grunt.log.ok('Changelog updated for v' + pkg.version + '.');
|
||||
});
|
||||
|
||||
};
|
||||
|
Before Width: | Height: | Size: 13 KiB |
@ -446,8 +446,12 @@ http://iqdb.org/?url=%TURL
|
||||
'Alt+m'
|
||||
'Insert math tags.'
|
||||
]
|
||||
'Submit QR': [
|
||||
'Toggle sage': [
|
||||
'Alt+s'
|
||||
'Toggle sage in email field'
|
||||
]
|
||||
'Submit QR': [
|
||||
'Ctrl+Enter'
|
||||
'Submit post.'
|
||||
]
|
||||
# Thread related
|
||||
@ -489,6 +493,10 @@ http://iqdb.org/?url=%TURL
|
||||
'Left'
|
||||
'Jump to the previous page.'
|
||||
]
|
||||
'Open catalog': [
|
||||
'Shift+c'
|
||||
'Open the catalog of the current board'
|
||||
]
|
||||
# Thread Navigation
|
||||
'Next thread': [
|
||||
'Down'
|
||||
|
||||
@ -238,7 +238,7 @@ a[href="javascript:;"] {
|
||||
.notification > .close {
|
||||
padding: 6px;
|
||||
top: 0;
|
||||
right: 0;
|
||||
right: 5px;
|
||||
position: absolute;
|
||||
}
|
||||
.message {
|
||||
@ -837,6 +837,9 @@ a:only-of-type > .remove {
|
||||
text-decoration: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.left>.entry.has-submenu {
|
||||
padding-right: 17px !important;
|
||||
}
|
||||
.entry:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ Header =
|
||||
customNavToggler = $.el 'label',
|
||||
innerHTML: '<input type=checkbox name="Custom Board Navigation"> Custom board navigation'
|
||||
footerToggler = $.el 'label',
|
||||
innerHTML: "<input type=checkbox #{unless Conf['Bottom Board List'] then 'checked' else ''}> Hide Footer Nav"
|
||||
innerHTML: "<input type=checkbox #{unless Conf['Bottom Board List'] then 'checked' else ''}> Bottom original board list"
|
||||
editCustomNav = $.el 'a',
|
||||
textContent: 'Edit custom board navigation'
|
||||
href: 'javascript:;'
|
||||
@ -71,9 +71,16 @@ Header =
|
||||
if a = $ "a[href*='/#{g.BOARD}/']", $.id 'boardNavDesktopFoot'
|
||||
a.className = 'current'
|
||||
|
||||
$.add d.body, @hover
|
||||
$.ready ->
|
||||
$.add d.body, Header.hover
|
||||
Header.footer = footer = $.id 'boardNavDesktopFoot'
|
||||
@footer = $.id 'boardNavDesktopFoot'
|
||||
@setFooterVisibility !Conf['Bottom Board List']
|
||||
Header.setFooterVisibility Conf['Footer auto-hide']
|
||||
$.sync 'Footer auto-hide', Header.setFooterVisibility
|
||||
cs = $.id('settingsWindowLink')
|
||||
cs.textContent = 'Catalog Settings'
|
||||
if g.VIEW is 'catalog'
|
||||
Header.addShortcut cs
|
||||
$.sync 'Bottom Board List', Header.setFooterVisibility
|
||||
|
||||
bar: $.el 'div',
|
||||
|
||||
@ -50,6 +50,8 @@ Keybinds =
|
||||
when Conf['Math tags']
|
||||
return if target.nodeName isnt 'TEXTAREA'
|
||||
Keybinds.tags 'math', target
|
||||
when Conf['Toggle sage']
|
||||
Keybinds.sage() if QR.nodes
|
||||
when Conf['Submit QR']
|
||||
QR.submit() if QR.nodes and !QR.status()
|
||||
# Thread related
|
||||
@ -63,7 +65,9 @@ Keybinds =
|
||||
when Conf['Expand images']
|
||||
Keybinds.img threadRoot, true
|
||||
when Conf['fappeTyme']
|
||||
do FappeTyme.input.click
|
||||
unless $('#menu.left')
|
||||
Header.menuButton.click()
|
||||
FappeTyme.input.click()
|
||||
# Board Navigation
|
||||
when Conf['Front page']
|
||||
window.location = "/#{g.BOARD}/0#delform"
|
||||
@ -75,6 +79,11 @@ Keybinds =
|
||||
when Conf['Previous page']
|
||||
if form = $ '.prev form'
|
||||
window.location = form.action
|
||||
when Conf['Open catalog']
|
||||
if Conf['External Catalog']
|
||||
window.location = CatalogLinks.external(g.BOARD.ID)
|
||||
else
|
||||
window.location = "/#{g.BOARD}/catalog"
|
||||
# Thread Navigation
|
||||
when Conf['Next thread']
|
||||
return if g.VIEW is 'thread'
|
||||
@ -154,6 +163,12 @@ Keybinds =
|
||||
# Fire the 'input' event
|
||||
$.event 'input', null, ta
|
||||
|
||||
sage: ->
|
||||
isSage = /sage/i.test QR.nodes.email.value
|
||||
QR.nodes.email.value = if isSage
|
||||
""
|
||||
else "sage"
|
||||
|
||||
img: (thread, all) ->
|
||||
if all
|
||||
ImageExpand.cb.toggleAll()
|
||||
|
||||
BIN
src/img/emoji/SS-sage.png
Normal file
|
After Width: | Height: | Size: 576 B |
BIN
src/img/emoji/appchan-sage.png
Normal file
|
After Width: | Height: | Size: 659 B |
BIN
src/img/emoji/arch.png
Normal file
|
After Width: | Height: | Size: 567 B |
BIN
src/img/emoji/baka.png
Normal file
|
After Width: | Height: | Size: 987 B |
BIN
src/img/emoji/centos.png
Normal file
|
After Width: | Height: | Size: 858 B |
BIN
src/img/emoji/crunchbang.png
Normal file
|
After Width: | Height: | Size: 297 B |
BIN
src/img/emoji/debian.png
Normal file
|
After Width: | Height: | Size: 559 B |
BIN
src/img/emoji/fedora.png
Normal file
|
After Width: | Height: | Size: 631 B |
BIN
src/img/emoji/freebsd.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/img/emoji/gentoo.png
Normal file
|
After Width: | Height: | Size: 882 B |
BIN
src/img/emoji/gnu.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/img/emoji/madotsuki.png
Normal file
|
After Width: | Height: | Size: 231 B |
BIN
src/img/emoji/mint.png
Normal file
|
After Width: | Height: | Size: 1006 B |
BIN
src/img/emoji/neko.png
Normal file
|
After Width: | Height: | Size: 1012 B |
BIN
src/img/emoji/openbsd.png
Normal file
|
After Width: | Height: | Size: 1002 B |
BIN
src/img/emoji/osx.png
Normal file
|
After Width: | Height: | Size: 820 B |
BIN
src/img/emoji/plan9.png
Normal file
|
After Width: | Height: | Size: 668 B |
BIN
src/img/emoji/ponyo.png
Normal file
|
After Width: | Height: | Size: 884 B |
BIN
src/img/emoji/rabite.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/img/emoji/rhel.png
Normal file
|
After Width: | Height: | Size: 797 B |
BIN
src/img/emoji/sabayon.png
Normal file
|
After Width: | Height: | Size: 830 B |
BIN
src/img/emoji/sakamoto.png
Normal file
|
After Width: | Height: | Size: 934 B |
BIN
src/img/emoji/sega.png
Normal file
|
After Width: | Height: | Size: 339 B |
BIN
src/img/emoji/slackware.png
Normal file
|
After Width: | Height: | Size: 912 B |
BIN
src/img/emoji/trisquel.png
Normal file
|
After Width: | Height: | Size: 820 B |
BIN
src/img/emoji/ubuntu.png
Normal file
|
After Width: | Height: | Size: 625 B |
BIN
src/img/emoji/windows.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/img/emoji/yuno.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |