Remembering how keybinds work is hard.

This commit is contained in:
Zixaphir 2015-01-09 20:40:02 -07:00
parent 13d5542997
commit 108129ca78
3 changed files with 285 additions and 199 deletions

View File

@ -15245,7 +15245,7 @@
return Conf[hotkey] = key; return Conf[hotkey] = key;
}, },
keydown: function(e) { keydown: function(e) {
var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4; var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
if (!(key = Keybinds.keyCode(e))) { if (!(key = Keybinds.keyCode(e))) {
return; return;
} }
@ -15266,9 +15266,10 @@
} }
switch (key) { switch (key) {
case Conf['Toggle board list']: case Conf['Toggle board list']:
if (Conf['Custom Board Navigation']) { if (!Conf['Custom Board Navigation']) {
Header.toggleBoardList(); return;
} }
Header.toggleBoardList();
break; break;
case Conf['Toggle header']: case Conf['Toggle header']:
Header.toggleBarVisibility(); Header.toggleBarVisibility();
@ -15277,9 +15278,10 @@
Keybinds.qr(); Keybinds.qr();
break; break;
case Conf['Open QR']: case Conf['Open QR']:
if (threadRoot) { if (!threadRoot) {
Keybinds.qr(threadRoot); return;
} }
Keybinds.qr(threadRoot);
break; break;
case Conf['Open settings']: case Conf['Open settings']:
Settings.open(); Settings.open();
@ -15300,35 +15302,45 @@
} }
} else if (Embedding.lastEmbed) { } else if (Embedding.lastEmbed) {
Embedding.closeFloat(); Embedding.closeFloat();
} else {
return;
} }
return; break;
case Conf['Spoiler tags']: case Conf['Spoiler tags']:
if (target.nodeName === 'TEXTAREA') { if (target.nodeName !== 'TEXTAREA') {
Keybinds.tags('spoiler', target); return;
} }
Keybinds.tags('spoiler', target);
break; break;
case Conf['Code tags']: case Conf['Code tags']:
if (target.nodeName === 'TEXTAREA') { if (target.nodeName !== 'TEXTAREA') {
Keybinds.tags('code', target); return;
} }
Keybinds.tags('code', target);
break; break;
case Conf['Eqn tags']: case Conf['Eqn tags']:
if (target.nodeName === 'TEXTAREA') { if (target.nodeName !== 'TEXTAREA') {
Keybinds.tags('eqn', target); return;
} }
Keybinds.tags('eqn', target);
break; break;
case Conf['Math tags']: case Conf['Math tags']:
if (target.nodeName === 'TEXTAREA') { if (target.nodeName !== 'TEXTAREA') {
Keybinds.tags('math', target); return;
} }
Keybinds.tags('math', target);
break; break;
case Conf['Toggle sage']: case Conf['Toggle sage']:
if (QR.nodes && !QR.nodes.el.hidden) { if (!(QR.nodes && !QR.nodes.el.hidden)) {
Keybinds.sage(); return;
} }
Keybinds.sage();
break; break;
case Conf['Submit QR']: case Conf['Submit QR']:
if (QR.nodes && !QR.nodes.el.hidden && !QR.status()) { if (!(QR.nodes && !QR.nodes.el.hidden)) {
return;
}
if (!QR.status()) {
QR.submit(); QR.submit();
} }
break; break;
@ -15342,52 +15354,60 @@
case Conf['Update']: case Conf['Update']:
switch (g.VIEW) { switch (g.VIEW) {
case 'thread': case 'thread':
if (Conf['Thread Updater']) { if (!Conf['Thread Updater']) {
ThreadUpdater.update(); return;
} }
ThreadUpdater.update();
break; break;
case 'index': case 'index':
if (Conf['JSON Navigation']) { if (!Conf['JSON Navigation']) {
Index.update(); return;
} }
Index.update();
break;
default:
return;
} }
return; break;
case Conf['Watch']: case Conf['Watch']:
if (!thread) { if (!thread) {
ThreadWatcher.toggle(thread);
}
break;
case Conf['Expand image']:
if (threadRoot) {
Keybinds.img(threadRoot);
}
break;
case Conf['Expand images']:
if (threadRoot) {
Keybinds.img(threadRoot, true);
}
break;
case Conf['Open Gallery']:
if ((_ref2 = g.VIEW) === 'index' || _ref2 === 'thread') {
Gallery.cb.toggle();
}
break;
case Conf['fappeTyme']:
if (Conf['Fappe Tyme'] && ((_ref3 = g.VIEW) === 'index' || _ref3 === 'thread') && g.BOARD !== 'f') {
FappeTyme.cb.toggle.call({
name: 'fappe'
});
}
break;
case Conf['werkTyme']:
if (g.VIEW === 'catalog') {
return; return;
} }
if (Conf['Fappe Tyme'] && ((_ref4 = g.VIEW) === 'index' || _ref4 === 'thread') && g.BOARD !== 'f') { ThreadWatcher.toggle(thread);
FappeTyme.cb.toggle.call({ break;
name: 'werk' case Conf['Expand image']:
}); if (!threadRoot) {
return;
} }
Keybinds.img(threadRoot);
break;
case Conf['Expand images']:
if (!threadRoot) {
return;
}
Keybinds.img(threadRoot, true);
break;
case Conf['Open Gallery']:
if ((_ref2 = g.VIEW) !== 'index' && _ref2 !== 'thread') {
return;
}
Gallery.cb.toggle();
break;
case Conf['fappeTyme']:
if (!Conf['Fappe Tyme'] || ((_ref3 = g.VIEW) !== 'index' && _ref3 !== 'thread') || g.BOARD === 'f') {
return;
}
FappeTyme.cb.toggle.call({
name: 'fappe'
});
break;
case Conf['werkTyme']:
if (!Conf['Fappe Tyme'] || ((_ref4 = g.VIEW) !== 'index' && _ref4 !== 'thread') || g.BOARD === 'f') {
return;
}
FappeTyme.cb.toggle.call({
name: 'werk'
});
break; break;
case Conf['Front page']: case Conf['Front page']:
if (Conf['JSON Navigation'] && g.VIEW === 'index') { if (Conf['JSON Navigation'] && g.VIEW === 'index') {
@ -15404,9 +15424,10 @@
return; return;
} }
if (Conf['JSON Navigation']) { if (Conf['JSON Navigation']) {
if (Conf['Index Mode'] !== 'all pages') { if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') {
$('.next button', Index.pagelist).click(); return;
} }
$('.next button', Index.pagelist).click();
} else { } else {
if (form = $('.next form')) { if (form = $('.next form')) {
window.location = form.action; window.location = form.action;
@ -15418,9 +15439,10 @@
return; return;
} }
if (Conf['JSON Navigation']) { if (Conf['JSON Navigation']) {
if (Conf['Index Mode'] !== 'all pages') { if ((_ref6 = Conf['Index Mode']) !== 'paged' && _ref6 !== 'infinite') {
$('.prev button', Index.pagelist).click(); return;
} }
$('.prev button', Index.pagelist).click();
} else { } else {
if (form = $('.prev form')) { if (form = $('.prev form')) {
window.location = form.action; window.location = form.action;
@ -15472,63 +15494,71 @@
Index.setIndexMode('catalog'); Index.setIndexMode('catalog');
} }
break; break;
case Conf['Cycle sort type']:
if (Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD !== 'f') {
Index.cycleSortType();
}
break;
case Conf['Next thread']: case Conf['Next thread']:
if (g.VIEW === 'index' && threadRoot) { if (!(g.VIEW === 'index' && threadRoot)) {
Nav.scroll(+1); return;
} }
Nav.scroll(+1);
break; break;
case Conf['Previous thread']: case Conf['Previous thread']:
if (g.VIEW === 'index' && threadRoot) { if (!(g.VIEW === 'index' && threadRoot)) {
Nav.scroll(-1); return;
} }
Nav.scroll(-1);
break; break;
case Conf['Expand thread']: case Conf['Expand thread']:
if (g.VIEW === 'index' && threadRoot) { if (!(g.VIEW === 'index' && threadRoot)) {
ExpandThread.toggle(thread); return;
} }
ExpandThread.toggle(thread);
break; break;
case Conf['Open thread']: case Conf['Open thread']:
if (g.VIEW === 'index' && threadRoot) { if (!(g.VIEW === 'index' && threadRoot)) {
Keybinds.open(thread); return;
} }
Keybinds.open(thread);
break; break;
case Conf['Open thread tab']: case Conf['Open thread tab']:
if (g.VIEW === 'index' && threadRoot) { if (!(g.VIEW === 'index' && threadRoot)) {
Keybinds.open(thread, true); return;
} }
Keybinds.open(thread, true);
break; break;
case Conf['Next reply']: case Conf['Next reply']:
if (threadRoot) { if (!threadRoot) {
Keybinds.hl(+1, threadRoot); return;
} }
Keybinds.hl(+1, threadRoot);
break; break;
case Conf['Previous reply']: case Conf['Previous reply']:
if (threadRoot) { if (!threadRoot) {
Keybinds.hl(-1, threadRoot); return;
} }
Keybinds.hl(-1, threadRoot);
break; break;
case Conf['Deselect reply']: case Conf['Deselect reply']:
if (threadRoot) { if (!threadRoot) {
Keybinds.hl(0, threadRoot); return;
} }
Keybinds.hl(0, threadRoot);
break; break;
case Conf['Hide']: case Conf['Hide']:
if (!threadRoot) {
return;
}
PostHiding.toggle(thread.OP); PostHiding.toggle(thread.OP);
break; break;
case Conf['Previous Post Quoting You']: case Conf['Previous Post Quoting You']:
if (threadRoot) { if (!threadRoot) {
QuoteMarkers.cb.seek('preceding'); return;
} }
QuoteMarkers.cb.seek('preceding');
break; break;
case Conf['Next Post Quoting You']: case Conf['Next Post Quoting You']:
if (threadRoot) { if (!threadRoot) {
QuoteMarkers.cb.seek('following'); return;
} }
QuoteMarkers.cb.seek('following');
break; break;
default: default:
return; return;

View File

@ -15266,7 +15266,7 @@
return Conf[hotkey] = key; return Conf[hotkey] = key;
}, },
keydown: function(e) { keydown: function(e) {
var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4; var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
if (!(key = Keybinds.keyCode(e))) { if (!(key = Keybinds.keyCode(e))) {
return; return;
} }
@ -15287,9 +15287,10 @@
} }
switch (key) { switch (key) {
case Conf['Toggle board list']: case Conf['Toggle board list']:
if (Conf['Custom Board Navigation']) { if (!Conf['Custom Board Navigation']) {
Header.toggleBoardList(); return;
} }
Header.toggleBoardList();
break; break;
case Conf['Toggle header']: case Conf['Toggle header']:
Header.toggleBarVisibility(); Header.toggleBarVisibility();
@ -15298,9 +15299,10 @@
Keybinds.qr(); Keybinds.qr();
break; break;
case Conf['Open QR']: case Conf['Open QR']:
if (threadRoot) { if (!threadRoot) {
Keybinds.qr(threadRoot); return;
} }
Keybinds.qr(threadRoot);
break; break;
case Conf['Open settings']: case Conf['Open settings']:
Settings.open(); Settings.open();
@ -15321,35 +15323,45 @@
} }
} else if (Embedding.lastEmbed) { } else if (Embedding.lastEmbed) {
Embedding.closeFloat(); Embedding.closeFloat();
} else {
return;
} }
return; break;
case Conf['Spoiler tags']: case Conf['Spoiler tags']:
if (target.nodeName === 'TEXTAREA') { if (target.nodeName !== 'TEXTAREA') {
Keybinds.tags('spoiler', target); return;
} }
Keybinds.tags('spoiler', target);
break; break;
case Conf['Code tags']: case Conf['Code tags']:
if (target.nodeName === 'TEXTAREA') { if (target.nodeName !== 'TEXTAREA') {
Keybinds.tags('code', target); return;
} }
Keybinds.tags('code', target);
break; break;
case Conf['Eqn tags']: case Conf['Eqn tags']:
if (target.nodeName === 'TEXTAREA') { if (target.nodeName !== 'TEXTAREA') {
Keybinds.tags('eqn', target); return;
} }
Keybinds.tags('eqn', target);
break; break;
case Conf['Math tags']: case Conf['Math tags']:
if (target.nodeName === 'TEXTAREA') { if (target.nodeName !== 'TEXTAREA') {
Keybinds.tags('math', target); return;
} }
Keybinds.tags('math', target);
break; break;
case Conf['Toggle sage']: case Conf['Toggle sage']:
if (QR.nodes && !QR.nodes.el.hidden) { if (!(QR.nodes && !QR.nodes.el.hidden)) {
Keybinds.sage(); return;
} }
Keybinds.sage();
break; break;
case Conf['Submit QR']: case Conf['Submit QR']:
if (QR.nodes && !QR.nodes.el.hidden && !QR.status()) { if (!(QR.nodes && !QR.nodes.el.hidden)) {
return;
}
if (!QR.status()) {
QR.submit(); QR.submit();
} }
break; break;
@ -15363,52 +15375,60 @@
case Conf['Update']: case Conf['Update']:
switch (g.VIEW) { switch (g.VIEW) {
case 'thread': case 'thread':
if (Conf['Thread Updater']) { if (!Conf['Thread Updater']) {
ThreadUpdater.update(); return;
} }
ThreadUpdater.update();
break; break;
case 'index': case 'index':
if (Conf['JSON Navigation']) { if (!Conf['JSON Navigation']) {
Index.update(); return;
} }
Index.update();
break;
default:
return;
} }
return; break;
case Conf['Watch']: case Conf['Watch']:
if (!thread) { if (!thread) {
ThreadWatcher.toggle(thread);
}
break;
case Conf['Expand image']:
if (threadRoot) {
Keybinds.img(threadRoot);
}
break;
case Conf['Expand images']:
if (threadRoot) {
Keybinds.img(threadRoot, true);
}
break;
case Conf['Open Gallery']:
if ((_ref2 = g.VIEW) === 'index' || _ref2 === 'thread') {
Gallery.cb.toggle();
}
break;
case Conf['fappeTyme']:
if (Conf['Fappe Tyme'] && ((_ref3 = g.VIEW) === 'index' || _ref3 === 'thread') && g.BOARD !== 'f') {
FappeTyme.cb.toggle.call({
name: 'fappe'
});
}
break;
case Conf['werkTyme']:
if (g.VIEW === 'catalog') {
return; return;
} }
if (Conf['Fappe Tyme'] && ((_ref4 = g.VIEW) === 'index' || _ref4 === 'thread') && g.BOARD !== 'f') { ThreadWatcher.toggle(thread);
FappeTyme.cb.toggle.call({ break;
name: 'werk' case Conf['Expand image']:
}); if (!threadRoot) {
return;
} }
Keybinds.img(threadRoot);
break;
case Conf['Expand images']:
if (!threadRoot) {
return;
}
Keybinds.img(threadRoot, true);
break;
case Conf['Open Gallery']:
if ((_ref2 = g.VIEW) !== 'index' && _ref2 !== 'thread') {
return;
}
Gallery.cb.toggle();
break;
case Conf['fappeTyme']:
if (!Conf['Fappe Tyme'] || ((_ref3 = g.VIEW) !== 'index' && _ref3 !== 'thread') || g.BOARD === 'f') {
return;
}
FappeTyme.cb.toggle.call({
name: 'fappe'
});
break;
case Conf['werkTyme']:
if (!Conf['Fappe Tyme'] || ((_ref4 = g.VIEW) !== 'index' && _ref4 !== 'thread') || g.BOARD === 'f') {
return;
}
FappeTyme.cb.toggle.call({
name: 'werk'
});
break; break;
case Conf['Front page']: case Conf['Front page']:
if (Conf['JSON Navigation'] && g.VIEW === 'index') { if (Conf['JSON Navigation'] && g.VIEW === 'index') {
@ -15425,9 +15445,10 @@
return; return;
} }
if (Conf['JSON Navigation']) { if (Conf['JSON Navigation']) {
if (Conf['Index Mode'] !== 'all pages') { if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') {
$('.next button', Index.pagelist).click(); return;
} }
$('.next button', Index.pagelist).click();
} else { } else {
if (form = $('.next form')) { if (form = $('.next form')) {
window.location = form.action; window.location = form.action;
@ -15439,9 +15460,10 @@
return; return;
} }
if (Conf['JSON Navigation']) { if (Conf['JSON Navigation']) {
if (Conf['Index Mode'] !== 'all pages') { if ((_ref6 = Conf['Index Mode']) !== 'paged' && _ref6 !== 'infinite') {
$('.prev button', Index.pagelist).click(); return;
} }
$('.prev button', Index.pagelist).click();
} else { } else {
if (form = $('.prev form')) { if (form = $('.prev form')) {
window.location = form.action; window.location = form.action;
@ -15493,63 +15515,71 @@
Index.setIndexMode('catalog'); Index.setIndexMode('catalog');
} }
break; break;
case Conf['Cycle sort type']:
if (Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD !== 'f') {
Index.cycleSortType();
}
break;
case Conf['Next thread']: case Conf['Next thread']:
if (g.VIEW === 'index' && threadRoot) { if (!(g.VIEW === 'index' && threadRoot)) {
Nav.scroll(+1); return;
} }
Nav.scroll(+1);
break; break;
case Conf['Previous thread']: case Conf['Previous thread']:
if (g.VIEW === 'index' && threadRoot) { if (!(g.VIEW === 'index' && threadRoot)) {
Nav.scroll(-1); return;
} }
Nav.scroll(-1);
break; break;
case Conf['Expand thread']: case Conf['Expand thread']:
if (g.VIEW === 'index' && threadRoot) { if (!(g.VIEW === 'index' && threadRoot)) {
ExpandThread.toggle(thread); return;
} }
ExpandThread.toggle(thread);
break; break;
case Conf['Open thread']: case Conf['Open thread']:
if (g.VIEW === 'index' && threadRoot) { if (!(g.VIEW === 'index' && threadRoot)) {
Keybinds.open(thread); return;
} }
Keybinds.open(thread);
break; break;
case Conf['Open thread tab']: case Conf['Open thread tab']:
if (g.VIEW === 'index' && threadRoot) { if (!(g.VIEW === 'index' && threadRoot)) {
Keybinds.open(thread, true); return;
} }
Keybinds.open(thread, true);
break; break;
case Conf['Next reply']: case Conf['Next reply']:
if (threadRoot) { if (!threadRoot) {
Keybinds.hl(+1, threadRoot); return;
} }
Keybinds.hl(+1, threadRoot);
break; break;
case Conf['Previous reply']: case Conf['Previous reply']:
if (threadRoot) { if (!threadRoot) {
Keybinds.hl(-1, threadRoot); return;
} }
Keybinds.hl(-1, threadRoot);
break; break;
case Conf['Deselect reply']: case Conf['Deselect reply']:
if (threadRoot) { if (!threadRoot) {
Keybinds.hl(0, threadRoot); return;
} }
Keybinds.hl(0, threadRoot);
break; break;
case Conf['Hide']: case Conf['Hide']:
if (!threadRoot) {
return;
}
PostHiding.toggle(thread.OP); PostHiding.toggle(thread.OP);
break; break;
case Conf['Previous Post Quoting You']: case Conf['Previous Post Quoting You']:
if (threadRoot) { if (!threadRoot) {
QuoteMarkers.cb.seek('preceding'); return;
} }
QuoteMarkers.cb.seek('preceding');
break; break;
case Conf['Next Post Quoting You']: case Conf['Next Post Quoting You']:
if (threadRoot) { if (!threadRoot) {
QuoteMarkers.cb.seek('following'); return;
} }
QuoteMarkers.cb.seek('following');
break; break;
default: default:
return; return;

View File

@ -29,13 +29,15 @@ Keybinds =
switch key switch key
# QR & Options # QR & Options
when Conf['Toggle board list'] when Conf['Toggle board list']
Header.toggleBoardList() if Conf['Custom Board Navigation'] return unless Conf['Custom Board Navigation']
Header.toggleBoardList()
when Conf['Toggle header'] when Conf['Toggle header']
Header.toggleBarVisibility() Header.toggleBarVisibility()
when Conf['Open empty QR'] when Conf['Open empty QR']
Keybinds.qr() Keybinds.qr()
when Conf['Open QR'] when Conf['Open QR']
Keybinds.qr threadRoot if threadRoot return unless threadRoot
Keybinds.qr threadRoot
when Conf['Open settings'] when Conf['Open settings']
Settings.open() Settings.open()
when Conf['Close'] when Conf['Close']
@ -51,19 +53,26 @@ Keybinds =
QR.close() QR.close()
else if Embedding.lastEmbed else if Embedding.lastEmbed
Embedding.closeFloat() Embedding.closeFloat()
return else
return
when Conf['Spoiler tags'] when Conf['Spoiler tags']
Keybinds.tags 'spoiler', target if target.nodeName is 'TEXTAREA' return unless target.nodeName is 'TEXTAREA'
Keybinds.tags 'spoiler', target
when Conf['Code tags'] when Conf['Code tags']
Keybinds.tags 'code', target if target.nodeName is 'TEXTAREA' return unless target.nodeName is 'TEXTAREA'
Keybinds.tags 'code', target
when Conf['Eqn tags'] when Conf['Eqn tags']
Keybinds.tags 'eqn', target if target.nodeName is 'TEXTAREA' return unless target.nodeName is 'TEXTAREA'
Keybinds.tags 'eqn', target
when Conf['Math tags'] when Conf['Math tags']
Keybinds.tags 'math', target if target.nodeName is 'TEXTAREA' return unless target.nodeName is 'TEXTAREA'
Keybinds.tags 'math', target
when Conf['Toggle sage'] when Conf['Toggle sage']
Keybinds.sage() if QR.nodes and !QR.nodes.el.hidden return unless QR.nodes and !QR.nodes.el.hidden
Keybinds.sage()
when Conf['Submit QR'] when Conf['Submit QR']
QR.submit() if QR.nodes and !QR.nodes.el.hidden and !QR.status() return unless QR.nodes and !QR.nodes.el.hidden
QR.submit() if !QR.status()
when Conf['Post Without Name'] when Conf['Post Without Name']
return unless QR.nodes and !QR.status() return unless QR.nodes and !QR.status()
Keybinds.name() Keybinds.name()
@ -72,24 +81,32 @@ Keybinds =
when Conf['Update'] when Conf['Update']
switch g.VIEW switch g.VIEW
when 'thread' when 'thread'
ThreadUpdater.update() if Conf['Thread Updater'] return unless Conf['Thread Updater']
ThreadUpdater.update()
when 'index' when 'index'
Index.update() if Conf['JSON Navigation'] return unless Conf['JSON Navigation']
return Index.update()
else
return
when Conf['Watch'] when Conf['Watch']
ThreadWatcher.toggle thread unless thread return unless thread
ThreadWatcher.toggle thread
# Images # Images
when Conf['Expand image'] when Conf['Expand image']
Keybinds.img threadRoot if threadRoot return unless threadRoot
Keybinds.img threadRoot
when Conf['Expand images'] when Conf['Expand images']
Keybinds.img threadRoot, true if threadRoot return unless threadRoot
Keybinds.img threadRoot, true
when Conf['Open Gallery'] when Conf['Open Gallery']
Gallery.cb.toggle() if g.VIEW in ['index', 'thread'] return unless g.VIEW in ['index', 'thread']
Gallery.cb.toggle()
when Conf['fappeTyme'] when Conf['fappeTyme']
FappeTyme.cb.toggle.call {name: 'fappe'} if Conf['Fappe Tyme'] and g.VIEW in ['index', 'thread'] and g.BOARD isnt 'f' return if !Conf['Fappe Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f'
FappeTyme.cb.toggle.call {name: 'fappe'}
when Conf['werkTyme'] when Conf['werkTyme']
return if g.VIEW is 'catalog' return if !Conf['Fappe Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f'
FappeTyme.cb.toggle.call {name: 'werk'} if Conf['Fappe Tyme'] and g.VIEW in ['index', 'thread'] and g.BOARD isnt 'f' FappeTyme.cb.toggle.call {name: 'werk'}
# Board Navigation # Board Navigation
when Conf['Front page'] when Conf['Front page']
if Conf['JSON Navigation'] and g.VIEW is 'index' if Conf['JSON Navigation'] and g.VIEW is 'index'
@ -101,16 +118,16 @@ Keybinds =
when Conf['Next page'] when Conf['Next page']
return unless g.VIEW is 'index' return unless g.VIEW is 'index'
if Conf['JSON Navigation'] if Conf['JSON Navigation']
if Conf['Index Mode'] isnt 'all pages' return unless Conf['Index Mode'] in ['paged', 'infinite']
$('.next button', Index.pagelist).click() $('.next button', Index.pagelist).click()
else else
if form = $ '.next form' if form = $ '.next form'
window.location = form.action window.location = form.action
when Conf['Previous page'] when Conf['Previous page']
return unless g.VIEW is 'index' return unless g.VIEW is 'index'
if Conf['JSON Navigation'] if Conf['JSON Navigation']
if Conf['Index Mode'] isnt 'all pages' return unless Conf['Index Mode'] in ['paged', 'infinite']
$('.prev button', Index.pagelist).click() $('.prev button', Index.pagelist).click()
else else
if form = $ '.prev form' if form = $ '.prev form'
window.location = form.action window.location = form.action
@ -138,32 +155,41 @@ Keybinds =
return window.location = "/#{g.BOARD}/catalog" unless Conf['JSON Navigation'] return window.location = "/#{g.BOARD}/catalog" unless Conf['JSON Navigation']
return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'catalog' return unless g.VIEW is 'index' and Conf['Index Mode'] isnt 'catalog'
Index.setIndexMode 'catalog' Index.setIndexMode 'catalog'
when Conf['Cycle sort type']
Index.cycleSortType() if Conf['JSON Navigation'] and g.VIEW is 'index' and g.BOARD isnt 'f'
# Thread Navigation # Thread Navigation
when Conf['Next thread'] when Conf['Next thread']
Nav.scroll +1 if g.VIEW is 'index' and threadRoot return unless g.VIEW is 'index' and threadRoot
Nav.scroll +1
when Conf['Previous thread'] when Conf['Previous thread']
Nav.scroll -1 if g.VIEW is 'index' and threadRoot return unless g.VIEW is 'index' and threadRoot
Nav.scroll -1
when Conf['Expand thread'] when Conf['Expand thread']
ExpandThread.toggle thread if g.VIEW is 'index' and threadRoot return unless g.VIEW is 'index' and threadRoot
ExpandThread.toggle thread
when Conf['Open thread'] when Conf['Open thread']
Keybinds.open thread if g.VIEW is 'index' and threadRoot return unless g.VIEW is 'index' and threadRoot
Keybinds.open thread
when Conf['Open thread tab'] when Conf['Open thread tab']
Keybinds.open thread, true if g.VIEW is 'index' and threadRoot return unless g.VIEW is 'index' and threadRoot
Keybinds.open thread, true
# Reply Navigation # Reply Navigation
when Conf['Next reply'] when Conf['Next reply']
Keybinds.hl +1, threadRoot if threadRoot return unless threadRoot
Keybinds.hl +1, threadRoot
when Conf['Previous reply'] when Conf['Previous reply']
Keybinds.hl -1, threadRoot if threadRoot return unless threadRoot
Keybinds.hl -1, threadRoot
when Conf['Deselect reply'] when Conf['Deselect reply']
Keybinds.hl 0, threadRoot if threadRoot return unless threadRoot
Keybinds.hl 0, threadRoot
when Conf['Hide'] when Conf['Hide']
return unless threadRoot
PostHiding.toggle thread.OP PostHiding.toggle thread.OP
when Conf['Previous Post Quoting You'] when Conf['Previous Post Quoting You']
QuoteMarkers.cb.seek 'preceding' if threadRoot return unless threadRoot
QuoteMarkers.cb.seek 'preceding'
when Conf['Next Post Quoting You'] when Conf['Next Post Quoting You']
QuoteMarkers.cb.seek 'following' if threadRoot return unless threadRoot
QuoteMarkers.cb.seek 'following'
else else
return return
e.preventDefault() e.preventDefault()