diff --git a/LICENSE b/LICENSE index 4c6a096e7..56ac8e810 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* appchan x - Version 2.10.4 - 2015-01-24 +* appchan x - Version 2.10.4 - 2015-01-26 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 43ba1eb41..343cbca3d 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -28,7 +28,7 @@ // ==/UserScript== /* -* appchan x - Version 2.10.4 - 2015-01-24 +* appchan x - Version 2.10.4 - 2015-01-26 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -4927,8 +4927,8 @@ Index = { showHiddenThreads: false, init: function() { - var anchorEntry, input, label, modeEntry, name, pinEntry, refNavEntry, repliesEntry, returnLink, select, sortEntry, targetEntry, threadNumEntry, threadsNumInput, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2; - if (g.BOARD.ID === 'f' || !Conf['JSON Navigation']) { + var anchorEntry, input, label, modeEntry, name, pinEntry, refNavEntry, repliesEntry, returnLink, select, sortEntry, targetEntry, threadNumEntry, threadsNumInput, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; + if (!(Conf['JSON Navigation'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } this.board = "" + g.BOARD; @@ -4969,9 +4969,9 @@ } ] }; - _ref = modeEntry.subEntries; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - label = _ref[_i]; + _ref1 = modeEntry.subEntries; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + label = _ref1[_i]; input = label.el.firstChild; input.checked = Conf['Index Mode'] === input.value; $.on(input, 'change', $.cb.value); @@ -5018,9 +5018,9 @@ pinEntry.el.title = 'Move watched threads to the start of the index.'; anchorEntry.el.title = 'Move hidden threads to the end of the index.'; refNavEntry.el.title = 'Refresh index when navigating through pages.'; - _ref1 = [targetEntry, repliesEntry, pinEntry, anchorEntry, refNavEntry]; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - label = _ref1[_j]; + _ref2 = [targetEntry, repliesEntry, pinEntry, anchorEntry, refNavEntry]; + for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { + label = _ref2[_j]; input = label.el.firstChild; name = input.name; input.checked = Conf[name]; @@ -5071,9 +5071,9 @@ $.on(this.searchInput, 'input', this.onSearchInput); $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch); $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads); - _ref2 = [this.selectMode, this.selectSort, this.selectSize]; - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - select = _ref2[_k]; + _ref3 = [this.selectMode, this.selectSort, this.selectSize]; + for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) { + select = _ref3[_k]; select.value = Conf[select.name]; $.on(select, 'change', $.cb.value); } @@ -5116,14 +5116,14 @@ $.asap((function() { return $('.board', doc) || d.readyState !== 'loading'; }), function() { - var board, navLink, _l, _len3, _ref3, _ref4; - _ref3 = $$('.navLinks'); - for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { - navLink = _ref3[_l]; + var board, navLink, _l, _len3, _ref4, _ref5; + _ref4 = $$('.navLinks'); + for (_l = 0, _len3 = _ref4.length; _l < _len3; _l++) { + navLink = _ref4[_l]; $.rm(navLink); } - if ((_ref4 = $.id('search-box')) != null) { - _ref4.parentNode.remove(); + if ((_ref5 = $.id('search-box')) != null) { + _ref5.parentNode.remove(); } $.after($.x('child::form/preceding-sibling::hr[1]'), Index.navLinks); if (g.VIEW !== 'index') { @@ -7783,8 +7783,8 @@ }, menu: { init: function() { - var apply, makeStub, replies, thisPost; - if (!Conf['Menu'] || !Conf['Post Hiding Link']) { + var apply, makeStub, replies, thisPost, _ref; + if (!(Conf['Menu'] && Conf['Post Hiding Link'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread'))) { return; } apply = { @@ -7880,16 +7880,13 @@ }, subEntries: [apply, thisPost, replies] }); - if (g.VIEW !== 'index') { - return; - } return Menu.menu.addEntry({ el: $.el('a', { href: 'javascript:;' }), order: 20, open: function(post) { - if (post.isReply) { + if (g.VIEW !== 'index' || post.isReply) { return false; } this.el.textContent = post.isHidden ? 'Unhide thread' : 'Hide thread'; @@ -10999,13 +10996,13 @@ FappeTyme = { init: function() { - var el, lc, type, _i, _len, _ref; - if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || g.BOARD.ID === 'f') { + var el, lc, type, _i, _len, _ref, _ref1; + if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } - _ref = ["Fappe", "Werk"]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = ["Fappe", "Werk"]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; if (!Conf["" + type + " Tyme"]) { continue; } @@ -11055,7 +11052,7 @@ Gallery = { init: function() { var el, _ref; - if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Gallery']) || g.BOARD === 'f') { + if (!(this.enabled = Conf['Gallery'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } this.delay = Conf['Slide Delay']; @@ -11431,8 +11428,8 @@ }, menu: { init: function() { - var el, _ref; - if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Gallery'])) { + var el; + if (!Gallery.enabled) { return; } el = $.el('span', { @@ -11622,7 +11619,7 @@ ImageExpand = { init: function() { var _ref; - if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Image Expansion'])) { + if (!(this.enabled = Conf['Image Expansion'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } this.EAI = $.el('a', { @@ -11981,8 +11978,8 @@ }, menu: { init: function() { - var conf, createSubEntry, el, name, subEntries, _ref, _ref1; - if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Image Expansion'])) { + var conf, createSubEntry, el, name, subEntries, _ref; + if (!ImageExpand.enabled) { return; } el = $.el('span', { @@ -11991,9 +11988,9 @@ }); createSubEntry = ImageExpand.menu.createSubEntry; subEntries = []; - _ref1 = Config.imageExpansion; - for (name in _ref1) { - conf = _ref1[name]; + _ref = Config.imageExpansion; + for (name in _ref) { + conf = _ref[name]; subEntries.push(createSubEntry(name, conf[1])); } return Header.menu.addEntry({ @@ -12144,10 +12141,10 @@ ImageLoader = { init: function() { var prefetch, _ref; - if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { + if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } - if (!(Conf["Image Prefetching"] || Conf["Replace JPG"] || Conf["Replace PNG"] || Conf["Replace GIF"] || Conf["Replace WEBM"])) { + if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) { return; } Post.callbacks.push({ @@ -13430,7 +13427,8 @@ Labels = { init: function() { - if (!Conf['Menu']) { + var _ref; + if (!(Conf['Menu'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread'))) { return; } return Menu.menu.addEntry({ @@ -14297,7 +14295,7 @@ ThreadWatcher = { init: function() { - var el; + var el, _ref; if (!Conf['Thread Watcher']) { return; } @@ -14329,7 +14327,7 @@ }); } ThreadWatcher.fetchAuto(); - if (Conf['JSON Navigation'] && Conf['Menu'] && g.BOARD.ID !== 'f') { + if (Conf['JSON Navigation'] && Conf['Menu'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f') { Menu.menu.addEntry({ el: $.el('a', { href: 'javascript:;' @@ -16288,7 +16286,7 @@ return Conf[hotkey] = key; }, keydown: function(e) { - var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; + var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; if (!(key = Keybinds.keyCode(e))) { return; } @@ -16419,25 +16417,25 @@ ThreadWatcher.toggle(thread); break; case Conf['Expand image']: - if (!threadRoot) { + if (!(ImageExpand.enabled && threadRoot)) { return; } Keybinds.img(threadRoot); break; case Conf['Expand images']: - if (!threadRoot) { + if (!(ImageExpand.enabled && threadRoot)) { return; } Keybinds.img(threadRoot, true); break; case Conf['Open Gallery']: - if ((_ref2 = g.VIEW) !== 'index' && _ref2 !== 'thread') { + if (!Gallery.enabled) { return; } Gallery.cb.toggle(); break; case Conf['fappeTyme']: - if (!Conf['Fappe Tyme'] || ((_ref3 = g.VIEW) !== 'index' && _ref3 !== 'thread') || g.BOARD === 'f') { + if (!(Conf['Fappe Tyme'] && ((_ref2 = g.VIEW) === 'index' || _ref2 === 'thread') && g.BOARD.ID !== 'f')) { return; } FappeTyme.cb.toggle.call({ @@ -16445,7 +16443,7 @@ }); break; case Conf['werkTyme']: - if (!Conf['Fappe Tyme'] || ((_ref4 = g.VIEW) !== 'index' && _ref4 !== 'thread') || g.BOARD === 'f') { + if (!(Conf['Werk Tyme'] && ((_ref3 = g.VIEW) === 'index' || _ref3 === 'thread') && g.BOARD.ID !== 'f')) { return; } FappeTyme.cb.toggle.call({ @@ -16467,7 +16465,7 @@ return; } if (Conf['JSON Navigation']) { - if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') { + if ((_ref4 = Conf['Index Mode']) !== 'paged' && _ref4 !== 'infinite') { return; } $('.next button', Index.pagelist).click(); @@ -16482,7 +16480,7 @@ return; } if (Conf['JSON Navigation']) { - if ((_ref6 = Conf['Index Mode']) !== 'paged' && _ref6 !== 'infinite') { + if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') { return; } $('.prev button', Index.pagelist).click(); @@ -16771,6 +16769,9 @@ if (!Conf['Reply Navigation']) { return; } + break; + default: + return; } prev = $.el('a', { href: 'javascript:;', @@ -18494,7 +18495,8 @@ Navigate = { path: window.location.pathname, init: function() { - if (g.BOARD.ID === 'f' || !Conf['JSON Navigation']) { + var _ref; + if (!(Conf['JSON Navigation'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } $.on(window, 'popstate', Navigate.popstate); diff --git a/builds/crx/script.js b/builds/crx/script.js index 2e4053f3a..230de6a21 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* appchan x - Version 2.10.4 - 2015-01-24 +* appchan x - Version 2.10.4 - 2015-01-26 * * Licensed under the MIT license. * https://github.com/zixaphir/appchan-x/blob/master/LICENSE @@ -4952,8 +4952,8 @@ Index = { showHiddenThreads: false, init: function() { - var anchorEntry, input, label, modeEntry, name, pinEntry, refNavEntry, repliesEntry, returnLink, select, sortEntry, targetEntry, threadNumEntry, threadsNumInput, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2; - if (g.BOARD.ID === 'f' || !Conf['JSON Navigation']) { + var anchorEntry, input, label, modeEntry, name, pinEntry, refNavEntry, repliesEntry, returnLink, select, sortEntry, targetEntry, threadNumEntry, threadsNumInput, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; + if (!(Conf['JSON Navigation'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } this.board = "" + g.BOARD; @@ -4994,9 +4994,9 @@ } ] }; - _ref = modeEntry.subEntries; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - label = _ref[_i]; + _ref1 = modeEntry.subEntries; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + label = _ref1[_i]; input = label.el.firstChild; input.checked = Conf['Index Mode'] === input.value; $.on(input, 'change', $.cb.value); @@ -5043,9 +5043,9 @@ pinEntry.el.title = 'Move watched threads to the start of the index.'; anchorEntry.el.title = 'Move hidden threads to the end of the index.'; refNavEntry.el.title = 'Refresh index when navigating through pages.'; - _ref1 = [targetEntry, repliesEntry, pinEntry, anchorEntry, refNavEntry]; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - label = _ref1[_j]; + _ref2 = [targetEntry, repliesEntry, pinEntry, anchorEntry, refNavEntry]; + for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { + label = _ref2[_j]; input = label.el.firstChild; name = input.name; input.checked = Conf[name]; @@ -5096,9 +5096,9 @@ $.on(this.searchInput, 'input', this.onSearchInput); $.on($('#index-search-clear', this.navLinks), 'click', this.clearSearch); $.on($('#hidden-toggle a', this.navLinks), 'click', this.cb.toggleHiddenThreads); - _ref2 = [this.selectMode, this.selectSort, this.selectSize]; - for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) { - select = _ref2[_k]; + _ref3 = [this.selectMode, this.selectSort, this.selectSize]; + for (_k = 0, _len2 = _ref3.length; _k < _len2; _k++) { + select = _ref3[_k]; select.value = Conf[select.name]; $.on(select, 'change', $.cb.value); } @@ -5141,14 +5141,14 @@ $.asap((function() { return $('.board', doc) || d.readyState !== 'loading'; }), function() { - var board, navLink, _l, _len3, _ref3, _ref4; - _ref3 = $$('.navLinks'); - for (_l = 0, _len3 = _ref3.length; _l < _len3; _l++) { - navLink = _ref3[_l]; + var board, navLink, _l, _len3, _ref4, _ref5; + _ref4 = $$('.navLinks'); + for (_l = 0, _len3 = _ref4.length; _l < _len3; _l++) { + navLink = _ref4[_l]; $.rm(navLink); } - if ((_ref4 = $.id('search-box')) != null) { - _ref4.parentNode.remove(); + if ((_ref5 = $.id('search-box')) != null) { + _ref5.parentNode.remove(); } $.after($.x('child::form/preceding-sibling::hr[1]'), Index.navLinks); if (g.VIEW !== 'index') { @@ -7824,8 +7824,8 @@ }, menu: { init: function() { - var apply, makeStub, replies, thisPost; - if (!Conf['Menu'] || !Conf['Post Hiding Link']) { + var apply, makeStub, replies, thisPost, _ref; + if (!(Conf['Menu'] && Conf['Post Hiding Link'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread'))) { return; } apply = { @@ -7921,16 +7921,13 @@ }, subEntries: [apply, thisPost, replies] }); - if (g.VIEW !== 'index') { - return; - } return Menu.menu.addEntry({ el: $.el('a', { href: 'javascript:;' }), order: 20, open: function(post) { - if (post.isReply) { + if (g.VIEW !== 'index' || post.isReply) { return false; } this.el.textContent = post.isHidden ? 'Unhide thread' : 'Hide thread'; @@ -11035,13 +11032,13 @@ FappeTyme = { init: function() { - var el, lc, type, _i, _len, _ref; - if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || g.BOARD.ID === 'f') { + var el, lc, type, _i, _len, _ref, _ref1; + if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } - _ref = ["Fappe", "Werk"]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = ["Fappe", "Werk"]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; if (!Conf["" + type + " Tyme"]) { continue; } @@ -11091,7 +11088,7 @@ Gallery = { init: function() { var el, _ref; - if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Gallery']) || g.BOARD === 'f') { + if (!(this.enabled = Conf['Gallery'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } this.delay = Conf['Slide Delay']; @@ -11467,8 +11464,8 @@ }, menu: { init: function() { - var el, _ref; - if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Gallery'])) { + var el; + if (!Gallery.enabled) { return; } el = $.el('span', { @@ -11645,7 +11642,7 @@ ImageExpand = { init: function() { var _ref; - if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Image Expansion'])) { + if (!(this.enabled = Conf['Image Expansion'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } this.EAI = $.el('a', { @@ -12004,8 +12001,8 @@ }, menu: { init: function() { - var conf, createSubEntry, el, name, subEntries, _ref, _ref1; - if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Image Expansion'])) { + var conf, createSubEntry, el, name, subEntries, _ref; + if (!ImageExpand.enabled) { return; } el = $.el('span', { @@ -12014,9 +12011,9 @@ }); createSubEntry = ImageExpand.menu.createSubEntry; subEntries = []; - _ref1 = Config.imageExpansion; - for (name in _ref1) { - conf = _ref1[name]; + _ref = Config.imageExpansion; + for (name in _ref) { + conf = _ref[name]; subEntries.push(createSubEntry(name, conf[1])); } return Header.menu.addEntry({ @@ -12167,10 +12164,10 @@ ImageLoader = { init: function() { var prefetch, _ref; - if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { + if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } - if (!(Conf["Image Prefetching"] || Conf["Replace JPG"] || Conf["Replace PNG"] || Conf["Replace GIF"] || Conf["Replace WEBM"])) { + if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) { return; } Post.callbacks.push({ @@ -13453,7 +13450,8 @@ Labels = { init: function() { - if (!Conf['Menu']) { + var _ref; + if (!(Conf['Menu'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread'))) { return; } return Menu.menu.addEntry({ @@ -14320,7 +14318,7 @@ ThreadWatcher = { init: function() { - var el; + var el, _ref; if (!Conf['Thread Watcher']) { return; } @@ -14352,7 +14350,7 @@ }); } ThreadWatcher.fetchAuto(); - if (Conf['JSON Navigation'] && Conf['Menu'] && g.BOARD.ID !== 'f') { + if (Conf['JSON Navigation'] && Conf['Menu'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f') { Menu.menu.addEntry({ el: $.el('a', { href: 'javascript:;' @@ -16310,7 +16308,7 @@ return Conf[hotkey] = key; }, keydown: function(e) { - var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; + var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; if (!(key = Keybinds.keyCode(e))) { return; } @@ -16441,25 +16439,25 @@ ThreadWatcher.toggle(thread); break; case Conf['Expand image']: - if (!threadRoot) { + if (!(ImageExpand.enabled && threadRoot)) { return; } Keybinds.img(threadRoot); break; case Conf['Expand images']: - if (!threadRoot) { + if (!(ImageExpand.enabled && threadRoot)) { return; } Keybinds.img(threadRoot, true); break; case Conf['Open Gallery']: - if ((_ref2 = g.VIEW) !== 'index' && _ref2 !== 'thread') { + if (!Gallery.enabled) { return; } Gallery.cb.toggle(); break; case Conf['fappeTyme']: - if (!Conf['Fappe Tyme'] || ((_ref3 = g.VIEW) !== 'index' && _ref3 !== 'thread') || g.BOARD === 'f') { + if (!(Conf['Fappe Tyme'] && ((_ref2 = g.VIEW) === 'index' || _ref2 === 'thread') && g.BOARD.ID !== 'f')) { return; } FappeTyme.cb.toggle.call({ @@ -16467,7 +16465,7 @@ }); break; case Conf['werkTyme']: - if (!Conf['Fappe Tyme'] || ((_ref4 = g.VIEW) !== 'index' && _ref4 !== 'thread') || g.BOARD === 'f') { + if (!(Conf['Werk Tyme'] && ((_ref3 = g.VIEW) === 'index' || _ref3 === 'thread') && g.BOARD.ID !== 'f')) { return; } FappeTyme.cb.toggle.call({ @@ -16489,7 +16487,7 @@ return; } if (Conf['JSON Navigation']) { - if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') { + if ((_ref4 = Conf['Index Mode']) !== 'paged' && _ref4 !== 'infinite') { return; } $('.next button', Index.pagelist).click(); @@ -16504,7 +16502,7 @@ return; } if (Conf['JSON Navigation']) { - if ((_ref6 = Conf['Index Mode']) !== 'paged' && _ref6 !== 'infinite') { + if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') { return; } $('.prev button', Index.pagelist).click(); @@ -16793,6 +16791,9 @@ if (!Conf['Reply Navigation']) { return; } + break; + default: + return; } prev = $.el('a', { href: 'javascript:;', @@ -18522,8 +18523,8 @@ Navigate = { path: window.location.pathname, init: function() { - var popstateHack; - if (g.BOARD.ID === 'f' || !Conf['JSON Navigation']) { + var popstateHack, _ref; + if (!(Conf['JSON Navigation'] && ((_ref = g.VIEW) === 'index' || _ref === 'thread') && g.BOARD.ID !== 'f')) { return; } popstateHack = function() { diff --git a/src/Filtering/PostHiding.coffee b/src/Filtering/PostHiding.coffee index c9bd228f8..53d87c5a2 100644 --- a/src/Filtering/PostHiding.coffee +++ b/src/Filtering/PostHiding.coffee @@ -75,7 +75,7 @@ PostHiding = menu: init: -> - return if !Conf['Menu'] or !Conf['Post Hiding Link'] + return unless Conf['Menu'] and Conf['Post Hiding Link'] and g.VIEW in ['index', 'thread'] # Hide apply = @@ -132,12 +132,11 @@ PostHiding = true subEntries: [apply, thisPost, replies] - return if g.VIEW isnt 'index' Menu.menu.addEntry el: $.el 'a', href: 'javascript:;' order: 20 open: (post) -> - return false if post.isReply + return false if g.VIEW isnt 'index' or post.isReply @el.textContent = if post.isHidden 'Unhide thread' else diff --git a/src/General/Index.coffee b/src/General/Index.coffee index 68cd0e1b9..3709e2717 100644 --- a/src/General/Index.coffee +++ b/src/General/Index.coffee @@ -1,7 +1,7 @@ Index = showHiddenThreads: false init: -> - return if g.BOARD.ID is 'f' or !Conf['JSON Navigation'] + return unless Conf['JSON Navigation'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f' @board = "#{g.BOARD}" diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 318fa94d8..84033c29b 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -1,7 +1,7 @@ Navigate = path: window.location.pathname init: -> - return if g.BOARD.ID is 'f' or !Conf['JSON Navigation'] + return unless Conf['JSON Navigation'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f' <% if (type === 'crx') { %> # blink/webkit throw a popstate on page load. Not what we want. diff --git a/src/Images/FappeTyme.coffee b/src/Images/FappeTyme.coffee index d4834a5c0..dd83569d6 100755 --- a/src/Images/FappeTyme.coffee +++ b/src/Images/FappeTyme.coffee @@ -1,6 +1,6 @@ FappeTyme = init: -> - return if !(Conf['Fappe Tyme'] or Conf['Werk Tyme']) or g.BOARD.ID is 'f' + return unless (Conf['Fappe Tyme'] or Conf['Werk Tyme']) and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f' for type in ["Fappe", "Werk"] when Conf["#{type} Tyme"] lc = type.toLowerCase() diff --git a/src/Images/Gallery.coffee b/src/Images/Gallery.coffee index d2712514e..2e6864476 100644 --- a/src/Images/Gallery.coffee +++ b/src/Images/Gallery.coffee @@ -1,6 +1,6 @@ Gallery = init: -> - return if not (g.VIEW in ['index', 'thread'] and Conf['Gallery']) or g.BOARD is 'f' + return unless @enabled = Conf['Gallery'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f' @delay = Conf['Slide Delay'] @@ -297,7 +297,7 @@ Gallery = menu: init: -> - return unless g.VIEW in ['index', 'thread'] and Conf['Gallery'] + return unless Gallery.enabled el = $.el 'span', textContent: 'Gallery' diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index b46d879ef..e39fce0a4 100644 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -1,6 +1,6 @@ ImageExpand = init: -> - return unless g.VIEW in ['index', 'thread'] and Conf['Image Expansion'] + return unless @enabled = Conf['Image Expansion'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f' @EAI = $.el 'a', id: 'img-controls' @@ -280,7 +280,7 @@ ImageExpand = menu: init: -> - return unless g.VIEW in ['index', 'thread'] and Conf['Image Expansion'] + return unless ImageExpand.enabled el = $.el 'span', textContent: 'Image Expansion' diff --git a/src/Images/ImageLoader.coffee b/src/Images/ImageLoader.coffee index 9e6b0fdc7..1128b3b1b 100755 --- a/src/Images/ImageLoader.coffee +++ b/src/Images/ImageLoader.coffee @@ -1,8 +1,8 @@ ImageLoader = init: -> - return unless g.VIEW in ['index', 'thread'] - return unless Conf["Image Prefetching"] or - Conf["Replace JPG"] or Conf["Replace PNG"] or Conf["Replace GIF"] or Conf["Replace WEBM"] + return unless g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f' + return unless Conf['Image Prefetching'] or + Conf['Replace JPG'] or Conf['Replace PNG'] or Conf['Replace GIF'] or Conf['Replace WEBM'] Post.callbacks.push name: 'Image Replace' diff --git a/src/Menu/Labels.coffee b/src/Menu/Labels.coffee index bb554ecbf..dd3e04178 100644 --- a/src/Menu/Labels.coffee +++ b/src/Menu/Labels.coffee @@ -1,6 +1,6 @@ Labels = init: -> - return if !Conf['Menu'] + return unless Conf['Menu'] and g.VIEW in ['index', 'thread'] Menu.menu.addEntry el: $.el 'div', textContent: 'Labels' diff --git a/src/Miscellaneous/Keybinds.coffee b/src/Miscellaneous/Keybinds.coffee index 682463826..1ae272be1 100755 --- a/src/Miscellaneous/Keybinds.coffee +++ b/src/Miscellaneous/Keybinds.coffee @@ -93,19 +93,19 @@ Keybinds = ThreadWatcher.toggle thread # Images when Conf['Expand image'] - return unless threadRoot + return unless ImageExpand.enabled and threadRoot Keybinds.img threadRoot when Conf['Expand images'] - return unless threadRoot + return unless ImageExpand.enabled and threadRoot Keybinds.img threadRoot, true when Conf['Open Gallery'] - return unless g.VIEW in ['index', 'thread'] + return unless Gallery.enabled Gallery.cb.toggle() when Conf['fappeTyme'] - return if !Conf['Fappe Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f' + return unless Conf['Fappe Tyme'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f' FappeTyme.cb.toggle.call {name: 'fappe'} when Conf['werkTyme'] - return if !Conf['Fappe Tyme'] or g.VIEW not in ['index', 'thread'] or g.BOARD is 'f' + return unless Conf['Werk Tyme'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f' FappeTyme.cb.toggle.call {name: 'werk'} # Board Navigation when Conf['Front page'] diff --git a/src/Miscellaneous/Nav.coffee b/src/Miscellaneous/Nav.coffee index 9b9a0a978..37f2fd905 100755 --- a/src/Miscellaneous/Nav.coffee +++ b/src/Miscellaneous/Nav.coffee @@ -5,6 +5,8 @@ Nav = return unless Conf['Index Navigation'] when 'thread' return unless Conf['Reply Navigation'] + else + return prev = $.el 'a', href: 'javascript:;' diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 07daaeab3..18b7c7869 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -29,7 +29,7 @@ ThreadWatcher = ThreadWatcher.fetchAuto() - if Conf['JSON Navigation'] and Conf['Menu'] and g.BOARD.ID isnt 'f' + if Conf['JSON Navigation'] and Conf['Menu'] and g.VIEW in ['index', 'thread'] and g.BOARD.ID isnt 'f' Menu.menu.addEntry el: $.el 'a', href: 'javascript:;' order: 6