From 3e35ced05edb31225b2d9dca6dc1970ac01171de Mon Sep 17 00:00:00 2001 From: Jordan Bates Date: Mon, 22 Jul 2013 07:52:02 -0700 Subject: [PATCH 01/12] Fix captcha caching across threads --- LICENSE | 2 +- builds/4chan-X.js | 11 +++++++---- builds/4chan-X.user.js | 11 +++++++---- builds/crx/script.js | 11 +++++++---- src/Posting/QuickReply.coffee | 7 ++++--- 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/LICENSE b/LICENSE index 560854e87..4df702e8f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.2.19 - 2013-07-15 +* 4chan X - Version 1.2.19 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.js b/builds/4chan-X.js index c3ab52075..759b46a82 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.19 - 2013-07-15 +* 4chan X - Version 1.2.19 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -5641,8 +5641,11 @@ $.on(input, 'blur', function() { return $.rmClass(QR.nodes.el, 'focus'); }); - $.get('captchas', [], function(item) { - return _this.sync(item['captchas']); + $.get('captchas', [], function(_arg) { + var captchas; + + captchas = _arg.captchas; + return _this.sync(captchas); }); $.sync('captchas', this.sync); this.reload(); @@ -5650,7 +5653,7 @@ return $.after(QR.nodes.com.parentNode, [imgContainer, input]); }, sync: function(captchas) { - this.captchas = captchas; + QR.captcha.captchas = captchas; return QR.captcha.count(); }, getOne: function() { diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index b3bbc9c6d..d5f993282 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.19 - 2013-07-15 +* 4chan X - Version 1.2.19 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -5631,8 +5631,11 @@ $.on(input, 'blur', function() { return $.rmClass(QR.nodes.el, 'focus'); }); - $.get('captchas', [], function(item) { - return _this.sync(item['captchas']); + $.get('captchas', [], function(_arg) { + var captchas; + + captchas = _arg.captchas; + return _this.sync(captchas); }); $.sync('captchas', this.sync); this.reload(); @@ -5642,7 +5645,7 @@ return $.after(QR.nodes.com.parentNode, [imgContainer, input]); }, sync: function(captchas) { - this.captchas = captchas; + QR.captcha.captchas = captchas; return QR.captcha.count(); }, getOne: function() { diff --git a/builds/crx/script.js b/builds/crx/script.js index e10a04c1f..def067941 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.19 - 2013-07-15 +* 4chan X - Version 1.2.19 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -5632,8 +5632,11 @@ $.on(input, 'blur', function() { return $.rmClass(QR.nodes.el, 'focus'); }); - $.get('captchas', [], function(item) { - return _this.sync(item['captchas']); + $.get('captchas', [], function(_arg) { + var captchas; + + captchas = _arg.captchas; + return _this.sync(captchas); }); $.sync('captchas', this.sync); this.reload(); @@ -5641,7 +5644,7 @@ return $.after(QR.nodes.com.parentNode, [imgContainer, input]); }, sync: function(captchas) { - this.captchas = captchas; + QR.captcha.captchas = captchas; return QR.captcha.count(); }, getOne: function() { diff --git a/src/Posting/QuickReply.coffee b/src/Posting/QuickReply.coffee index 2219c8fa7..930a8b3fd 100644 --- a/src/Posting/QuickReply.coffee +++ b/src/Posting/QuickReply.coffee @@ -790,8 +790,8 @@ QR = $.on input, 'keydown', @keydown.bind @ $.on input, 'focus', -> $.addClass QR.nodes.el, 'focus' $.on input, 'blur', -> $.rmClass QR.nodes.el, 'focus' - $.get 'captchas', [], (item) => - @sync item['captchas'] + $.get 'captchas', [], ({captchas}) => + @sync captchas $.sync 'captchas', @sync # start with an uncached captcha @reload() @@ -805,7 +805,8 @@ QR = $.addClass QR.nodes.el, 'has-captcha' $.after QR.nodes.com.parentNode, [imgContainer, input] - sync: (@captchas) -> + sync: (captchas) -> + QR.captcha.captchas = captchas QR.captcha.count() getOne: -> From 3be249323a23e8501dbc0bf2e29635437c0dde24 Mon Sep 17 00:00:00 2001 From: Jordan Bates Date: Mon, 22 Jul 2013 08:12:10 -0700 Subject: [PATCH 02/12] Change some defaults --- src/General/Config.coffee | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 6775061d7..ff73cec6d 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -30,7 +30,7 @@ Config = 'Localize and format timestamps.' ] 'Relative Post Dates': [ - false + true 'Display dates like "3 minutes ago". Tooltip shows the timestamp.' ] 'File Info Formatting': [ @@ -116,11 +116,11 @@ Config = 'Hide replies of hidden posts, recursively.' ] 'Thread Hiding Buttons': [ - true + false 'Add buttons to hide entire threads.' ] 'Reply Hiding Buttons': [ - true + false 'Add buttons to hide single replies.' ] 'Filtered Backlinks': [ @@ -138,7 +138,7 @@ Config = 'Expand images.' ] 'Image Hover': [ - false + true 'Show full image on mouseover.' ] 'Sauce': [ @@ -248,7 +248,7 @@ Config = 'Bookmark threads.' ] 'Toggleable Thread Watcher': [ - false + true 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.' ] 'Auto Watch': [ @@ -266,11 +266,11 @@ Config = 'All-in-one form to reply, create threads, automate dumping and more.' ] 'Persistent QR': [ - false + true 'The Quick reply won\'t disappear after posting.' ] 'Auto Hide QR': [ - false + true 'Automatically hide the quick reply when posting.' ] 'Open Post in New Tab': [ @@ -370,13 +370,13 @@ Config = 'Add \'(Cross-thread)\' to cross-threads quotes.' ] 'Quote Threading': [ - false + true 'Thread conversations' ] imageExpansion: 'Fit width': [ - true + false '' ] 'Fit height': [ @@ -388,7 +388,7 @@ Config = 'Expand all images along with spoilers.' ] 'Expand from here': [ - true + false 'Expand all images only from current position to thread end.' ] 'Advance on contract': [ @@ -476,7 +476,17 @@ http://iqdb.org/?url=%TURL boardnav: """ [ toggle-all ] -[current-title] +a-replace +g-replace +v-replace +vg-replace +vr-replace +ck-replace +fit-replace +jp-replace +mu-replace +tv-replace +q-replace [external-text:"FAQ","https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions"] """ From caadc68c72583d02b16699596580362f3941824e Mon Sep 17 00:00:00 2001 From: Jordan Bates Date: Mon, 22 Jul 2013 08:13:51 -0700 Subject: [PATCH 03/12] Build --- builds/4chan-X.js | 22 +++++++++++----------- builds/4chan-X.user.js | 22 +++++++++++----------- builds/crx/script.js | 22 +++++++++++----------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 759b46a82..a03aba2a8 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -126,7 +126,7 @@ '404 Redirect': [true, 'Redirect dead threads and images.'], 'Keybinds': [true, 'Bind actions to keyboard shortcuts.'], 'Time Formatting': [true, 'Localize and format timestamps.'], - 'Relative Post Dates': [false, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'], + 'Relative Post Dates': [true, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'], 'File Info Formatting': [true, 'Reformat the file information.'], 'Comment Expansion': [true, 'Add buttons to expand long comments.'], 'Thread Expansion': [true, 'Add buttons to expand threads.'], @@ -150,14 +150,14 @@ 'Anonymize': [false, 'Make everyone Anonymous.'], 'Filter': [true, 'Self-moderation placebo.'], 'Recursive Hiding': [true, 'Hide replies of hidden posts, recursively.'], - 'Thread Hiding Buttons': [true, 'Add buttons to hide entire threads.'], - 'Reply Hiding Buttons': [true, 'Add buttons to hide single replies.'], + 'Thread Hiding Buttons': [false, 'Add buttons to hide entire threads.'], + 'Reply Hiding Buttons': [false, 'Add buttons to hide single replies.'], 'Filtered Backlinks': [true, 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.'], 'Stubs': [true, 'Show stubs of hidden threads / replies.'] }, 'Images': { 'Image Expansion': [true, 'Expand images.'], - 'Image Hover': [false, 'Show full image on mouseover.'], + 'Image Hover': [true, 'Show full image on mouseover.'], 'Sauce': [true, 'Add sauce links to images.'], 'Reveal Spoilers': [false, 'Reveal spoiler thumbnails.'], 'Replace GIF': [false, 'Replace thumbnail of gifs with its actual image.'], @@ -186,14 +186,14 @@ 'Page Count in Stats': [false, 'Display the page count in the thread stats as well.'], 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], - 'Toggleable Thread Watcher': [false, 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.'], + 'Toggleable Thread Watcher': [true, 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.'], 'Auto Watch': [true, 'Automatically watch threads you start.'], 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] }, 'Posting': { 'Quick Reply': [true, 'All-in-one form to reply, create threads, automate dumping and more.'], - 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.'], - 'Auto Hide QR': [false, 'Automatically hide the quick reply when posting.'], + 'Persistent QR': [true, 'The Quick reply won\'t disappear after posting.'], + 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.'], 'Open Post in New Tab': [true, 'Open new threads or replies to a thread from the index in a new tab.'], 'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'], 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], @@ -218,14 +218,14 @@ 'Highlight Own Posts': [false, 'Highlights own posts if Mark Quotes of You is enabled.'], 'Mark OP Quotes': [true, 'Add \'(OP)\' to OP quotes.'], 'Mark Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes.'], - 'Quote Threading': [false, 'Thread conversations'] + 'Quote Threading': [true, 'Thread conversations'] } }, imageExpansion: { - 'Fit width': [true, ''], + 'Fit width': [false, ''], 'Fit height': [false, ''], 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand from here': [true, 'Expand all images only from current position to thread end.'], + 'Expand from here': [false, 'Expand all images only from current position to thread end.'], 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] }, filter: { @@ -255,7 +255,7 @@ 'Bottom Board List': true, 'Custom Board Navigation': true }, - boardnav: "[ toggle-all ]\n[current-title]\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", + boardnav: "[ toggle-all ]\na-replace\ng-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nfit-replace\njp-replace\nmu-replace\ntv-replace\nq-replace\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", QR: { 'QR.personas': "#email:\"sage\";boards:jp;always" }, diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index d5f993282..290a07a7e 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -126,7 +126,7 @@ '404 Redirect': [true, 'Redirect dead threads and images.'], 'Keybinds': [true, 'Bind actions to keyboard shortcuts.'], 'Time Formatting': [true, 'Localize and format timestamps.'], - 'Relative Post Dates': [false, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'], + 'Relative Post Dates': [true, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'], 'File Info Formatting': [true, 'Reformat the file information.'], 'Comment Expansion': [true, 'Add buttons to expand long comments.'], 'Thread Expansion': [true, 'Add buttons to expand threads.'], @@ -150,14 +150,14 @@ 'Anonymize': [false, 'Make everyone Anonymous.'], 'Filter': [true, 'Self-moderation placebo.'], 'Recursive Hiding': [true, 'Hide replies of hidden posts, recursively.'], - 'Thread Hiding Buttons': [true, 'Add buttons to hide entire threads.'], - 'Reply Hiding Buttons': [true, 'Add buttons to hide single replies.'], + 'Thread Hiding Buttons': [false, 'Add buttons to hide entire threads.'], + 'Reply Hiding Buttons': [false, 'Add buttons to hide single replies.'], 'Filtered Backlinks': [true, 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.'], 'Stubs': [true, 'Show stubs of hidden threads / replies.'] }, 'Images': { 'Image Expansion': [true, 'Expand images.'], - 'Image Hover': [false, 'Show full image on mouseover.'], + 'Image Hover': [true, 'Show full image on mouseover.'], 'Sauce': [true, 'Add sauce links to images.'], 'Reveal Spoilers': [false, 'Reveal spoiler thumbnails.'], 'Replace GIF': [false, 'Replace thumbnail of gifs with its actual image.'], @@ -186,14 +186,14 @@ 'Page Count in Stats': [false, 'Display the page count in the thread stats as well.'], 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], - 'Toggleable Thread Watcher': [false, 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.'], + 'Toggleable Thread Watcher': [true, 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.'], 'Auto Watch': [true, 'Automatically watch threads you start.'], 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] }, 'Posting': { 'Quick Reply': [true, 'All-in-one form to reply, create threads, automate dumping and more.'], - 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.'], - 'Auto Hide QR': [false, 'Automatically hide the quick reply when posting.'], + 'Persistent QR': [true, 'The Quick reply won\'t disappear after posting.'], + 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.'], 'Open Post in New Tab': [true, 'Open new threads or replies to a thread from the index in a new tab.'], 'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'], 'Remember QR Size': [false, 'Remember the size of the Quick reply.'], @@ -219,14 +219,14 @@ 'Highlight Own Posts': [false, 'Highlights own posts if Mark Quotes of You is enabled.'], 'Mark OP Quotes': [true, 'Add \'(OP)\' to OP quotes.'], 'Mark Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes.'], - 'Quote Threading': [false, 'Thread conversations'] + 'Quote Threading': [true, 'Thread conversations'] } }, imageExpansion: { - 'Fit width': [true, ''], + 'Fit width': [false, ''], 'Fit height': [false, ''], 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand from here': [true, 'Expand all images only from current position to thread end.'], + 'Expand from here': [false, 'Expand all images only from current position to thread end.'], 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] }, filter: { @@ -256,7 +256,7 @@ 'Bottom Board List': true, 'Custom Board Navigation': true }, - boardnav: "[ toggle-all ]\n[current-title]\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", + boardnav: "[ toggle-all ]\na-replace\ng-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nfit-replace\njp-replace\nmu-replace\ntv-replace\nq-replace\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", QR: { 'QR.personas': "#email:\"sage\";boards:jp;always" }, diff --git a/builds/crx/script.js b/builds/crx/script.js index def067941..7e1d36a5b 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -107,7 +107,7 @@ '404 Redirect': [true, 'Redirect dead threads and images.'], 'Keybinds': [true, 'Bind actions to keyboard shortcuts.'], 'Time Formatting': [true, 'Localize and format timestamps.'], - 'Relative Post Dates': [false, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'], + 'Relative Post Dates': [true, 'Display dates like "3 minutes ago". Tooltip shows the timestamp.'], 'File Info Formatting': [true, 'Reformat the file information.'], 'Comment Expansion': [true, 'Add buttons to expand long comments.'], 'Thread Expansion': [true, 'Add buttons to expand threads.'], @@ -130,14 +130,14 @@ 'Anonymize': [false, 'Make everyone Anonymous.'], 'Filter': [true, 'Self-moderation placebo.'], 'Recursive Hiding': [true, 'Hide replies of hidden posts, recursively.'], - 'Thread Hiding Buttons': [true, 'Add buttons to hide entire threads.'], - 'Reply Hiding Buttons': [true, 'Add buttons to hide single replies.'], + 'Thread Hiding Buttons': [false, 'Add buttons to hide entire threads.'], + 'Reply Hiding Buttons': [false, 'Add buttons to hide single replies.'], 'Filtered Backlinks': [true, 'When enabled, shows backlinks to filtered posts with a line-through decoration. Otherwise, hides the backlinks.'], 'Stubs': [true, 'Show stubs of hidden threads / replies.'] }, 'Images': { 'Image Expansion': [true, 'Expand images.'], - 'Image Hover': [false, 'Show full image on mouseover.'], + 'Image Hover': [true, 'Show full image on mouseover.'], 'Sauce': [true, 'Add sauce links to images.'], 'Reveal Spoilers': [false, 'Reveal spoiler thumbnails.'], 'Replace GIF': [false, 'Replace thumbnail of gifs with its actual image.'], @@ -167,14 +167,14 @@ 'Page Count in Stats': [false, 'Display the page count in the thread stats as well.'], 'Updater and Stats in Header': [true, 'Places the thread updater and thread stats in the header instead of floating them.'], 'Thread Watcher': [true, 'Bookmark threads.'], - 'Toggleable Thread Watcher': [false, 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.'], + 'Toggleable Thread Watcher': [true, 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.'], 'Auto Watch': [true, 'Automatically watch threads you start.'], 'Auto Watch Reply': [false, 'Automatically watch threads you reply to.'] }, 'Posting': { 'Quick Reply': [true, 'All-in-one form to reply, create threads, automate dumping and more.'], - 'Persistent QR': [false, 'The Quick reply won\'t disappear after posting.'], - 'Auto Hide QR': [false, 'Automatically hide the quick reply when posting.'], + 'Persistent QR': [true, 'The Quick reply won\'t disappear after posting.'], + 'Auto Hide QR': [true, 'Automatically hide the quick reply when posting.'], 'Open Post in New Tab': [true, 'Open new threads or replies to a thread from the index in a new tab.'], 'Remember Subject': [false, 'Remember the subject field, instead of resetting after posting.'], 'Remember Spoiler': [false, 'Remember the spoiler state, instead of resetting after posting.'], @@ -199,14 +199,14 @@ 'Highlight Own Posts': [false, 'Highlights own posts if Mark Quotes of You is enabled.'], 'Mark OP Quotes': [true, 'Add \'(OP)\' to OP quotes.'], 'Mark Cross-thread Quotes': [true, 'Add \'(Cross-thread)\' to cross-threads quotes.'], - 'Quote Threading': [false, 'Thread conversations'] + 'Quote Threading': [true, 'Thread conversations'] } }, imageExpansion: { - 'Fit width': [true, ''], + 'Fit width': [false, ''], 'Fit height': [false, ''], 'Expand spoilers': [true, 'Expand all images along with spoilers.'], - 'Expand from here': [true, 'Expand all images only from current position to thread end.'], + 'Expand from here': [false, 'Expand all images only from current position to thread end.'], 'Advance on contract': [false, 'Advance to next post when contracting an expanded image.'] }, filter: { @@ -236,7 +236,7 @@ 'Bottom Board List': true, 'Custom Board Navigation': true }, - boardnav: "[ toggle-all ]\n[current-title]\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", + boardnav: "[ toggle-all ]\na-replace\ng-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nfit-replace\njp-replace\nmu-replace\ntv-replace\nq-replace\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", QR: { 'QR.personas': "#email:\"sage\";boards:jp;always" }, From cc86e47babd637072676a2dfcea08fe984b7377d Mon Sep 17 00:00:00 2001 From: Jordan Bates Date: Mon, 22 Jul 2013 08:16:02 -0700 Subject: [PATCH 04/12] Release 4chan X v1.2.20. --- CHANGELOG.md | 9 +++++++++ LICENSE | 2 +- builds/4chan-X.js | 6 +++--- builds/4chan-X.meta.js | 2 +- builds/4chan-X.user.js | 6 +++--- builds/crx/manifest.json | 2 +- builds/crx/script.js | 4 ++-- latest.js | 2 +- package.json | 2 +- 9 files changed, 22 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03048b738..30940a03c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +### v1.2.20 +*2013-07-22* + +**MayhemYDG**: +- Fixed captcha caching not syncing across open threads. + +**seaweedchan**: +- Changed some defaults around + ### v1.2.19 *2013-07-14* diff --git a/LICENSE b/LICENSE index 4df702e8f..2c47b0b17 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.2.19 - 2013-07-22 +* 4chan X - Version 1.2.20 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.js b/builds/4chan-X.js index a03aba2a8..2caddec4d 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.2.19 +// @version 1.2.20 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.19 - 2013-07-22 +* 4chan X - Version 1.2.20 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -323,7 +323,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.19', + VERSION: '1.2.20', NAMESPACE: '4chan X.', boards: {}, threads: {}, diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index 83b98d198..ffca0bef8 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.2.19 +// @version 1.2.20 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 290a07a7e..a3892e1f1 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.2.19 +// @version 1.2.20 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.19 - 2013-07-22 +* 4chan X - Version 1.2.20 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -320,7 +320,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.19', + VERSION: '1.2.20', NAMESPACE: '4chan X.', boards: {}, threads: {}, diff --git a/builds/crx/manifest.json b/builds/crx/manifest.json index 1010522e9..b3ee0391a 100644 --- a/builds/crx/manifest.json +++ b/builds/crx/manifest.json @@ -1,6 +1,6 @@ { "name": "4chan X", - "version": "1.2.19", + "version": "1.2.20", "manifest_version": 2, "description": "Cross-browser userscript for maximum lurking on 4chan.", "icons": { diff --git a/builds/crx/script.js b/builds/crx/script.js index 7e1d36a5b..48d910537 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.19 - 2013-07-22 +* 4chan X - Version 1.2.20 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -300,7 +300,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.19', + VERSION: '1.2.20', NAMESPACE: '4chan X.', boards: {}, threads: {}, diff --git a/latest.js b/latest.js index acc592203..f6f2af052 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'1.2.19'},'*') +postMessage({version:'1.2.20'},'*') diff --git a/package.json b/package.json index 0becab545..343c4d6b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-X", - "version": "1.2.19", + "version": "1.2.20", "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", From c9ec6b5497dd3612f572619e033c74c9c11e822a Mon Sep 17 00:00:00 2001 From: Jordan Bates Date: Mon, 22 Jul 2013 08:38:49 -0700 Subject: [PATCH 05/12] Fix #113 --- builds/4chan-X.js | 4 ++-- builds/4chan-X.user.js | 4 ++-- builds/crx/script.js | 4 ++-- src/General/Config.coffee | 5 +++++ src/Posting/QuickReply.coffee | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 2caddec4d..7370f87a3 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -255,7 +255,7 @@ 'Bottom Board List': true, 'Custom Board Navigation': true }, - boardnav: "[ toggle-all ]\na-replace\ng-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nfit-replace\njp-replace\nmu-replace\ntv-replace\nq-replace\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", + boardnav: "[ toggle-all ]\na-replace\nc-replace\ng-replace\nk-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nco-replace\nfit-replace\njp-replace\nmu-replace\nsp-replace\ntv-replace\nvp-replace\nq-replace\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", QR: { 'QR.personas': "#email:\"sage\";boards:jp;always" }, @@ -4674,7 +4674,7 @@ } $.ready(this.initReady); if (Conf['Persistent QR']) { - if (g.BOARD.ID !== 'f') { + if (!(g.BOARD.ID === 'f' && g.VIEW === 'index')) { $.on(d, '4chanXInitFinished', this.persist); } else { $.ready(this.persist); diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index a3892e1f1..21509e033 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -256,7 +256,7 @@ 'Bottom Board List': true, 'Custom Board Navigation': true }, - boardnav: "[ toggle-all ]\na-replace\ng-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nfit-replace\njp-replace\nmu-replace\ntv-replace\nq-replace\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", + boardnav: "[ toggle-all ]\na-replace\nc-replace\ng-replace\nk-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nco-replace\nfit-replace\njp-replace\nmu-replace\nsp-replace\ntv-replace\nvp-replace\nq-replace\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", QR: { 'QR.personas': "#email:\"sage\";boards:jp;always" }, @@ -4658,7 +4658,7 @@ } $.ready(this.initReady); if (Conf['Persistent QR']) { - if (g.BOARD.ID !== 'f') { + if (!(g.BOARD.ID === 'f' && g.VIEW === 'index')) { $.on(d, '4chanXInitFinished', this.persist); } else { $.ready(this.persist); diff --git a/builds/crx/script.js b/builds/crx/script.js index 48d910537..266836297 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -236,7 +236,7 @@ 'Bottom Board List': true, 'Custom Board Navigation': true }, - boardnav: "[ toggle-all ]\na-replace\ng-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nfit-replace\njp-replace\nmu-replace\ntv-replace\nq-replace\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", + boardnav: "[ toggle-all ]\na-replace\nc-replace\ng-replace\nk-replace\nv-replace\nvg-replace\nvr-replace\nck-replace\nco-replace\nfit-replace\njp-replace\nmu-replace\nsp-replace\ntv-replace\nvp-replace\nq-replace\n[external-text:\"FAQ\",\"https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions\"]", QR: { 'QR.personas': "#email:\"sage\";boards:jp;always" }, @@ -4664,7 +4664,7 @@ } $.ready(this.initReady); if (Conf['Persistent QR']) { - if (g.BOARD.ID !== 'f') { + if (!(g.BOARD.ID === 'f' && g.VIEW === 'index')) { $.on(d, '4chanXInitFinished', this.persist); } else { $.ready(this.persist); diff --git a/src/General/Config.coffee b/src/General/Config.coffee index ff73cec6d..84b210e54 100644 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -477,15 +477,20 @@ http://iqdb.org/?url=%TURL boardnav: """ [ toggle-all ] a-replace +c-replace g-replace +k-replace v-replace vg-replace vr-replace ck-replace +co-replace fit-replace jp-replace mu-replace +sp-replace tv-replace +vp-replace q-replace [external-text:"FAQ","https://github.com/seaweedchan/4chan-x/wiki/Frequently-Asked-Questions"] """ diff --git a/src/Posting/QuickReply.coffee b/src/Posting/QuickReply.coffee index 930a8b3fd..b410dc77f 100644 --- a/src/Posting/QuickReply.coffee +++ b/src/Posting/QuickReply.coffee @@ -28,7 +28,7 @@ QR = $.ready @initReady if Conf['Persistent QR'] - unless g.BOARD.ID is 'f' + unless g.BOARD.ID is 'f' and g.VIEW is 'index' $.on d, '4chanXInitFinished', @persist else $.ready @persist From 07cb9074e0e224d00058c4196a1f0ac091b34586 Mon Sep 17 00:00:00 2001 From: Jordan Bates Date: Mon, 22 Jul 2013 08:52:18 -0700 Subject: [PATCH 06/12] Better error message Close #96 --- builds/4chan-X.js | 2 +- builds/4chan-X.user.js | 2 +- builds/crx/script.js | 2 +- src/Posting/QuickReply.coffee | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 7370f87a3..86ed8d266 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -5950,7 +5950,7 @@ QR.cooldown.auto = false; QR.status(); return QR.error($.el('span', { - innerHTML: "Connection error. You may have been banned.\n[FAQ]" + innerHTML: "4chan X encountered an error while posting. Please try again. \n[?/a>]" })); } }; diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 21509e033..0c356d52a 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -5960,7 +5960,7 @@ QR.cooldown.auto = false; QR.status(); return QR.error($.el('span', { - innerHTML: "Connection error. You may have been banned.\n[FAQ]" + innerHTML: "4chan X encountered an error while posting. Please try again. \n[?/a>]" })); } }; diff --git a/builds/crx/script.js b/builds/crx/script.js index 266836297..fb82a18ff 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -5942,7 +5942,7 @@ QR.cooldown.auto = false; QR.status(); return QR.error($.el('span', { - innerHTML: "Connection error. You may have been banned.\n[FAQ]" + innerHTML: "4chan X encountered an error while posting. Please try again. \n[?/a>]" })); } }; diff --git a/src/Posting/QuickReply.coffee b/src/Posting/QuickReply.coffee index b410dc77f..1de316360 100644 --- a/src/Posting/QuickReply.coffee +++ b/src/Posting/QuickReply.coffee @@ -1084,8 +1084,8 @@ QR = QR.status() QR.error $.el 'span', innerHTML: """ - Connection error. You may have been banned. - [FAQ] + 4chan X encountered an error while posting. Please try again. + [?/a>] """ opts = cred: true From 46f4b5325dd533ef4dca39d3b6ea84de80801b65 Mon Sep 17 00:00:00 2001 From: Jordan Bates Date: Mon, 22 Jul 2013 08:55:30 -0700 Subject: [PATCH 07/12] Release 4chan X v1.2.21. --- CHANGELOG.md | 7 +++++++ LICENSE | 2 +- builds/4chan-X.js | 6 +++--- builds/4chan-X.meta.js | 2 +- builds/4chan-X.user.js | 6 +++--- builds/crx/manifest.json | 2 +- builds/crx/script.js | 4 ++-- latest.js | 2 +- package.json | 2 +- 9 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30940a03c..48e78ddb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +### v1.2.21 +*2013-07-22* + +**seaweedchan**: +- Fix /f/ posting. +- Change the "Connection error" message, and point to my own FAQ instead of Mayhem's. + ### v1.2.20 *2013-07-22* diff --git a/LICENSE b/LICENSE index 2c47b0b17..831cca9b8 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.2.20 - 2013-07-22 +* 4chan X - Version 1.2.21 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 86ed8d266..bfe130e3c 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.2.20 +// @version 1.2.21 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.20 - 2013-07-22 +* 4chan X - Version 1.2.21 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -323,7 +323,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.20', + VERSION: '1.2.21', NAMESPACE: '4chan X.', boards: {}, threads: {}, diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index ffca0bef8..81ea4487d 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.2.20 +// @version 1.2.21 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 0c356d52a..263d970bb 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.2.20 +// @version 1.2.21 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.20 - 2013-07-22 +* 4chan X - Version 1.2.21 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -320,7 +320,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.20', + VERSION: '1.2.21', NAMESPACE: '4chan X.', boards: {}, threads: {}, diff --git a/builds/crx/manifest.json b/builds/crx/manifest.json index b3ee0391a..7ce1cb8db 100644 --- a/builds/crx/manifest.json +++ b/builds/crx/manifest.json @@ -1,6 +1,6 @@ { "name": "4chan X", - "version": "1.2.20", + "version": "1.2.21", "manifest_version": 2, "description": "Cross-browser userscript for maximum lurking on 4chan.", "icons": { diff --git a/builds/crx/script.js b/builds/crx/script.js index fb82a18ff..ba672a2c2 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.20 - 2013-07-22 +* 4chan X - Version 1.2.21 - 2013-07-22 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -300,7 +300,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.20', + VERSION: '1.2.21', NAMESPACE: '4chan X.', boards: {}, threads: {}, diff --git a/latest.js b/latest.js index f6f2af052..415409ac2 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'1.2.20'},'*') +postMessage({version:'1.2.21'},'*') diff --git a/package.json b/package.json index 343c4d6b9..a85b65c3b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-X", - "version": "1.2.20", + "version": "1.2.21", "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", From c34f6693cb439a58dd278efa1631a6a6689b1fa3 Mon Sep 17 00:00:00 2001 From: seaweedchan Date: Tue, 23 Jul 2013 01:44:15 -0700 Subject: [PATCH 08/12] Release 4chan X v1.2.22. --- CHANGELOG.md | 6 + Gruntfile.coffee | 6 +- LICENSE | 2 +- builds/4chan-X.js | 406 ++---------------------------------- builds/4chan-X.meta.js | 2 +- builds/4chan-X.user.js | 405 ++--------------------------------- builds/crx/manifest.json | 2 +- builds/crx/script.js | 400 +---------------------------------- latest.js | 2 +- src/Archive/Redirect.coffee | 10 +- 10 files changed, 57 insertions(+), 1184 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e78ddb6..0890d93c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### v1.2.22 +*2013-07-23* + +**seaweedchan** +- Update archives. + ### v1.2.21 *2013-07-22* diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 690085041..0355af485 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -192,19 +192,19 @@ module.exports = (grunt) -> ] grunt.registerTask 'patch', [ - 'bump' + 'bump-only' 'reloadPkg' 'updcl:3' ] grunt.registerTask 'minor', [ - 'bump:minor' + 'bump-only:minor' 'reloadPkg' 'updcl:2' ] grunt.registerTask 'major', [ - 'bump:major' + 'bump-only:major' 'reloadPkg' 'updcl:1' ] diff --git a/LICENSE b/LICENSE index 831cca9b8..93a8c2b94 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.2.21 - 2013-07-22 +* 4chan X - Version 1.2.22 - 2013-07-23 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.js b/builds/4chan-X.js index bfe130e3c..ee1d6894e 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.2.21 +// @version 1.2.22 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.21 - 2013-07-22 +* 4chan X - Version 1.2.22 - 2013-07-23 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -323,7 +323,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.21', + VERSION: '1.2.22', NAMESPACE: '4chan X.', boards: {}, threads: {}, @@ -340,7 +340,6 @@ Array.prototype.add = function(object, position) { var keep; - keep = this.slice(position); this.length = position; this.push(object); @@ -353,7 +352,6 @@ Array.prototype.indexOf = function(object) { var i; - i = this.length; while (i--) { if (this[i] === object) { @@ -365,7 +363,6 @@ Array.prototype.pushArrays = function() { var arg, args, _i, _len; - args = arguments; for (_i = 0, _len = args.length; _i < _len; _i++) { arg = args[_i]; @@ -376,7 +373,6 @@ Array.prototype.remove = function(object) { var index; - if ((index = this.indexOf(object)) > -1) { return this.splice(index, 1); } else { @@ -393,7 +389,6 @@ $.extend = function(object, properties) { var key, val; - for (key in properties) { val = properties[key]; if (!properties.hasOwnProperty(key)) { @@ -411,7 +406,6 @@ $.ready = function(fc) { var cb, _ref; - if ((_ref = d.readyState) === 'interactive' || _ref === 'complete') { $.queueTask(fc); return; @@ -425,7 +419,6 @@ $.formData = function(form) { var fd, key, val; - if (form instanceof HTMLFormElement) { return new FormData(form); } @@ -446,7 +439,6 @@ $.ajax = function(url, callbacks, opts) { var cred, err, form, headers, key, r, sync, type, upCallbacks, val; - if (opts == null) { opts = {}; } @@ -472,11 +464,9 @@ $.cache = (function() { var reqs; - reqs = {}; return function(url, cb) { var err, req, rm; - if (req = reqs[url]) { if (req.readyState === 4) { cb.call(req, req.evt); @@ -492,7 +482,6 @@ req = $.ajax(url, { onload: function(e) { var _i, _len, _ref; - _ref = this.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { cb = _ref[_i]; @@ -534,7 +523,6 @@ $.addStyle = function(css, id) { var style; - style = $.el('style', { id: id, textContent: css @@ -581,7 +569,6 @@ } else { return function(el) { var _ref; - return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; }; } @@ -589,7 +576,6 @@ $.rmAll = function(root) { var node; - while (node = root.firstChild) { root.removeChild(node); } @@ -605,7 +591,6 @@ $.nodes = function(nodes) { var frag, node, _i, _len; - if (!(nodes instanceof Array)) { return nodes; } @@ -639,7 +624,6 @@ $.el = function(tag, properties) { var el; - el = d.createElement(tag); if (properties) { $.extend(el, properties); @@ -649,7 +633,6 @@ $.on = function(el, events, handler) { var event, _i, _len, _ref; - _ref = events.split(' '); for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; @@ -659,7 +642,6 @@ $.off = function(el, events, handler) { var event, _i, _len, _ref; - _ref = events.split(' '); for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; @@ -683,7 +665,6 @@ $.debounce = function(wait, fn) { var args, exec, lastCall, that, timeout; - lastCall = 0; timeout = null; that = null; @@ -705,11 +686,9 @@ $.queueTask = (function() { var execTask, taskChannel, taskQueue; - taskQueue = []; execTask = function() { var args, func, task; - task = taskQueue.shift(); func = task[0]; args = Array.prototype.slice.call(task, 1); @@ -732,7 +711,6 @@ $.globalEval = function(code) { var script; - script = $.el('script', { textContent: code }); @@ -742,7 +720,6 @@ $.bytesToString = function(size) { var unit; - unit = 0; while (size >= 1024) { size /= 1024; @@ -761,7 +738,6 @@ $.sync = (function() { window.addEventListener('storage', function(e) { var cb; - if (cb = $.syncing[e.key]) { return cb(JSON.parse(e.newValue)); } @@ -773,7 +749,6 @@ $.item = function(key, val) { var item; - item = {}; item[key] = val; return item; @@ -781,11 +756,9 @@ (function() { var scriptStorage; - scriptStorage = opera.scriptStorage; $["delete"] = function(keys) { var key, _i, _len; - if (!(keys instanceof Array)) { keys = [keys]; } @@ -798,7 +771,6 @@ }; $.get = function(key, val, cb) { var items; - if (typeof cb === 'function') { items = $.item(key, val); } else { @@ -816,7 +788,6 @@ }; $.set = (function() { var set; - set = function(key, val) { key = g.NAMESPACE + key; val = JSON.stringify(val); @@ -827,7 +798,6 @@ }; return function(keys, val) { var key; - if (typeof keys === 'string') { set(keys, val); return; @@ -896,7 +866,6 @@ function Post(root, thread, board, that) { var alt, anchor, capcode, date, email, file, fileInfo, flag, info, name, post, size, subject, thumb, tripcode, uniqueID, unit; - this.thread = thread; this.board = board; if (that == null) { @@ -995,7 +964,6 @@ Post.prototype.parseComment = function() { var bq, data, i, node, nodes, text, _i, _len, _ref; - bq = this.nodes.comment.cloneNode(true); _ref = $$('.abbr, .capcodeReplies, .exif, b', bq); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1013,7 +981,6 @@ Post.prototype.parseQuotes = function() { var hash, pathname, quotelink, quotes, _i, _len, _ref; - quotes = {}; _ref = $$('.quotelink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1043,7 +1010,6 @@ Post.prototype.kill = function(file, now) { var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1; - now || (now = new Date()); if (file) { if (this.file.isDead) { @@ -1092,7 +1058,6 @@ Post.prototype.resurrect = function() { var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1; - delete this.isDead; delete this.timeOfDeath; $.rmClass(this.nodes.root, 'deleted-post'); @@ -1126,7 +1091,6 @@ Post.prototype.rmClone = function(index) { var clone, _i, _len, _ref; - this.clones.splice(index, 1); _ref = this.clones.slice(index); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1144,7 +1108,6 @@ function Clone(origin, context) { var file, index, info, inline, inlined, key, nodes, post, root, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; - this.origin = origin; this.context = context; _ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']; @@ -1233,7 +1196,6 @@ function DataBoard(key, sync) { var init, _this = this; - this.key = key; this.data = Conf[key]; $.sync(key, this.onSync.bind(this)); @@ -1250,7 +1212,6 @@ DataBoard.prototype["delete"] = function(_arg) { var boardID, postID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID; if (postID) { delete this.data.boards[boardID][threadID][postID]; @@ -1271,7 +1232,6 @@ DataBoard.prototype.deleteIfEmpty = function(_arg) { var boardID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID; if (threadID) { if (!Object.keys(this.data.boards[boardID][threadID]).length) { @@ -1287,7 +1247,6 @@ DataBoard.prototype.set = function(_arg) { var boardID, postID, threadID, val, _base, _base1, _base2; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val; if (postID !== void 0) { ((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val; @@ -1301,7 +1260,6 @@ DataBoard.prototype.get = function(_arg) { var ID, board, boardID, defaultValue, postID, thread, threadID, val, _i, _len; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, defaultValue = _arg.defaultValue; if (board = this.data.boards[boardID]) { if (!threadID) { @@ -1325,7 +1283,6 @@ DataBoard.prototype.clean = function() { var boardID, now, val, _ref; - _ref = this.data.boards; for (boardID in _ref) { val = _ref[boardID]; @@ -1345,10 +1302,8 @@ DataBoard.prototype.ajaxClean = function(boardID) { var _this = this; - return $.cache("//api.4chan.org/" + boardID + "/threads.json", function(e) { var board, page, thread, threads, _i, _j, _len, _len1, _ref, _ref1; - if (e.target.status === 404) { _this["delete"](boardID); } else if (e.target.status === 200) { @@ -1459,7 +1414,6 @@ init: function() { var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, _this = this; - this.menu = new UI.Menu('header'); this.menuButton = $.el('span', { className: 'menu-button', @@ -1543,7 +1497,6 @@ } $.asap((function() { var _ref; - return $.id('boardNavMobile') || ((_ref = d.readyState) === 'interactive' || _ref === 'complete'); }), Header.setBoardList); $.prepend(d.body, _this.bar); @@ -1552,7 +1505,6 @@ }); return $.ready(function() { var a, cs; - _this.footer = $.id('boardNavDesktopFoot'); if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { a.className = 'current'; @@ -1586,7 +1538,6 @@ }), setBoardList: function() { var a, boardList, btn, fourchannav, fullBoardList; - fourchannav = $.id('boardNavDesktop'); if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) { a.className = 'current'; @@ -1608,7 +1559,6 @@ }, generateBoardList: function(text) { var as, list, nodes; - list = $('#custom-board-list', Header.bar); $.rmAll(list); if (!text) { @@ -1617,7 +1567,6 @@ as = $$('#full-board-list a', Header.bar); nodes = text.match(/[\w@]+((-(all|title|replace|full|index|catalog|url:"[^"]+[^"]"|text:"[^"]+")|\,"[^"]+[^"]"))*|[^\w@]+/g).map(function(t) { var a, board, m, _i, _len; - if (/^[^\w@]/.test(t)) { return $.tn(t); } @@ -1664,7 +1613,6 @@ }, toggleBoardList: function() { var bar, custom, full, showBoardList; - bar = Header.bar; custom = $('#custom-board-list', bar); full = $('#full-board-list', bar); @@ -1700,7 +1648,6 @@ }, toggleLinkJustify: function() { var centered; - $.event('CloseMenu'); centered = this.nodeName === 'INPUT' ? this.checked : void 0; Header.setLinkJustify(centered); @@ -1730,7 +1677,6 @@ }, toggleBarVisibility: function(e) { var hide, message; - if (e.type === 'mousedown' && e.button !== 0) { return; } @@ -1747,7 +1693,6 @@ }, toggleFooterVisibility: function() { var hide, message; - $.event('CloseMenu'); hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden; Header.setFooterVisibility(hide); @@ -1757,7 +1702,6 @@ }, setCustomNav: function(show) { var btn, cust, full, _ref; - Header.customNavToggler.checked = show; cust = $('#custom-board-list', Header.bar); full = $('#full-board-list', Header.bar); @@ -1770,14 +1714,12 @@ }, editCustomNav: function() { var settings; - Settings.open('Advanced'); settings = $.id('fourchanx-settings'); return $('input[name=boardnav]', settings).focus(); }, hashScroll: function() { var hash, post; - if (!((hash = this.location.hash.slice(1)) && (post = $.id(hash)))) { return; } @@ -1788,7 +1730,6 @@ }, scrollToPost: function(post) { var headRect, top; - top = post.getBoundingClientRect().top; if (Conf['Fixed Header'] && !Conf['Bottom Header']) { headRect = Header.bar.getBoundingClientRect(); @@ -1798,7 +1739,6 @@ }, addShortcut: function(el) { var shortcut; - shortcut = $.el('span', { className: 'shortcut fourchanx-link' }); @@ -1810,7 +1750,6 @@ }, createNotification: function(e) { var cb, content, lifetime, notif, type, _ref; - _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; notif = new Notification(type, content, lifetime); if (cb) { @@ -1823,7 +1762,6 @@ spoilerRange: {}, shortFilename: function(filename, isReply) { var threshold; - threshold = isReply ? 30 : 40; if (filename.length - 4 > threshold) { return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); @@ -1833,7 +1771,6 @@ }, postFromObject: function(data, boardID) { var o; - o = { postID: data.no, threadID: data.resto || data.no, @@ -1877,7 +1814,6 @@ */ var a, boardID, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; - postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file; isOP = postID === threadID; staticPath = '//static.4chan.org/image/'; @@ -1973,7 +1909,6 @@ Get = { threadExcerpt: function(thread) { var OP, excerpt, _ref; - OP = thread.OP; excerpt = ((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || Conf['Anonymize'] && 'Anonymous' || $('.nameBlock', OP.nodes.info).textContent.trim(); if (excerpt.length > 70) { @@ -1986,7 +1921,6 @@ }, postFromRoot: function(root) { var boardID, index, link, post, postID; - link = $('a[title="Highlight this post"]', root); boardID = link.pathname.split('/')[1]; postID = link.hash.slice(2); @@ -2006,7 +1940,6 @@ }, postDataFromLink: function(link) { var boardID, path, postID, threadID; - if (link.hostname === 'boards.4chan.org') { path = link.pathname.split('/'); boardID = path[1]; @@ -2025,7 +1958,6 @@ }, allQuotelinksLinkingTo: function(post) { var ID, quote, quotedPost, quotelinks, quoterPost, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; - quotelinks = []; _ref = g.posts; for (ID in _ref) { @@ -2054,14 +1986,12 @@ } return quotelinks.filter(function(quotelink) { var boardID, postID, _ref4; - _ref4 = Get.postDataFromLink(quotelink), boardID = _ref4.boardID, postID = _ref4.postID; return boardID === post.board.ID && postID === post.ID; }); }, postClone: function(boardID, threadID, postID, root, context) { var post, url; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2082,7 +2012,6 @@ }, insert: function(post, root, context) { var clone, nodes; - if (!root.parentNode) { return; } @@ -2096,7 +2025,6 @@ }, fetchedPost: function(req, boardID, threadID, postID, root, context) { var board, post, posts, status, thread, url, _i, _len; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2146,7 +2074,6 @@ }, archivedPost: function(req, boardID, postID, root, context) { var board, bq, comment, data, o, post, thread, threadID, _ref; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2240,10 +2167,8 @@ UI = (function() { var Menu, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove; - dialog = function(id, position, html) { var child, el, move, _i, _len, _ref; - el = $.el('div', { className: 'dialog', innerHTML: html, @@ -2283,7 +2208,6 @@ Menu.prototype.makeMenu = function() { var menu; - menu = $.el('div', { className: 'dialog', id: 'menu', @@ -2298,7 +2222,6 @@ Menu.prototype.toggle = function(e, button, data) { var previousButton; - e.preventDefault(); e.stopPropagation(); if (currentMenu) { @@ -2316,7 +2239,6 @@ Menu.prototype.open = function(button, data) { var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2; - menu = this.makeMenu(); currentMenu = menu; lastToggledButton = button; @@ -2355,7 +2277,6 @@ Menu.prototype.insertEntry = function(entry, parent, data) { var subEntry, submenu, _i, _len, _ref; - if (typeof entry.open === 'function') { if (!entry.open(data)) { return; @@ -2389,7 +2310,6 @@ Menu.prototype.findNextEntry = function(entry, direction) { var entries; - entries = __slice.call(entry.parentNode.children); entries.sort(function(first, second) { return +(first.style.order || first.style.webkitOrder) - +(second.style.order || second.style.webkitOrder); @@ -2399,7 +2319,6 @@ Menu.prototype.keybinds = function(e) { var entry, next, nextPrev, subEntry, submenu; - entry = $('.focused', currentMenu); while (subEntry = $('.focused', entry)) { entry = subEntry; @@ -2445,7 +2364,6 @@ Menu.prototype.focus = function(entry) { var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2; - while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) { $.rmClass(focused, 'focused'); } @@ -2473,7 +2391,6 @@ Menu.prototype.addEntry = function(e) { var entry; - entry = e.detail; if (entry.type !== this.type) { return; @@ -2484,7 +2401,6 @@ Menu.prototype.parseEntry = function(entry) { var el, style, subEntries, subEntry, _i, _len; - el = entry.el, subEntries = entry.subEntries; $.addClass(el, 'entry'); $.on(el, 'focus mouseover', (function(e) { @@ -2508,7 +2424,6 @@ })(); dragstart = function(e) { var el, isTouching, o, rect, screenHeight, screenWidth, _ref; - if (e.type === 'mousedown' && e.button !== 0) { return; } @@ -2547,7 +2462,6 @@ }; touchmove = function(e) { var touch, _i, _len, _ref; - _ref = e.changedTouches; for (_i = 0, _len = _ref.length; _i < _len; _i++) { touch = _ref[_i]; @@ -2559,7 +2473,6 @@ }; drag = function(e) { var bottom, clientX, clientY, left, right, style, top; - clientX = e.clientX, clientY = e.clientY; left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; @@ -2575,7 +2488,6 @@ }; touchend = function(e) { var touch, _i, _len, _ref; - _ref = e.changedTouches; for (_i = 0, _len = _ref.length; _i < _len; _i++) { touch = _ref[_i]; @@ -2597,7 +2509,6 @@ }; hoverstart = function(_arg) { var asapTest, cb, el, endEvents, latestEvent, o, root; - root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb; o = { root: root, @@ -2626,7 +2537,6 @@ }; hover = function(e) { var clientX, clientY, height, left, right, style, top, _ref; - this.latestEvent = e; height = this.el.offsetHeight; clientX = e.clientX, clientY = e.clientY; @@ -2669,7 +2579,6 @@ }, node: function() { var email, name, tripcode, _ref; - if (this.info.capcode || this.isClone) { return; } @@ -2696,7 +2605,6 @@ filters: {}, init: function() { var boards, err, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4; - if (g.VIEW === 'catalog' || !Conf['Filter']) { return; } @@ -2733,7 +2641,6 @@ op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'yes'; stub = (function() { var _ref3; - switch ((_ref3 = filter.match(/stub:(yes|no)/)) != null ? _ref3[1] : void 0) { case 'yes': return true; @@ -2764,7 +2671,6 @@ }, createFilter: function(regexp, op, stub, hl, top) { var settings, test; - test = typeof regexp === 'string' ? function(value) { return regexp === value; } : function(value) { @@ -2788,7 +2694,6 @@ }, node: function() { var filter, firstThread, key, result, thisThread, value, _i, _len, _ref; - if (this.isClone) { return; } @@ -2900,7 +2805,6 @@ menu: { init: function() { var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) { return; } @@ -2926,7 +2830,6 @@ }, createSubEntry: function(text, type) { var el; - el = $.el('a', { href: 'javascript:;', textContent: text @@ -2937,7 +2840,6 @@ el: el, open: function(post) { var value; - value = Filter[type](post); return value !== false; } @@ -2945,7 +2847,6 @@ }, makeFilter: function() { var re, type, value; - type = this.dataset.type; value = Filter[type](Filter.menu.post); re = ['uniqueID', 'MD5'].contains(type) ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) { @@ -2960,7 +2861,6 @@ re = ['uniqueID', 'MD5'].contains(type) ? "/" + re + "/" : "/^" + re + "$/"; return $.get(type, Conf[type], function(item) { var save, section, select, ta, tl; - save = item[type]; save = save ? "" + save + "\n" + re : re; $.set(type, save); @@ -2994,7 +2894,6 @@ }, node: function() { var data; - if (!this.isReply || this.isClone) { return; } @@ -3018,7 +2917,6 @@ menu: { init: function() { var apply, div, hideStubLink, makeStub, replies, thisPost; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; } @@ -3089,7 +2987,6 @@ order: 20, open: function(post) { var data; - if (!post.isReply || post.isClone || !post.isHidden) { return false; } @@ -3121,7 +3018,6 @@ order: 15, open: function(post) { var data; - if (!post.isReply || post.isClone || !post.isHidden) { return false; } @@ -3138,7 +3034,6 @@ }, hide: function() { var makeStub, parent, post, replies, thisPost; - parent = this.parentNode; thisPost = $('input[name=thisPost]', parent).checked; replies = $('input[name=replies]', parent).checked; @@ -3157,7 +3052,6 @@ }, show: function() { var data, parent, post, replies, thisPost; - parent = this.parentNode; thisPost = $('input[name=thisPost]', parent).checked; replies = $('input[name=replies]', parent).checked; @@ -3181,7 +3075,6 @@ }, hideStub: function() { var post; - post = PostHiding.menu.post; post.nodes.root.hidden = true; $.event('CloseMenu'); @@ -3189,7 +3082,6 @@ }, makeButton: function(post, type) { var a; - a = $.el('a', { className: "" + type + "-reply-button", innerHTML: " " + (type === 'hide' ? '-' : '+') + " ", @@ -3200,7 +3092,6 @@ }, saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) { var data; - data = { boardID: post.board.ID, threadID: post.thread.ID, @@ -3219,7 +3110,6 @@ }, toggle: function() { var post; - post = Get.postFromNode(this); if (post.isHidden) { PostHiding.show(post); @@ -3230,7 +3120,6 @@ }, hide: function(post, makeStub, hideRecursively) { var a, postInfo, quotelink, _i, _len, _ref; - if (makeStub == null) { makeStub = Conf['Stubs']; } @@ -3268,7 +3157,6 @@ }, show: function(post, showRecursively) { var quotelink, _i, _len, _ref; - if (showRecursively == null) { showRecursively = Conf['Recursive Hiding']; } @@ -3304,7 +3192,6 @@ }, node: function() { var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; - if (this.isClone) { return; } @@ -3322,7 +3209,6 @@ }, add: function() { var args, obj, post, recursive, _base, _name; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { recursives: [], @@ -3333,7 +3219,6 @@ }, rm: function(recursive, post) { var i, obj, rec, _i, _len, _ref; - if (!(obj = Recursive.recursives[post.fullID])) { return; } @@ -3348,7 +3233,6 @@ }, apply: function() { var ID, args, fullID, post, recursive, _ref; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; fullID = post.fullID; _ref = g.posts; @@ -3375,7 +3259,6 @@ }, node: function() { var data; - if (data = ThreadHiding.db.get({ boardID: this.board.ID, threadID: this.ID @@ -3389,7 +3272,6 @@ }, syncCatalog: function() { var hiddenThreads, hiddenThreadsOnCatalog, threadID; - hiddenThreads = ThreadHiding.db.get({ boardID: g.BOARD.ID, defaultValue: {} @@ -3416,7 +3298,6 @@ cleanCatalog: function(hiddenThreadsOnCatalog) { return $.cache("//api.4chan.org/" + g.BOARD + "/threads.json", function() { var page, thread, threads, _i, _j, _len, _len1, _ref, _ref1; - if (this.status !== 200) { return; } @@ -3442,7 +3323,6 @@ menu: { init: function() { var apply, div, hideStubLink, makeStub; - if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) { return; } @@ -3469,7 +3349,6 @@ order: 20, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || thread.isHidden) { return false; @@ -3491,7 +3370,6 @@ order: 15, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || !thread.isHidden) { return false; @@ -3502,7 +3380,6 @@ }, hide: function() { var makeStub, thread; - makeStub = $('input', this.parentNode).checked; thread = ThreadHiding.menu.thread; ThreadHiding.hide(thread, makeStub); @@ -3511,7 +3388,6 @@ }, hideStub: function() { var thread; - thread = ThreadHiding.menu.thread; ThreadHiding.hide(thread, false); $.event('CloseMenu'); @@ -3519,7 +3395,6 @@ }, makeButton: function(thread, type) { var a; - a = $.el('a', { className: "" + type + "-thread-button", innerHTML: " " + (type === 'hide' ? '-' : '+') + " ", @@ -3531,7 +3406,6 @@ }, saveHiddenState: function(thread, makeStub) { var hiddenThreadsOnCatalog; - hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; if (thread.isHidden) { ThreadHiding.db.set({ @@ -3564,7 +3438,6 @@ }, hide: function(thread, makeStub) { var OP, a, numReplies, opInfo, span, threadRoot; - if (makeStub == null) { makeStub = Conf['Stubs']; } @@ -3595,7 +3468,6 @@ }, show: function(thread) { var threadRoot; - if (thread.stub) { $.rm(thread.stub); delete thread.stub; @@ -3608,7 +3480,6 @@ QuoteBacklink = { init: function() { var format; - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { return; } @@ -3626,7 +3497,6 @@ }, firstNode: function() { var a, clone, container, containers, frag, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - if (this.isClone || !this.quotes.length) { return; } @@ -3664,7 +3534,6 @@ }, secondNode: function() { var container; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { this.nodes.backlinkContainer = $('.container', this.nodes.info); return; @@ -3678,7 +3547,6 @@ }, getContainer: function(id) { var _base; - return (_base = this.containers)[id] || (_base[id] = $.el('span', { className: 'container' })); @@ -3701,7 +3569,6 @@ }, node: function() { var board, boardID, quotelink, quotelinks, quotes, thread, threadID, _i, _len, _ref, _ref1; - if (this.isClone && this.thread === this.context.thread) { return; } @@ -3737,7 +3604,6 @@ if (Conf['Quote Hash Navigation']) { this.node = function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3750,7 +3616,6 @@ } else { this.node = function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3774,7 +3639,6 @@ }, toggle: function(e) { var boardID, context, postID, threadID, _ref; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { return; } @@ -3800,7 +3664,6 @@ }, add: function(quotelink, boardID, threadID, postID, context) { var inline, isBacklink, post, qroot, root; - isBacklink = $.hasClass(quotelink, 'backlink'); inline = $.el('div', { id: "i" + postID, @@ -3825,7 +3688,6 @@ }, rm: function(quotelink, boardID, threadID, postID, context) { var el, inlined, isBacklink, post, qroot, root, _ref; - isBacklink = $.hasClass(quotelink, 'backlink'); root = QuoteInline.findRoot(quotelink, isBacklink); root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); @@ -3867,7 +3729,6 @@ }, node: function() { var boardID, op, postID, quotelink, quotelinks, quotes, _i, _j, _len, _len1, _ref; - if (this.isClone && this.thread === this.context.thread) { return; } @@ -3910,7 +3771,6 @@ }, node: function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3919,7 +3779,6 @@ }, mouseover: function(e) { var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, root, threadID, workaround, _i, _j, _len, _len1, _ref, _ref1; - if ($.hasClass(this, 'inlined')) { return; } @@ -3975,7 +3834,6 @@ }, mouseout: function() { var clone, post, root, _i, _len, _ref; - if (!(root = this.el.firstElementChild)) { return; } @@ -4005,7 +3863,6 @@ }, node: function() { var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; - if (this.isClone) { return; } @@ -4028,7 +3885,6 @@ QuoteThreading = { init: function() { var input; - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { return; } @@ -4051,7 +3907,6 @@ }, setup: function() { var ID, post, posts; - $.off(d, '4chanXInitFinished', QuoteThreading.setup); posts = g.posts; for (ID in posts) { @@ -4064,7 +3919,6 @@ }, node: function() { var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; - if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { return; } @@ -4094,7 +3948,6 @@ }, nodeinsert: function() { var bottom, height, posts, qpost, qroot, threadContainer, top, _ref; - posts = g.posts; qpost = posts[this.threaded]; delete this.threaded; @@ -4124,14 +3977,12 @@ }, toggle: function() { var container, containers, node, nodes, replies, reply, thread, _i, _j, _len, _len1; - thread = $('.thread'); replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); QuoteThreading.enabled = this.checked; if (this.checked) { nodes = (function() { var _i, _len, _results; - _results = []; for (_i = 0, _len = replies.length; _i < _len; _i++) { reply = replies[_i]; @@ -4146,7 +3997,6 @@ } else { replies.sort(function(a, b) { var aID, bID; - aID = Number(a.id.slice(2)); bID = Number(b.id.slice(2)); return aID - bID; @@ -4162,7 +4012,6 @@ }, kb: function() { var control; - control = $.id('threadingControl'); return control.click(); } @@ -4189,7 +4038,6 @@ }, node: function() { var quotelink, _i, _len, _ref; - if (this.isClone) { return; } @@ -4225,7 +4073,6 @@ }, node: function() { var deadlink, _i, _len, _ref; - _ref = $$('.deadlink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { deadlink = _ref[_i]; @@ -4240,7 +4087,6 @@ }, parseDeadlink: function(deadlink) { var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; - if (deadlink.parentNode.className === 'prettyprint') { $.replace(deadlink, __slice.call(deadlink.childNodes)); return; @@ -4320,7 +4166,6 @@ cypher: $.el('div'), node: function() { var a, child, cypher, cypherText, data, embed, embedder, embeds, i, index, len, link, links, lookahead, name, next, node, nodes, snapshot, spoiler, text, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2; - if (this.isClone && Conf['Embedding']) { _ref = $$('.embedder', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -4405,7 +4250,6 @@ }, toggle: function() { var el, embed, style, type, url; - embed = this.previousElementSibling; if (this.className.contains("embedded")) { el = $.el('a', { @@ -4499,7 +4343,6 @@ style: 'height: auto; width: 500px; display: inline-block;', el: function() { var div; - div = $.el('div', { className: "soundcloud", name: "soundcloud" @@ -4525,7 +4368,6 @@ regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/, el: function() { var div; - return div = $.el('iframe', { src: "http://pastebin.com/embed_iframe.php?i=" + this.name }); @@ -4535,7 +4377,6 @@ regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/, el: function() { var div; - return div = $.el('iframe', { src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js" }); @@ -4546,7 +4387,6 @@ }, text: function() { var file, response; - response = JSON.parse(this.responseText).files; for (file in response) { if (response.hasOwnProperty(file)) { @@ -4567,14 +4407,12 @@ }, embedder: function(a) { var callbacks, embed, key, match, service, titles, type, _ref; - if (!Conf['Link Title']) { return [a]; } titles = {}; callbacks = function() { var title; - return a.textContent = (function() { switch (this.status) { case 200: @@ -4616,7 +4454,6 @@ if (Conf['Link Title'] && (service = type.title)) { $.get('CachedTitles', {}, function(item) { var err, title; - titles = item['CachedTitles']; if (title = titles[match[1]]) { a.textContent = title[0]; @@ -4640,7 +4477,6 @@ QR = { init: function() { var sc; - if (!Conf['Quick Reply']) { return; } @@ -4687,7 +4523,6 @@ }, initReady: function() { var link; - QR.postingIsEnabled = !!$.id('postForm'); if (!QR.postingIsEnabled) { return; @@ -4707,13 +4542,11 @@ $.before($.id('postForm'), link); $.on(d, 'QRGetSelectedPost', function(_arg) { var cb; - cb = _arg.detail; return cb(QR.selected); }); $.on(d, 'QRAddPreSubmitHook', function(_arg) { var cb; - cb = _arg.detail; return QR.preSubmitHooks.push(cb); }); @@ -4742,7 +4575,6 @@ }, open: function() { var err; - if (QR.nodes) { QR.nodes.el.hidden = false; QR.unhide(); @@ -4761,7 +4593,6 @@ }, close: function() { var i, _i, _len, _ref; - if (QR.req) { QR.abort(); return; @@ -4808,7 +4639,6 @@ }, error: function(err) { var el; - QR.open(); if (typeof err === 'string') { el = $.tn(err); @@ -4836,7 +4666,6 @@ notifications: [], cleanNotifications: function() { var notification, _i, _len, _ref; - _ref = QR.notifications; for (_i = 0, _len = _ref.length; _i < _len; _i++) { notification = _ref[_i]; @@ -4846,7 +4675,6 @@ }, status: function() { var disabled, status, value; - if (!QR.nodes) { return; } @@ -4867,7 +4695,6 @@ QR.persona.getPassword(); return $.get('QR.personas', Conf['QR.personas'], function(_arg) { var arr, item, personas, type, types, _i, _len, _ref; - personas = _arg['QR.personas']; types = { name: [], @@ -4887,7 +4714,6 @@ }, parseItem: function(item, types) { var boards, match, type, val, _ref, _ref1; - if (item[0] === '#') { return; } @@ -4916,7 +4742,6 @@ }, loadPersonas: function(type, arr) { var list, val, _i, _len; - list = $("#list-" + type, QR.nodes.el); for (_i = 0, _len = arr.length; _i < _len; _i++) { val = arr[_i]; @@ -4930,7 +4755,6 @@ }, getPassword: function() { var input, m; - if (!QR.persona.pwd) { QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : $.id('delPassword').value; } @@ -4939,7 +4763,6 @@ get: function(cb) { return $.get('QR.persona', {}, function(_arg) { var persona; - persona = _arg['QR.persona']; return cb(persona); }); @@ -4947,7 +4770,6 @@ set: function(post) { return $.get('QR.persona', {}, function(_arg) { var persona; - persona = _arg['QR.persona']; persona = { name: post.name, @@ -4961,7 +4783,6 @@ cooldown: { init: function() { var board; - if (!Conf['Cooldown']) { return; } @@ -5003,7 +4824,6 @@ }, sync: function(cooldowns) { var id; - for (id in cooldowns) { QR.cooldown.cooldowns[id] = cooldowns[id]; } @@ -5011,7 +4831,6 @@ }, set: function(data) { var cooldown, delay, hasFile, isReply, isSage, post, req, start, type, upSpd; - if (!Conf['Cooldown']) { return; } @@ -5051,7 +4870,6 @@ }, count: function() { var cooldown, cooldowns, elapsed, hasFile, isReply, isSage, now, post, seconds, start, type, types, upSpd, upSpdAccuracy, update, _ref; - if (!Object.keys(QR.cooldown.cooldowns).length) { $["delete"]("" + g.BOARD + ".cooldown"); delete QR.cooldown.isCounting; @@ -5105,7 +4923,6 @@ }, quote: function(e) { var OP, caretPos, com, index, post, range, s, sel, selectionRoot, text, thread, _ref; - if (e != null) { e.preventDefault(); } @@ -5145,7 +4962,6 @@ }, characterCount: function() { var count, counter; - counter = QR.nodes.charCount; count = QR.nodes.com.textLength; counter.textContent = count; @@ -5154,7 +4970,6 @@ }, drag: function(e) { var toggle; - toggle = e.type === 'dragstart' ? $.off : $.on; toggle(d, 'dragover', QR.dragOver); return toggle(d, 'drop', QR.dropFile); @@ -5174,7 +4989,6 @@ }, paste: function(e) { var blob, files, item, _i, _len, _ref; - files = []; _ref = e.clipboardData.items; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -5202,7 +5016,6 @@ }, fileInput: function(files) { var file, length, max, post, _i, _len; - if (this instanceof Element) { files = __slice.call(this.files); QR.nodes.fileInput.value = null; @@ -5251,7 +5064,6 @@ function _Class(select) { var el, event, prev, _i, _len, _ref, _this = this; - el = $.el('a', { className: 'qr-preview', draggable: true, @@ -5305,7 +5117,6 @@ _Class.prototype.rm = function() { var index; - $.rm(this.nodes.el); index = QR.posts.indexOf(this); if (QR.posts.length === 1) { @@ -5323,7 +5134,6 @@ _Class.prototype.lock = function(lock) { var name, _i, _len, _ref; - if (lock == null) { lock = true; } @@ -5348,7 +5158,6 @@ _Class.prototype.select = function() { var rectEl, rectList; - if (QR.selected) { QR.selected.nodes.el.id = null; QR.selected.forceSave(); @@ -5365,7 +5174,6 @@ _Class.prototype.load = function() { var name, _i, _len, _ref; - _ref = ['thread', 'name', 'email', 'sub', 'com']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { name = _ref[_i]; @@ -5377,7 +5185,6 @@ _Class.prototype.save = function(input) { var value, _ref; - if (input.type === 'checkbox') { this.spoiler = input.checked; return; @@ -5396,7 +5203,6 @@ _Class.prototype.forceSave = function() { var name, _i, _len, _ref; - if (this !== QR.selected) { return; } @@ -5428,7 +5234,6 @@ _Class.prototype.setThumbnail = function(fileURL) { var img, reader, _this = this; - if (!window.URL) { if (!fileURL) { reader = new FileReader(); @@ -5444,7 +5249,6 @@ img = $.el('img'); img.onload = function() { var applyBlob, cv, data, height, i, l, s, ui8a, width, _i; - s = 90 * 2; if (_this.file.type === 'image/gif') { s *= 3; @@ -5524,11 +5328,9 @@ _Class.prototype.pasteText = function(file) { var reader, _this = this; - reader = new FileReader(); reader.onload = function(e) { var text; - text = e.target.result; if (_this.com) { _this.com += "\n" + text; @@ -5566,7 +5368,6 @@ _Class.prototype.drop = function() { var el, index, newIndex, oldIndex, post; - el = $('.drag', this.parentNode); $.rmClass(el, 'drag'); $.rmClass(this, 'over'); @@ -5601,7 +5402,6 @@ ready: function() { var imgContainer, input, observer, setLifetime, _this = this; - setLifetime = function(e) { return _this.lifetime = e.detail; }; @@ -5643,7 +5443,6 @@ }); $.get('captchas', [], function(_arg) { var captchas; - captchas = _arg.captchas; return _this.sync(captchas); }); @@ -5658,7 +5457,6 @@ }, getOne: function() { var captcha, challenge, response; - this.clear(); if (captcha = this.captchas.shift()) { challenge = captcha.challenge, response = captcha.response; @@ -5683,7 +5481,6 @@ }, save: function() { var response; - if (!(response = this.nodes.input.value.trim())) { return; } @@ -5698,7 +5495,6 @@ }, clear: function() { var captcha, i, now, _i, _len, _ref; - now = Date.now(); _ref = this.captchas; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { @@ -5716,7 +5512,6 @@ }, load: function() { var challenge; - if (!this.nodes.challenge.firstChild) { return; } @@ -5729,7 +5524,6 @@ }, count: function() { var count; - count = this.captchas.length; this.nodes.input.placeholder = (function() { switch (count) { @@ -5762,7 +5556,6 @@ }, dialog: function() { var dialog, mimeTypes, name, nodes, thread, _i, _len, _ref; - dialog = UI.dialog('qr', 'top:0;right:0;', "
No selected file×+
"); QR.nodes = nodes = { el: dialog, @@ -5864,7 +5657,6 @@ preSubmitHooks: [], submit: function(e) { var callbacks, challenge, err, filetag, hook, opts, post, postData, response, textOnly, thread, threadID, _i, _len, _ref, _ref1; - if (e != null) { e.preventDefault(); } @@ -5977,7 +5769,6 @@ }, response: function() { var URL, ban, board, err, h1, isReply, m, post, postID, req, threadID, tmpDoc, _, _ref, _ref1; - QR.req.upload.onload(); req = QR.req; delete QR.req; @@ -6081,7 +5872,6 @@ FappeTyme = { init: function() { var el, input; - if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { return; } @@ -6133,7 +5923,6 @@ }, node: function() { var thumb, _ref; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6158,7 +5947,6 @@ }, toggleAll: function() { var ID, file, func, post, _i, _len, _ref, _ref1; - $.event('CloseMenu'); if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { ImageExpand.EAI.className = 'contract-all-shortcut'; @@ -6207,7 +5995,6 @@ }, toggle: function(post) { var headRect, node, rect, root, thumb, top; - thumb = post.file.thumb; if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { ImageExpand.expand(post); @@ -6252,7 +6039,6 @@ }, expand: function(post, src) { var img, thumb; - thumb = post.file.thumb; if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { return; @@ -6280,7 +6066,6 @@ }, completeExpand: function(post) { var prev, thumb; - thumb = post.file.thumb; if (!$.hasClass(thumb, 'expanding')) { return; @@ -6294,7 +6079,6 @@ prev = post.nodes.root.getBoundingClientRect(); return $.queueTask(function() { var curr, root; - $.addClass(post.nodes.root, 'expanded-image'); $.rmClass(post.file.thumb, 'expanding'); if (!(prev.top + prev.height <= 0)) { @@ -6307,7 +6091,6 @@ }, error: function() { var URL, post, src, timeoutID; - post = Get.postFromNode(this); $.rm(this); delete post.file.fullImage; @@ -6333,7 +6116,6 @@ return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { onload: function() { var postObj, _i, _len, _ref; - if (this.status !== 200) { return; } @@ -6357,7 +6139,6 @@ menu: { init: function() { var conf, createSubEntry, el, key, subEntries, _ref; - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { return; } @@ -6381,7 +6162,6 @@ }, createSubEntry: function(type, config) { var input, label; - label = $.el('label', { innerHTML: " " + type }); @@ -6417,7 +6197,6 @@ }, node: function() { var _ref; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6425,7 +6204,6 @@ }, mouseover: function(e) { var el, post; - post = Get.postFromNode(this); el = $.el('img', { id: 'ihover', @@ -6447,7 +6225,6 @@ error: function() { var URL, post, src, timeoutID, _this = this; - if (!doc.contains(this)) { return; } @@ -6472,7 +6249,6 @@ return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { onload: function() { var postObj, _i, _len, _ref; - if (this.status !== 200) { return; } @@ -6498,7 +6274,6 @@ ImageLoader = { init: function() { var prefetch; - if (g.VIEW === 'catalog') { return; } @@ -6525,7 +6300,6 @@ }, node: function() { var URL, img, string, style, thumb, type, _ref, _ref1; - if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6547,7 +6321,6 @@ }, toggle: function() { var enabled, id, post, _ref; - enabled = Conf['prefetch'] = this.checked; if (enabled) { _ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts; @@ -6571,7 +6344,6 @@ }, node: function() { var thumb, _ref; - if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { return; } @@ -6584,7 +6356,6 @@ ArchiveLink = { init: function() { var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { return; } @@ -6597,7 +6368,6 @@ order: 90, open: function(_arg) { var ID, board, thread; - ID = _arg.ID, thread = _arg.thread, board = _arg.board; return !!Redirect.to('thread', { postID: ID, @@ -6616,14 +6386,12 @@ }, createSubEntry: function(text, type) { var el, open; - el = $.el('a', { textContent: text, target: '_blank' }); open = type === 'post' ? function(_arg) { var ID, board, thread; - ID = _arg.ID, thread = _arg.thread, board = _arg.board; el.href = Redirect.to('thread', { postID: ID, @@ -6633,7 +6401,6 @@ return true; } : function(post) { var value; - value = Filter[type](post); if (!value) { return false; @@ -6656,7 +6423,6 @@ DeleteLink = { init: function() { var div, fileEl, fileEntry, postEl, postEntry; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { return; } @@ -6684,7 +6450,6 @@ el: fileEl, open: function(_arg) { var file; - file = _arg.file; if (!file || file.isDead) { return false; @@ -6700,7 +6465,6 @@ order: 40, open: function(post) { var node; - if (post.isDead || post.board.ID === 'q') { return false; } @@ -6715,7 +6479,6 @@ }, "delete": function() { var fileOnly, form, link, post; - post = DeleteLink.post; if (DeleteLink.cooldown.counting === post) { return; @@ -6744,7 +6507,6 @@ }, load: function(link, post, fileOnly, html) { var msg, s, tmpDoc; - tmpDoc = d.implementation.createHTMLDocument(''); tmpDoc.documentElement.innerHTML = html; if (tmpDoc.title === '4chan - Banned') { @@ -6767,7 +6529,6 @@ cooldown: { start: function(post, node) { var length, seconds, _ref; - if (!((_ref = QR.db) != null ? _ref.get({ boardID: post.board.ID, threadID: post.thread.ID, @@ -6801,7 +6562,6 @@ DownloadLink = { init: function() { var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { return; } @@ -6815,7 +6575,6 @@ order: 100, open: function(_arg) { var file; - file = _arg.file; if (!file) { return false; @@ -6841,7 +6600,6 @@ }, node: function() { var button; - button = Menu.makeButton(this); if (this.isClone) { $.replace($('.menu-button', this.nodes.info), button); @@ -6851,11 +6609,9 @@ }, makeButton: (function() { var a; - a = null; return function(post) { var clone; - a || (a = $.el('a', { className: 'menu-button fourchanx-link', innerHTML: '', @@ -6872,7 +6628,6 @@ })(), toggle: function(e) { var post; - post = this.dataset.clone ? Get.postFromNode(this) : g.posts[this.dataset.postid]; return Menu.menu.toggle(e, this, post); } @@ -6881,7 +6636,6 @@ ReportLink = { init: function() { var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { return; } @@ -6903,7 +6657,6 @@ }, report: function() { var id, post, set, url; - post = ReportLink.post; url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; id = Date.now(); @@ -6916,7 +6669,6 @@ init: function() { return $.ready(function() { var href; - Favicon.el = $('link[rel="shortcut icon"]', d.head); Favicon.el.type = 'image/x-icon'; href = Favicon.el.href; @@ -6989,7 +6741,6 @@ init: function() { var sc, _this = this; - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { return; } @@ -7019,7 +6770,6 @@ }, node: function() { var ID, fileCount, post, postCount, _ref; - postCount = 0; fileCount = 0; _ref = this.posts; @@ -7037,7 +6787,6 @@ }, onUpdate: function(e) { var fileCount, postCount, _ref; - if (e.detail[404]) { return; } @@ -7046,7 +6795,6 @@ }, update: function(postCount, fileCount) { var fileCountEl, postCountEl, thread; - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; postCountEl.textContent = postCount; fileCountEl.textContent = fileCount; @@ -7073,7 +6821,6 @@ }, onThreadsLoad: function() { var page, pages, thread, _i, _j, _len, _len1, _ref; - if (!Conf["Page Count in Stats"]) { return; } @@ -7101,7 +6848,6 @@ init: function() { var checked, conf, el, input, name, sc, settings, subEntries, _ref, _this = this; - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { return; } @@ -7252,7 +6998,6 @@ }, interval: function() { var val; - val = +this.value; if (val < 1) { val = 1; @@ -7262,7 +7007,6 @@ }, load: function() { var klass, req, text, _ref; - req = ThreadUpdater.req; switch (req.status) { case 200: @@ -7306,7 +7050,6 @@ }, getInterval: function() { var i, j; - i = ThreadUpdater.interval; j = Math.min(ThreadUpdater.outdateCount, 10); if (!d.hidden) { @@ -7316,14 +7059,12 @@ }, intervalShortcut: function() { var settings; - Settings.open('Advanced'); settings = $.id('fourchanx-settings'); return $('input[name=Interval]', settings).focus(); }, set: function(name, text, klass) { var el, node; - el = ThreadUpdater[name]; if (node = el.firstChild) { node.data = text; @@ -7336,7 +7077,6 @@ }, timeout: function() { var n; - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); if (!(n = --ThreadUpdater.seconds)) { return ThreadUpdater.update(); @@ -7349,7 +7089,6 @@ }, update: function() { var url; - if (!ThreadUpdater.online) { return; } @@ -7374,7 +7113,6 @@ }, updateThreadStatus: function(title, OP) { var icon, message, root, titleLC; - titleLC = title.toLowerCase(); if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { return; @@ -7401,7 +7139,6 @@ }, parse: function(postObjects) { var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, root, scroll, _i, _len, _ref; - OP = postObjects[0]; Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; ThreadUpdater.updateThreadStatus('Sticky', OP); @@ -7487,7 +7224,6 @@ } $.queueTask(function() { var length, threadID; - threadID = ThreadUpdater.thread.ID; length = $$('.thread > .postContainer', ThreadUpdater.root).length; return Fourchan.parseThread(threadID, length - count, length); @@ -7508,7 +7244,6 @@ ThreadWatcher = { init: function() { var sc; - if (!Conf['Thread Watcher']) { return; } @@ -7542,7 +7277,6 @@ node: function() { var favicon, _this = this; - favicon = $.el('a', { className: 'watch-thread-link', href: 'javascript:;' @@ -7562,7 +7296,6 @@ }, refresh: function(watched) { var ID, board, div, favicon, id, link, nodes, props, thread, x, _ref, _ref1; - if (!watched) { $.get('WatchedThreads', {}, function(item) { return ThreadWatcher.refresh(item['WatchedThreads']); @@ -7611,13 +7344,11 @@ }, x: function() { var thread; - thread = this.nextElementSibling.pathname.split('/'); return ThreadWatcher.unwatch(thread[1], thread[3]); }, post: function(e) { var board, postID, threadID, _ref; - _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; if (postID === threadID) { if (Conf['Auto Watch']) { @@ -7638,7 +7369,6 @@ unwatch: function(board, threadID) { return $.get('WatchedThreads', {}, function(item) { var watched; - watched = item['WatchedThreads']; delete watched[board][threadID]; if (!Object.keys(watched[board]).length) { @@ -7651,7 +7381,6 @@ watch: function(thread) { return $.get('WatchedThreads', {}, function(item) { var watched, _name; - watched = item['WatchedThreads']; watched[_name = thread.board] || (watched[_name] = {}); watched[thread.board][thread] = { @@ -7697,7 +7426,6 @@ }, ready: function() { var ID, post, posts, _ref; - $.off(d, '4chanXInitFinished', Unread.ready); posts = []; _ref = Unread.thread.posts; @@ -7714,7 +7442,6 @@ }, scroll: function() { var checkPosition, hash, onload, post, posts, prevID, root; - if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { return; } @@ -7746,7 +7473,6 @@ } checkPosition = function(target) { var height, top, _ref; - _ref = target.getBoundingClientRect(), top = _ref.top, height = _ref.height; return top + height - doc.clientHeight > 0; }; @@ -7754,7 +7480,6 @@ }, sync: function() { var lastReadPost; - lastReadPost = Unread.db.get({ boardID: Unread.thread.board.ID, threadID: Unread.thread.ID, @@ -7771,7 +7496,6 @@ }, addPosts: function(posts) { var ID, data, post, _i, _len, _ref; - for (_i = 0, _len = posts.length; _i < _len; _i++) { post = posts[_i]; ID = post.ID; @@ -7799,7 +7523,6 @@ }, addPostQuotingYou: function(post) { var quotelink, _i, _len, _ref; - if (!QR.db) { return; } @@ -7820,7 +7543,6 @@ }, readSinglePost: function(post) { var i; - if ((i = Unread.posts.indexOf(post)) === -1) { return; } @@ -7836,7 +7558,6 @@ }, readArray: function(arr) { var i, post, _i, _len; - for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { post = arr[i]; if (post.ID > Unread.lastReadPost) { @@ -7847,7 +7568,6 @@ }, read: $.debounce(50, function(e) { var ID, bottom, height, i, post, posts, read; - if (d.hidden || !Unread.posts.length) { return; } @@ -7881,7 +7601,6 @@ }), setLine: function(force) { var post, root; - if (!(d.hidden || force === true)) { return; } @@ -7896,7 +7615,6 @@ }, update: function() { var count; - count = Unread.posts.length; if (Conf['Unread Count']) { d.title = "" + (Conf['Quoted Title'] && Unread.postsQuotingYou.length ? '(!) ' : '') + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); @@ -7915,7 +7633,6 @@ file: {}, init: function() { var archive, arr, boardID, data, id, name, type, _i, _len, _ref, _ref1, _ref2, _ref3; - _ref = Conf['selectedArchives']; for (boardID in _ref) { data = _ref[boardID]; @@ -7958,7 +7675,7 @@ 'http': false, 'https': true, 'software': 'foolfuuka', - 'boards': ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vg', 'vp', 'vr', 'wsg'], + 'boards': ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg'], 'files': ['a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg'] }, 'NSFW Foolz': { @@ -8000,6 +7717,14 @@ 'boards': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv'], 'files': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv'] }, + 'World Athletic Project': { + 'domain': 'fuuka.worldathleticproject.org', + 'http': true, + 'https': false, + 'software': 'foolfuuka', + 'boards': ['e', 'h', 'p', 's', 'u'], + 'files': ['e', 'h', 'p', 's', 'u'] + }, 'Install Gentoo': { 'domain': 'archive.installgentoo.net', 'http': false, @@ -8026,7 +7751,6 @@ }, to: function(dest, data) { var archive; - archive = (dest === 'search' ? Redirect.thread : Redirect[dest])[data.boardID]; if (!archive) { return ''; @@ -8035,7 +7759,6 @@ }, protocol: function(archive) { var protocol; - protocol = location.protocol; if (!archive[protocol.slice(0, -1)]) { protocol = protocol === 'https:' ? 'http:' : 'https:'; @@ -8044,7 +7767,6 @@ }, thread: function(archive, _arg) { var boardID, path, postID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID; path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; if (archive.software === 'foolfuuka') { @@ -8057,7 +7779,6 @@ }, post: function(archive, _arg) { var boardID, postID, protocol; - boardID = _arg.boardID, postID = _arg.postID; protocol = Redirect.protocol(archive); if (['Foolz', 'NSFW Foolz'].contains(archive.name)) { @@ -8067,13 +7788,11 @@ }, file: function(archive, _arg) { var boardID, filename; - boardID = _arg.boardID, filename = _arg.filename; return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename; }, search: function(archive, _arg) { var boardID, path, type, value; - boardID = _arg.boardID, type = _arg.type, value = _arg.value; type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; value = encodeURIComponent(value); @@ -8092,7 +7811,6 @@ }, setup: function() { var btn, entry, psa; - $.off(d, '4chanXInitFinished', PSAHiding.setup); if (!(psa = $.id('globalMessage'))) { $.rmClass(doc, 'hide-announcement'); @@ -8121,7 +7839,6 @@ $.on(btn, 'click', PSAHiding.toggle); $.get('hiddenPSA', 0, function(_arg) { var hiddenPSA; - hiddenPSA = _arg.hiddenPSA; PSAHiding.sync(hiddenPSA); $.before(psa, btn); @@ -8131,7 +7848,6 @@ }, toggle: function(e) { var UTC; - if ($.hasClass(this, 'hide-announcement')) { UTC = +$.id('globalMessage').dataset.utc; $.set('hiddenPSA', UTC); @@ -8143,7 +7859,6 @@ }, sync: function(UTC) { var hr, psa; - psa = $.id('globalMessage'); psa.hidden = PSAHiding.btn.hidden = UTC && UTC >= +psa.dataset.utc ? true : false; if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') { @@ -8155,7 +7870,6 @@ CatalogLinks = { init: function() { var el, input; - if (!Conf['Catalog Links']) { return; } @@ -8179,14 +7893,12 @@ }, toggle: function() { var useCatalog; - $.event('CloseMenu'); $.set('Header catalog links', useCatalog = this.checked); return CatalogLinks.set(useCatalog); }, set: function(useCatalog) { var a, board, path, _i, _len, _ref; - path = useCatalog ? 'catalog' : ''; _ref = $$("#board-list a[href*=\"boards.4chan.org\"]:not(.catalog),\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -8220,7 +7932,6 @@ }, node: function(post) { var str, uid; - if (!(uid = $('.hand', this.nodes.uniqueID))) { return; } @@ -8232,7 +7943,6 @@ ids: {}, compute: function(str) { var hash, rgb; - hash = this.hash(str); rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF]; rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125; @@ -8241,13 +7951,11 @@ }, apply: function() { var rgb; - rgb = IDColor.ids[this] || IDColor.compute(this); return ("background-color: rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "); color: ") + (rgb[3] ? "black; border-radius: 3px; padding: 0px 2px;" : "white; border-radius: 3px; padding: 0px 2px;"); }, hash: function(str) { var i, j, msg; - msg = 0; i = 0; j = str.length; @@ -8286,7 +7994,6 @@ Emoji = { init: function() { var css, icon, name, pos, _ref; - if (!Conf['Emoji']) { return; } @@ -8356,7 +8063,6 @@ }, node: function() { var a; - if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) { return $.on(a, 'click', ExpandComment.cb); } @@ -8364,14 +8070,12 @@ callbacks: [], cb: function(e) { var post; - e.preventDefault(); post = Get.postFromNode(this); return ExpandComment.expand(post); }, expand: function(post) { var a; - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { $.replace(post.nodes.shortComment, post.nodes.longComment); post.nodes.comment = post.nodes.longComment; @@ -8387,7 +8091,6 @@ }, contract: function(post) { var a; - if (!post.nodes.shortComment) { return; } @@ -8398,7 +8101,6 @@ }, parse: function(req, a, post) { var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - status = req.status; if (![200, 304].contains(status)) { a.textContent = "Error " + req.statusText + " (" + status + ")"; @@ -8455,7 +8157,6 @@ }, node: function() { var a, span; - if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { return; } @@ -8469,13 +8170,11 @@ }, cbToggle: function() { var op; - op = Get.postFromRoot(this.previousElementSibling); return ExpandThread.toggle(op.thread); }, toggle: function(thread) { var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - threadRoot = thread.OP.nodes.root.parentNode; a = $('.summary', threadRoot); switch (thread.isExpanded) { @@ -8544,7 +8243,6 @@ }, parse: function(req, thread, a) { var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; - if (a.textContent[0] === '+') { return; } @@ -8602,7 +8300,6 @@ }, createFunc: function(format) { var code; - code = format.replace(/%(.)/g, function(s, c) { if (c in FileInfo.formatters) { return "' + FileInfo.formatters." + c + ".call(post) + '"; @@ -8614,7 +8311,6 @@ }, convertUnit: function(size, unit) { var i; - if (unit === 'B') { return "" + (size.toFixed()) + " Bytes"; } @@ -8645,7 +8341,6 @@ }, n: function() { var fullname, shortname; - fullname = this.file.name; shortname = Build.shortFilename(this.file.name, this.isReply); if (fullname === shortname) { @@ -8689,7 +8384,6 @@ Fourchan = { init: function() { var board; - if (g.VIEW === 'catalog') { return; } @@ -8711,7 +8405,6 @@ }, code: function() { var pre, _i, _len, _ref; - if (this.isClone) { return; } @@ -8741,13 +8434,11 @@ Keybinds = { init: function() { var init; - if (g.VIEW === 'catalog' || !Conf['Keybinds']) { return; } init = function() { var node, _i, _len, _ref; - $.off(d, '4chanXInitFinished', init); $.on(d, 'keydown', Keybinds.keydown); _ref = $$('[accesskey]'); @@ -8760,7 +8451,6 @@ }, keydown: function(e) { var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; - if (!(key = Keybinds.keyCode(e))) { return; } @@ -8935,7 +8625,6 @@ }, keyCode: function(e) { var kc, key; - key = (function() { switch (kc = e.keyCode) { case 8: @@ -8991,7 +8680,6 @@ }, tags: function(tag, ta) { var range, selEnd, selStart, value; - value = ta.value; selStart = ta.selectionStart; selEnd = ta.selectionEnd; @@ -9002,13 +8690,11 @@ }, sage: function() { var isSage; - isSage = /sage/i.test(QR.nodes.email.value); return QR.nodes.email.value = isSage ? "" : "sage"; }, img: function(thread, all) { var post; - if (all) { return ImageExpand.cb.toggleAll(); } else { @@ -9018,7 +8704,6 @@ }, open: function(thread, tab) { var url; - if (g.VIEW !== 'index') { return; } @@ -9031,7 +8716,6 @@ }, hl: function(delta, thread) { var axe, headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; - if (!delta) { if (postEl = $('.reply.highlight', thread)) { $.rmClass(postEl, 'highlight'); @@ -9091,7 +8775,6 @@ Nav = { init: function() { var append, next, prev, span; - switch (g.VIEW) { case 'index': if (!Conf['Index Navigation']) { @@ -9142,7 +8825,6 @@ }, getThread: function(full) { var headRect, i, rect, thread, threads, topMargin, _i, _len; - if (Conf['Bottom header'] || !Conf['Fixed Header']) { topMargin = 0; } else { @@ -9168,7 +8850,6 @@ }, scroll: function(delta) { var i, rect, thread, threads, top, topMargin, _ref, _ref1; - _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; top = rect.top - topMargin; if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) { @@ -9194,7 +8875,6 @@ }, node: function() { var dateEl; - if (this.isClone) { return; } @@ -9204,7 +8884,6 @@ }, relative: function(diff, now, date) { var days, months, number, rounded, unit, years; - unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); rounded = Math.round(number); if (rounded !== 1) { @@ -9215,7 +8894,6 @@ stale: [], flush: function() { var now, update, _i, _len, _ref; - if (d.hidden) { return; } @@ -9231,16 +8909,13 @@ }, setUpdate: function(post) { var markStale, setOwnTimeout, update; - setOwnTimeout = function(diff) { var delay; - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; return setTimeout(markStale, delay); }; update = function(now) { var date, diff, relative, singlePost, _i, _len, _ref; - date = post.info.date; diff = now - date; relative = RelativeDates.relative(diff, now, date); @@ -9281,7 +8956,6 @@ }, node: function(post) { var spoiler, spoilers, _i, _len; - spoilers = $$('s', this.nodes.comment); for (_i = 0, _len = spoilers.length; _i < _len; _i++) { spoiler = spoilers[_i]; @@ -9301,7 +8975,6 @@ }, ready: function() { var field; - field = $.id('recaptcha_response_field'); $.on(field, 'keydown', function(e) { if (e.keyCode === 8 && !field.value) { @@ -9310,7 +8983,6 @@ }); return $.on($('form'), 'submit', function(e) { var response; - e.preventDefault(); response = field.value.trim(); if (!/\s/.test(response)) { @@ -9324,7 +8996,6 @@ Sauce = { init: function() { var err, link, links, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Sauce']) { return; } @@ -9356,7 +9027,6 @@ }, createSauceLink: function(link) { var m, text; - link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { switch (parameter) { case '%TURL': @@ -9377,7 +9047,6 @@ }, node: function() { var link, nodes, _i, _len, _ref; - if (this.isClone || !this.file) { return; } @@ -9410,7 +9079,6 @@ }, createFunc: function(format) { var code; - code = format.replace(/%([A-Za-z])/g, function(s, c) { if (c in Time.formatters) { return "' + Time.formatters." + c + ".call(date) + '"; @@ -9495,7 +9163,6 @@ Settings = { init: function() { var link, settings; - link = $.el('a', { className: 'settings-link', textContent: 'Settings', @@ -9505,7 +9172,6 @@ Header.addShortcut(link); $.get('previousversion', null, function(item) { var changelog, el, previous; - if (previous = item['previousversion']) { if (previous === g.VERSION) { return; @@ -9543,7 +9209,6 @@ }, open: function(openSection) { var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref; - $.off(d, '4chanXInitFinished', Settings.open); if (Settings.dialog) { return; @@ -9596,7 +9261,6 @@ sections: [], addSection: function(title, open) { var hyphenatedTitle, _ref; - if (typeof title !== 'string') { _ref = title.detail, title = _ref.title, open = _ref.open; } @@ -9609,7 +9273,6 @@ }, openSection: function() { var section, selected; - if (selected = $('.tab-selected', Settings.dialog)) { $.rmClass(selected, 'tab-selected'); } @@ -9623,7 +9286,6 @@ }, main: function(section) { var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref; - items = {}; inputs = {}; _ref = Config.main; @@ -9648,7 +9310,6 @@ } $.get(items, function(items) { var val; - for (key in items) { val = items[key]; inputs[key].checked = val; @@ -9663,7 +9324,6 @@ boards: {} }, function(item) { var ID, board, thread, _ref1; - _ref1 = item.hiddenThreads.boards; for (ID in _ref1) { board = _ref1[ID]; @@ -9678,7 +9338,6 @@ boards: {} }, function(item) { var ID, board, post, thread, _ref1; - _ref1 = item.hiddenPosts.boards; for (ID in _ref1) { board = _ref1[ID]; @@ -9698,7 +9357,6 @@ boards: {} }, function(item) { var boardID; - for (boardID in item.hiddenThreads.boards) { localStorage.removeItem("4chan-hide-t-" + boardID); } @@ -9709,7 +9367,6 @@ }, "export": function(now, data) { var a, db, _i, _len; - if (typeof now !== 'number') { now = Date.now(); data = { @@ -9744,7 +9401,6 @@ }, onImport: function() { var file, output, reader; - if (!(file = this.files[0])) { return; } @@ -9756,7 +9412,6 @@ reader = new FileReader(); reader.onload = function(e) { var data, err; - try { data = JSON.parse(e.target.result); Settings.loadSettings(data); @@ -9773,7 +9428,6 @@ }, loadSettings: function(data) { var key, val, version, _ref; - version = data.version.split('.'); if (version[0] === '2') { data = Settings.convertSettings(data, { @@ -9863,7 +9517,6 @@ }, convertSettings: function(data, map) { var newKey, prevKey; - for (prevKey in map) { newKey = map[prevKey]; if (newKey) { @@ -9875,7 +9528,6 @@ }, filter: function(section) { var select; - section.innerHTML = "
"; select = $('select', section); $.on(select, 'change', Settings.selectFilter); @@ -9883,7 +9535,6 @@ }, selectFilter: function() { var div, name, ta; - div = this.nextElementSibling; if ((name = this.value) !== 'guide') { $.rmAll(div); @@ -9903,7 +9554,6 @@ }, sauce: function(section) { var ta; - section.innerHTML = "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
    These parameters will be replaced by their corresponding values:\n
  • %TURL: Thumbnail URL.
  • %URL: Full image URL.
  • %MD5: MD5 hash.
  • %board: Current board.
"; ta = $('textarea', section); $.get('sauces', Conf['sauces'], function(item) { @@ -9913,7 +9563,6 @@ }, advanced: function(section) { var archive, boardID, boardOptions, boardSelect, boards, data, event, input, inputs, item, items, name, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4; - section.innerHTML = "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Disabled selections indicate that only one archive is available for that board and redirection type.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
Board link: g
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:\"Install Gentoo\"
Index-only link: g-index
Catalog-only link: g-catalog
External link: external-text:\"Google\",\"http://www.google.com\"
Combinations are possible: g-index-text:\"Technology Index\"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
Time Formatting is disabled.
:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Quick Reply Personas is disabled.

\n One item per line.
\n Items will be added in the relevant input's auto-completion list.
\n Password items will always be used, since there is no password input.
\n Lines starting with a # will be ignored.\n

    You can use these settings with each item, separate them with semicolons:\n
  • Possible items are: name, email, subject and password.
  • Wrap values of items with quotes, like this: email:\"sage\".
  • Force values as defaults with the always keyword, for example: email:\"sage\";always.
  • Select specific boards for an item, separated with commas, for example: email:\"sage\";boards:jp;always.
Unread Favicon is disabled.
Emoji is disabled.
\n Sage Icon:
\n Position:
Thread Updater is disabled.
\n Interval:
"; items = {}; inputs = {}; @@ -9933,7 +9582,6 @@ $.on(ta, 'change', $.cb.value); $.get(items, function(items) { var key, val; - for (key in items) { val = items[key]; if (['emojiPos'].contains(key)) { @@ -10004,7 +9652,6 @@ }); $.get('selectedArchives', Conf['selectedArchives'], function(_arg) { var option, selectedArchives, type; - selectedArchives = _arg.selectedArchives; for (boardID in selectedArchives) { data = selectedArchives[boardID]; @@ -10019,7 +9666,6 @@ }, addArchiveCell: function(boardID, data, type) { var archive, i, length, options, select, td; - length = data[type].length; td = $.el('td', { className: 'archive-cell' @@ -10049,10 +9695,8 @@ }, saveSelectedArchive: function() { var _this = this; - return $.get('selectedArchives', Conf['selectedArchives'], function(_arg) { var selectedArchives, _name; - selectedArchives = _arg.selectedArchives; (selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value; return $.set('selectedArchives', selectedArchives); @@ -10063,7 +9707,6 @@ }, time: function() { var funk; - funk = Time.createFunc(this.value); return this.nextElementSibling.textContent = funk(Time, new Date()); }, @@ -10072,7 +9715,6 @@ }, fileInfo: function() { var data, funk; - data = { isReply: true, file: { @@ -10111,7 +9753,6 @@ }, keybinds: function(section) { var arr, input, inputs, items, key, tbody, tr, _ref; - section.innerHTML = "
Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
ActionsKeybinds
"; tbody = $('tbody', section); items = {}; @@ -10132,7 +9773,6 @@ } return $.get(items, function(items) { var val; - for (key in items) { val = items[key]; inputs[key].value = val; @@ -10141,7 +9781,6 @@ }, keybind: function(e) { var key; - if (e.keyCode === 9) { return; } @@ -10158,10 +9797,8 @@ Main = { init: function(items) { var db, flatten, _i, _len; - flatten = function(parent, obj) { var key, val; - if (obj instanceof Array) { Conf[parent] = obj[0]; } else if (typeof obj === 'object') { @@ -10185,13 +9822,11 @@ $.on(d, '4chanMainInit', Main.initStyle); return $.asap((function() { var _ref; - return d.head && $('link[rel="shortcut icon"]', d.head) || ((_ref = d.readyState) === 'interactive' || _ref === 'complete'); }), Main.initStyle); }, initFeatures: function(items) { var init, pathname, _ref; - Conf = items; pathname = location.pathname.split('/'); g.BOARD = new Board(pathname[1]); @@ -10220,7 +9855,6 @@ case 'images.4chan.org': $.ready(function() { var URL; - if (Conf['404 Redirect'] && d.title === '4chan - 404 Not Found') { Redirect.init(); pathname = location.pathname.split('/'); @@ -10237,7 +9871,6 @@ } init = function(features) { var err, module, name; - for (name in features) { module = features[name]; try { @@ -10313,7 +9946,6 @@ }, initStyle: function() { var mainStyleSheet, observer, setStyle, style, styleSheets, _ref; - $.off(d, '4chanMainInit', Main.initStyle); if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) { return; @@ -10334,7 +9966,6 @@ styleSheets = $$('link[rel="alternate stylesheet"]', d.head); setStyle = function() { var styleSheet, _i, _len; - $.rmClass(doc, style); for (_i = 0, _len = styleSheets.length; _i < _len; _i++) { styleSheet = styleSheets[_i]; @@ -10361,7 +9992,6 @@ }, initReady: function() { var board, boardChild, err, errors, href, passLink, posts, styleSelector, thread, threadChild, threads, _i, _j, _len, _len1, _ref, _ref1; - if (d.title === '4chan - 404 Not Found') { if (Conf['404 Redirect'] && g.VIEW === 'thread') { href = Redirect.to('thread', { @@ -10438,7 +10068,6 @@ }, callbackNodes: function(klass, nodes) { var callback, err, errors, i, len, node, _i, _len, _ref; - len = nodes.length; _ref = klass.prototype.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -10466,11 +10095,9 @@ }, callbackNodesDB: function(klass, nodes, cb) { var errors, func, i, len, node, queue, softTask; - queue = []; softTask = function() { var args, func, task; - task = queue.shift(); func = task[0]; args = Array.prototype.slice.call(task, 1); @@ -10489,7 +10116,6 @@ errors = null; func = function(node, i) { var callback, err, _i, _len, _ref; - _ref = klass.prototype.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { callback = _ref[_i]; @@ -10523,7 +10149,6 @@ }, addCallback: function(e) { var Klass, obj; - obj = e.detail; if (typeof obj.callback.name !== 'string') { throw new Error("Invalid callback name: " + obj.callback.name); @@ -10543,7 +10168,6 @@ }, message: function(e) { var el, version; - version = e.data.version; if (version && version !== g.VERSION) { el = $.el('span', { @@ -10554,14 +10178,12 @@ }, checkUpdate: function() { var now; - if (!(Conf['Check for Updates'] && Main.isThisPageLegit())) { return; } now = Date.now(); return $.get('lastchecked', 0, function(_arg) { var lastchecked; - lastchecked = _arg.lastchecked; if (lastchecked > now - $.DAY) { return; @@ -10577,7 +10199,6 @@ }, handleErrors: function(errors) { var div, error, logs, _i, _len; - if (!(errors instanceof Array)) { error = errors; } else if (errors.length === 1) { @@ -10592,7 +10213,6 @@ }); $.on(div.lastElementChild, 'click', function() { var _ref; - return _ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = _ref[0], logs.hidden = _ref[1], _ref; }); logs = $.el('div', { @@ -10606,7 +10226,6 @@ }, parseError: function(data) { var error, message; - Main.logError(data); message = $.el('div', { textContent: data.message @@ -10623,7 +10242,6 @@ }, isThisPageLegit: function() { var _ref; - if (!('thisPageIsLegit' in Main)) { Main.thisPageIsLegit = location.hostname === 'boards.4chan.org' && !$('link[href*="favicon-status.ico"]', d.head) && ((_ref = d.title) !== '4chan - Temporarily Offline' && _ref !== '4chan - Error'); } diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index 81ea4487d..92e2699f5 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.2.21 +// @version 1.2.22 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 263d970bb..25c55b39d 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.2.21 +// @version 1.2.22 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.21 - 2013-07-22 +* 4chan X - Version 1.2.22 - 2013-07-23 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -320,7 +320,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.21', + VERSION: '1.2.22', NAMESPACE: '4chan X.', boards: {}, threads: {}, @@ -337,7 +337,6 @@ Array.prototype.add = function(object, position) { var keep; - keep = this.slice(position); this.length = position; this.push(object); @@ -350,7 +349,6 @@ Array.prototype.indexOf = function(object) { var i; - i = this.length; while (i--) { if (this[i] === object) { @@ -362,7 +360,6 @@ Array.prototype.pushArrays = function() { var arg, args, _i, _len; - args = arguments; for (_i = 0, _len = args.length; _i < _len; _i++) { arg = args[_i]; @@ -373,7 +370,6 @@ Array.prototype.remove = function(object) { var index; - if ((index = this.indexOf(object)) > -1) { return this.splice(index, 1); } else { @@ -390,7 +386,6 @@ $.extend = function(object, properties) { var key, val; - for (key in properties) { val = properties[key]; if (!properties.hasOwnProperty(key)) { @@ -408,7 +403,6 @@ $.ready = function(fc) { var cb, _ref; - if ((_ref = d.readyState) === 'interactive' || _ref === 'complete') { $.queueTask(fc); return; @@ -422,7 +416,6 @@ $.formData = function(form) { var fd, key, val; - if (form instanceof HTMLFormElement) { return new FormData(form); } @@ -443,7 +436,6 @@ $.ajax = function(url, callbacks, opts) { var cred, err, form, headers, key, r, sync, type, upCallbacks, val; - if (opts == null) { opts = {}; } @@ -469,11 +461,9 @@ $.cache = (function() { var reqs; - reqs = {}; return function(url, cb) { var err, req, rm; - if (req = reqs[url]) { if (req.readyState === 4) { cb.call(req, req.evt); @@ -489,7 +479,6 @@ req = $.ajax(url, { onload: function(e) { var _i, _len, _ref; - _ref = this.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { cb = _ref[_i]; @@ -531,7 +520,6 @@ $.addStyle = function(css, id) { var style; - style = $.el('style', { id: id, textContent: css @@ -578,7 +566,6 @@ } else { return function(el) { var _ref; - return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; }; } @@ -586,7 +573,6 @@ $.rmAll = function(root) { var node; - while (node = root.firstChild) { root.removeChild(node); } @@ -602,7 +588,6 @@ $.nodes = function(nodes) { var frag, node, _i, _len; - if (!(nodes instanceof Array)) { return nodes; } @@ -636,7 +621,6 @@ $.el = function(tag, properties) { var el; - el = d.createElement(tag); if (properties) { $.extend(el, properties); @@ -646,7 +630,6 @@ $.on = function(el, events, handler) { var event, _i, _len, _ref; - _ref = events.split(' '); for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; @@ -656,7 +639,6 @@ $.off = function(el, events, handler) { var event, _i, _len, _ref; - _ref = events.split(' '); for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; @@ -682,7 +664,6 @@ $.debounce = function(wait, fn) { var args, exec, lastCall, that, timeout; - lastCall = 0; timeout = null; that = null; @@ -704,11 +685,9 @@ $.queueTask = (function() { var execTask, taskChannel, taskQueue; - taskQueue = []; execTask = function() { var args, func, task; - task = taskQueue.shift(); func = task[0]; args = Array.prototype.slice.call(task, 1); @@ -731,7 +710,6 @@ $.globalEval = function(code) { var script; - script = $.el('script', { textContent: code }); @@ -741,7 +719,6 @@ $.bytesToString = function(size) { var unit; - unit = 0; while (size >= 1024) { size /= 1024; @@ -760,7 +737,6 @@ $.sync = (function() { window.addEventListener('storage', function(e) { var cb; - if (cb = $.syncing[e.key]) { return cb(JSON.parse(e.newValue)); } @@ -772,7 +748,6 @@ $.item = function(key, val) { var item; - item = {}; item[key] = val; return item; @@ -780,7 +755,6 @@ $["delete"] = function(keys) { var key, _i, _len; - if (!(keys instanceof Array)) { keys = [keys]; } @@ -794,7 +768,6 @@ $.get = function(key, val, cb) { var items; - if (typeof cb === 'function') { items = $.item(key, val); } else { @@ -813,7 +786,6 @@ $.set = (function() { var set; - set = function(key, val) { key = g.NAMESPACE + key; val = JSON.stringify(val); @@ -824,7 +796,6 @@ }; return function(keys, val) { var key; - if (typeof keys === 'string') { set(keys, val); return; @@ -892,7 +863,6 @@ function Post(root, thread, board, that) { var alt, anchor, capcode, date, email, file, fileInfo, flag, info, name, post, size, subject, thumb, tripcode, uniqueID, unit; - this.thread = thread; this.board = board; if (that == null) { @@ -991,7 +961,6 @@ Post.prototype.parseComment = function() { var bq, data, i, node, nodes, text, _i, _len, _ref; - bq = this.nodes.comment.cloneNode(true); _ref = $$('.abbr, .capcodeReplies, .exif, b', bq); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1009,7 +978,6 @@ Post.prototype.parseQuotes = function() { var hash, pathname, quotelink, quotes, _i, _len, _ref; - quotes = {}; _ref = $$('.quotelink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1039,7 +1007,6 @@ Post.prototype.kill = function(file, now) { var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1; - now || (now = new Date()); if (file) { if (this.file.isDead) { @@ -1088,7 +1055,6 @@ Post.prototype.resurrect = function() { var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1; - delete this.isDead; delete this.timeOfDeath; $.rmClass(this.nodes.root, 'deleted-post'); @@ -1122,7 +1088,6 @@ Post.prototype.rmClone = function(index) { var clone, _i, _len, _ref; - this.clones.splice(index, 1); _ref = this.clones.slice(index); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1140,7 +1105,6 @@ function Clone(origin, context) { var file, index, info, inline, inlined, key, nodes, post, root, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; - this.origin = origin; this.context = context; _ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']; @@ -1229,7 +1193,6 @@ function DataBoard(key, sync) { var init, _this = this; - this.key = key; this.data = Conf[key]; $.sync(key, this.onSync.bind(this)); @@ -1246,7 +1209,6 @@ DataBoard.prototype["delete"] = function(_arg) { var boardID, postID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID; if (postID) { delete this.data.boards[boardID][threadID][postID]; @@ -1267,7 +1229,6 @@ DataBoard.prototype.deleteIfEmpty = function(_arg) { var boardID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID; if (threadID) { if (!Object.keys(this.data.boards[boardID][threadID]).length) { @@ -1283,7 +1244,6 @@ DataBoard.prototype.set = function(_arg) { var boardID, postID, threadID, val, _base, _base1, _base2; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val; if (postID !== void 0) { ((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val; @@ -1297,7 +1257,6 @@ DataBoard.prototype.get = function(_arg) { var ID, board, boardID, defaultValue, postID, thread, threadID, val, _i, _len; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, defaultValue = _arg.defaultValue; if (board = this.data.boards[boardID]) { if (!threadID) { @@ -1321,7 +1280,6 @@ DataBoard.prototype.clean = function() { var boardID, now, val, _ref; - _ref = this.data.boards; for (boardID in _ref) { val = _ref[boardID]; @@ -1341,10 +1299,8 @@ DataBoard.prototype.ajaxClean = function(boardID) { var _this = this; - return $.cache("//api.4chan.org/" + boardID + "/threads.json", function(e) { var board, page, thread, threads, _i, _j, _len, _len1, _ref, _ref1; - if (e.target.status === 404) { _this["delete"](boardID); } else if (e.target.status === 200) { @@ -1455,7 +1411,6 @@ init: function() { var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, _this = this; - this.menu = new UI.Menu('header'); this.menuButton = $.el('span', { className: 'menu-button', @@ -1539,7 +1494,6 @@ } $.asap((function() { var _ref; - return $.id('boardNavMobile') || ((_ref = d.readyState) === 'interactive' || _ref === 'complete'); }), Header.setBoardList); $.prepend(d.body, _this.bar); @@ -1548,7 +1502,6 @@ }); return $.ready(function() { var a, cs; - _this.footer = $.id('boardNavDesktopFoot'); if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { a.className = 'current'; @@ -1582,7 +1535,6 @@ }), setBoardList: function() { var a, boardList, btn, fourchannav, fullBoardList; - fourchannav = $.id('boardNavDesktop'); if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) { a.className = 'current'; @@ -1604,7 +1556,6 @@ }, generateBoardList: function(text) { var as, list, nodes; - list = $('#custom-board-list', Header.bar); $.rmAll(list); if (!text) { @@ -1613,7 +1564,6 @@ as = $$('#full-board-list a', Header.bar); nodes = text.match(/[\w@]+((-(all|title|replace|full|index|catalog|url:"[^"]+[^"]"|text:"[^"]+")|\,"[^"]+[^"]"))*|[^\w@]+/g).map(function(t) { var a, board, m, _i, _len; - if (/^[^\w@]/.test(t)) { return $.tn(t); } @@ -1660,7 +1610,6 @@ }, toggleBoardList: function() { var bar, custom, full, showBoardList; - bar = Header.bar; custom = $('#custom-board-list', bar); full = $('#full-board-list', bar); @@ -1696,7 +1645,6 @@ }, toggleLinkJustify: function() { var centered; - $.event('CloseMenu'); centered = this.nodeName === 'INPUT' ? this.checked : void 0; Header.setLinkJustify(centered); @@ -1726,7 +1674,6 @@ }, toggleBarVisibility: function(e) { var hide, message; - if (e.type === 'mousedown' && e.button !== 0) { return; } @@ -1743,7 +1690,6 @@ }, toggleFooterVisibility: function() { var hide, message; - $.event('CloseMenu'); hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden; Header.setFooterVisibility(hide); @@ -1753,7 +1699,6 @@ }, setCustomNav: function(show) { var btn, cust, full, _ref; - Header.customNavToggler.checked = show; cust = $('#custom-board-list', Header.bar); full = $('#full-board-list', Header.bar); @@ -1766,14 +1711,12 @@ }, editCustomNav: function() { var settings; - Settings.open('Advanced'); settings = $.id('fourchanx-settings'); return $('input[name=boardnav]', settings).focus(); }, hashScroll: function() { var hash, post; - if (!((hash = this.location.hash.slice(1)) && (post = $.id(hash)))) { return; } @@ -1784,7 +1727,6 @@ }, scrollToPost: function(post) { var headRect, top; - top = post.getBoundingClientRect().top; if (Conf['Fixed Header'] && !Conf['Bottom Header']) { headRect = Header.bar.getBoundingClientRect(); @@ -1794,7 +1736,6 @@ }, addShortcut: function(el) { var shortcut; - shortcut = $.el('span', { className: 'shortcut fourchanx-link' }); @@ -1806,7 +1747,6 @@ }, createNotification: function(e) { var cb, content, lifetime, notif, type, _ref; - _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; notif = new Notification(type, content, lifetime); if (cb) { @@ -1819,7 +1759,6 @@ spoilerRange: {}, shortFilename: function(filename, isReply) { var threshold; - threshold = isReply ? 30 : 40; if (filename.length - 4 > threshold) { return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); @@ -1829,7 +1768,6 @@ }, postFromObject: function(data, boardID) { var o; - o = { postID: data.no, threadID: data.resto || data.no, @@ -1873,7 +1811,6 @@ */ var a, boardID, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; - postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file; isOP = postID === threadID; staticPath = '//static.4chan.org/image/'; @@ -1969,7 +1906,6 @@ Get = { threadExcerpt: function(thread) { var OP, excerpt, _ref; - OP = thread.OP; excerpt = ((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || Conf['Anonymize'] && 'Anonymous' || $('.nameBlock', OP.nodes.info).textContent.trim(); if (excerpt.length > 70) { @@ -1982,7 +1918,6 @@ }, postFromRoot: function(root) { var boardID, index, link, post, postID; - link = $('a[title="Highlight this post"]', root); boardID = link.pathname.split('/')[1]; postID = link.hash.slice(2); @@ -2002,7 +1937,6 @@ }, postDataFromLink: function(link) { var boardID, path, postID, threadID; - if (link.hostname === 'boards.4chan.org') { path = link.pathname.split('/'); boardID = path[1]; @@ -2021,7 +1955,6 @@ }, allQuotelinksLinkingTo: function(post) { var ID, quote, quotedPost, quotelinks, quoterPost, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; - quotelinks = []; _ref = g.posts; for (ID in _ref) { @@ -2050,14 +1983,12 @@ } return quotelinks.filter(function(quotelink) { var boardID, postID, _ref4; - _ref4 = Get.postDataFromLink(quotelink), boardID = _ref4.boardID, postID = _ref4.postID; return boardID === post.board.ID && postID === post.ID; }); }, postClone: function(boardID, threadID, postID, root, context) { var post, url; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2078,7 +2009,6 @@ }, insert: function(post, root, context) { var clone, nodes; - if (!root.parentNode) { return; } @@ -2092,7 +2022,6 @@ }, fetchedPost: function(req, boardID, threadID, postID, root, context) { var board, post, posts, status, thread, url, _i, _len; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2142,7 +2071,6 @@ }, archivedPost: function(req, boardID, postID, root, context) { var board, bq, comment, data, o, post, thread, threadID, _ref; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2236,10 +2164,8 @@ UI = (function() { var Menu, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove; - dialog = function(id, position, html) { var child, el, move, _i, _len, _ref; - el = $.el('div', { className: 'dialog', innerHTML: html, @@ -2279,7 +2205,6 @@ Menu.prototype.makeMenu = function() { var menu; - menu = $.el('div', { className: 'dialog', id: 'menu', @@ -2294,7 +2219,6 @@ Menu.prototype.toggle = function(e, button, data) { var previousButton; - e.preventDefault(); e.stopPropagation(); if (currentMenu) { @@ -2312,7 +2236,6 @@ Menu.prototype.open = function(button, data) { var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2; - menu = this.makeMenu(); currentMenu = menu; lastToggledButton = button; @@ -2351,7 +2274,6 @@ Menu.prototype.insertEntry = function(entry, parent, data) { var subEntry, submenu, _i, _len, _ref; - if (typeof entry.open === 'function') { if (!entry.open(data)) { return; @@ -2385,7 +2307,6 @@ Menu.prototype.findNextEntry = function(entry, direction) { var entries; - entries = __slice.call(entry.parentNode.children); entries.sort(function(first, second) { return +(first.style.order || first.style.webkitOrder) - +(second.style.order || second.style.webkitOrder); @@ -2395,7 +2316,6 @@ Menu.prototype.keybinds = function(e) { var entry, next, nextPrev, subEntry, submenu; - entry = $('.focused', currentMenu); while (subEntry = $('.focused', entry)) { entry = subEntry; @@ -2441,7 +2361,6 @@ Menu.prototype.focus = function(entry) { var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2; - while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) { $.rmClass(focused, 'focused'); } @@ -2469,7 +2388,6 @@ Menu.prototype.addEntry = function(e) { var entry; - entry = e.detail; if (entry.type !== this.type) { return; @@ -2480,7 +2398,6 @@ Menu.prototype.parseEntry = function(entry) { var el, style, subEntries, subEntry, _i, _len; - el = entry.el, subEntries = entry.subEntries; $.addClass(el, 'entry'); $.on(el, 'focus mouseover', (function(e) { @@ -2504,7 +2421,6 @@ })(); dragstart = function(e) { var el, isTouching, o, rect, screenHeight, screenWidth, _ref; - if (e.type === 'mousedown' && e.button !== 0) { return; } @@ -2543,7 +2459,6 @@ }; touchmove = function(e) { var touch, _i, _len, _ref; - _ref = e.changedTouches; for (_i = 0, _len = _ref.length; _i < _len; _i++) { touch = _ref[_i]; @@ -2555,7 +2470,6 @@ }; drag = function(e) { var bottom, clientX, clientY, left, right, style, top; - clientX = e.clientX, clientY = e.clientY; left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; @@ -2571,7 +2485,6 @@ }; touchend = function(e) { var touch, _i, _len, _ref; - _ref = e.changedTouches; for (_i = 0, _len = _ref.length; _i < _len; _i++) { touch = _ref[_i]; @@ -2593,7 +2506,6 @@ }; hoverstart = function(_arg) { var asapTest, cb, el, endEvents, latestEvent, o, root; - root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb; o = { root: root, @@ -2622,7 +2534,6 @@ }; hover = function(e) { var clientX, clientY, height, left, right, style, top, _ref; - this.latestEvent = e; height = this.el.offsetHeight; clientX = e.clientX, clientY = e.clientY; @@ -2665,7 +2576,6 @@ }, node: function() { var email, name, tripcode, _ref; - if (this.info.capcode || this.isClone) { return; } @@ -2692,7 +2602,6 @@ filters: {}, init: function() { var boards, err, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4; - if (g.VIEW === 'catalog' || !Conf['Filter']) { return; } @@ -2729,7 +2638,6 @@ op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'yes'; stub = (function() { var _ref3; - switch ((_ref3 = filter.match(/stub:(yes|no)/)) != null ? _ref3[1] : void 0) { case 'yes': return true; @@ -2760,7 +2668,6 @@ }, createFilter: function(regexp, op, stub, hl, top) { var settings, test; - test = typeof regexp === 'string' ? function(value) { return regexp === value; } : function(value) { @@ -2784,7 +2691,6 @@ }, node: function() { var filter, firstThread, key, result, thisThread, value, _i, _len, _ref; - if (this.isClone) { return; } @@ -2896,7 +2802,6 @@ menu: { init: function() { var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) { return; } @@ -2922,7 +2827,6 @@ }, createSubEntry: function(text, type) { var el; - el = $.el('a', { href: 'javascript:;', textContent: text @@ -2933,7 +2837,6 @@ el: el, open: function(post) { var value; - value = Filter[type](post); return value !== false; } @@ -2941,7 +2844,6 @@ }, makeFilter: function() { var re, type, value; - type = this.dataset.type; value = Filter[type](Filter.menu.post); re = ['uniqueID', 'MD5'].contains(type) ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) { @@ -2956,7 +2858,6 @@ re = ['uniqueID', 'MD5'].contains(type) ? "/" + re + "/" : "/^" + re + "$/"; return $.get(type, Conf[type], function(item) { var save, section, select, ta, tl; - save = item[type]; save = save ? "" + save + "\n" + re : re; $.set(type, save); @@ -2990,7 +2891,6 @@ }, node: function() { var data; - if (!this.isReply || this.isClone) { return; } @@ -3014,7 +2914,6 @@ menu: { init: function() { var apply, div, hideStubLink, makeStub, replies, thisPost; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; } @@ -3085,7 +2984,6 @@ order: 20, open: function(post) { var data; - if (!post.isReply || post.isClone || !post.isHidden) { return false; } @@ -3117,7 +3015,6 @@ order: 15, open: function(post) { var data; - if (!post.isReply || post.isClone || !post.isHidden) { return false; } @@ -3134,7 +3031,6 @@ }, hide: function() { var makeStub, parent, post, replies, thisPost; - parent = this.parentNode; thisPost = $('input[name=thisPost]', parent).checked; replies = $('input[name=replies]', parent).checked; @@ -3153,7 +3049,6 @@ }, show: function() { var data, parent, post, replies, thisPost; - parent = this.parentNode; thisPost = $('input[name=thisPost]', parent).checked; replies = $('input[name=replies]', parent).checked; @@ -3177,7 +3072,6 @@ }, hideStub: function() { var post; - post = PostHiding.menu.post; post.nodes.root.hidden = true; $.event('CloseMenu'); @@ -3185,7 +3079,6 @@ }, makeButton: function(post, type) { var a; - a = $.el('a', { className: "" + type + "-reply-button", innerHTML: " " + (type === 'hide' ? '-' : '+') + " ", @@ -3196,7 +3089,6 @@ }, saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) { var data; - data = { boardID: post.board.ID, threadID: post.thread.ID, @@ -3215,7 +3107,6 @@ }, toggle: function() { var post; - post = Get.postFromNode(this); if (post.isHidden) { PostHiding.show(post); @@ -3226,7 +3117,6 @@ }, hide: function(post, makeStub, hideRecursively) { var a, postInfo, quotelink, _i, _len, _ref; - if (makeStub == null) { makeStub = Conf['Stubs']; } @@ -3264,7 +3154,6 @@ }, show: function(post, showRecursively) { var quotelink, _i, _len, _ref; - if (showRecursively == null) { showRecursively = Conf['Recursive Hiding']; } @@ -3300,7 +3189,6 @@ }, node: function() { var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; - if (this.isClone) { return; } @@ -3318,7 +3206,6 @@ }, add: function() { var args, obj, post, recursive, _base, _name; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { recursives: [], @@ -3329,7 +3216,6 @@ }, rm: function(recursive, post) { var i, obj, rec, _i, _len, _ref; - if (!(obj = Recursive.recursives[post.fullID])) { return; } @@ -3344,7 +3230,6 @@ }, apply: function() { var ID, args, fullID, post, recursive, _ref; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; fullID = post.fullID; _ref = g.posts; @@ -3371,7 +3256,6 @@ }, node: function() { var data; - if (data = ThreadHiding.db.get({ boardID: this.board.ID, threadID: this.ID @@ -3385,7 +3269,6 @@ }, syncCatalog: function() { var hiddenThreads, hiddenThreadsOnCatalog, threadID; - hiddenThreads = ThreadHiding.db.get({ boardID: g.BOARD.ID, defaultValue: {} @@ -3412,7 +3295,6 @@ cleanCatalog: function(hiddenThreadsOnCatalog) { return $.cache("//api.4chan.org/" + g.BOARD + "/threads.json", function() { var page, thread, threads, _i, _j, _len, _len1, _ref, _ref1; - if (this.status !== 200) { return; } @@ -3438,7 +3320,6 @@ menu: { init: function() { var apply, div, hideStubLink, makeStub; - if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) { return; } @@ -3465,7 +3346,6 @@ order: 20, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || thread.isHidden) { return false; @@ -3487,7 +3367,6 @@ order: 15, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || !thread.isHidden) { return false; @@ -3498,7 +3377,6 @@ }, hide: function() { var makeStub, thread; - makeStub = $('input', this.parentNode).checked; thread = ThreadHiding.menu.thread; ThreadHiding.hide(thread, makeStub); @@ -3507,7 +3385,6 @@ }, hideStub: function() { var thread; - thread = ThreadHiding.menu.thread; ThreadHiding.hide(thread, false); $.event('CloseMenu'); @@ -3515,7 +3392,6 @@ }, makeButton: function(thread, type) { var a; - a = $.el('a', { className: "" + type + "-thread-button", innerHTML: " " + (type === 'hide' ? '-' : '+') + " ", @@ -3527,7 +3403,6 @@ }, saveHiddenState: function(thread, makeStub) { var hiddenThreadsOnCatalog; - hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; if (thread.isHidden) { ThreadHiding.db.set({ @@ -3560,7 +3435,6 @@ }, hide: function(thread, makeStub) { var OP, a, numReplies, opInfo, span, threadRoot; - if (makeStub == null) { makeStub = Conf['Stubs']; } @@ -3591,7 +3465,6 @@ }, show: function(thread) { var threadRoot; - if (thread.stub) { $.rm(thread.stub); delete thread.stub; @@ -3604,7 +3477,6 @@ QuoteBacklink = { init: function() { var format; - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { return; } @@ -3622,7 +3494,6 @@ }, firstNode: function() { var a, clone, container, containers, frag, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - if (this.isClone || !this.quotes.length) { return; } @@ -3660,7 +3531,6 @@ }, secondNode: function() { var container; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { this.nodes.backlinkContainer = $('.container', this.nodes.info); return; @@ -3674,7 +3544,6 @@ }, getContainer: function(id) { var _base; - return (_base = this.containers)[id] || (_base[id] = $.el('span', { className: 'container' })); @@ -3697,7 +3566,6 @@ }, node: function() { var board, boardID, quotelink, quotelinks, quotes, thread, threadID, _i, _len, _ref, _ref1; - if (this.isClone && this.thread === this.context.thread) { return; } @@ -3733,7 +3601,6 @@ if (Conf['Quote Hash Navigation']) { this.node = function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3746,7 +3613,6 @@ } else { this.node = function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3770,7 +3636,6 @@ }, toggle: function(e) { var boardID, context, postID, threadID, _ref; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { return; } @@ -3796,7 +3661,6 @@ }, add: function(quotelink, boardID, threadID, postID, context) { var inline, isBacklink, post, qroot, root; - isBacklink = $.hasClass(quotelink, 'backlink'); inline = $.el('div', { id: "i" + postID, @@ -3821,7 +3685,6 @@ }, rm: function(quotelink, boardID, threadID, postID, context) { var el, inlined, isBacklink, post, qroot, root, _ref; - isBacklink = $.hasClass(quotelink, 'backlink'); root = QuoteInline.findRoot(quotelink, isBacklink); root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); @@ -3863,7 +3726,6 @@ }, node: function() { var boardID, op, postID, quotelink, quotelinks, quotes, _i, _j, _len, _len1, _ref; - if (this.isClone && this.thread === this.context.thread) { return; } @@ -3906,7 +3768,6 @@ }, node: function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3915,7 +3776,6 @@ }, mouseover: function(e) { var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1; - if ($.hasClass(this, 'inlined')) { return; } @@ -3959,7 +3819,6 @@ }, mouseout: function() { var clone, post, root, _i, _len, _ref; - if (!(root = this.el.firstElementChild)) { return; } @@ -3989,7 +3848,6 @@ }, node: function() { var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; - if (this.isClone) { return; } @@ -4012,7 +3870,6 @@ QuoteThreading = { init: function() { var input; - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { return; } @@ -4035,7 +3892,6 @@ }, setup: function() { var ID, post, posts; - $.off(d, '4chanXInitFinished', QuoteThreading.setup); posts = g.posts; for (ID in posts) { @@ -4048,7 +3904,6 @@ }, node: function() { var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; - if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { return; } @@ -4078,7 +3933,6 @@ }, nodeinsert: function() { var bottom, height, posts, qpost, qroot, threadContainer, top, _ref; - posts = g.posts; qpost = posts[this.threaded]; delete this.threaded; @@ -4108,14 +3962,12 @@ }, toggle: function() { var container, containers, node, nodes, replies, reply, thread, _i, _j, _len, _len1; - thread = $('.thread'); replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); QuoteThreading.enabled = this.checked; if (this.checked) { nodes = (function() { var _i, _len, _results; - _results = []; for (_i = 0, _len = replies.length; _i < _len; _i++) { reply = replies[_i]; @@ -4130,7 +3982,6 @@ } else { replies.sort(function(a, b) { var aID, bID; - aID = Number(a.id.slice(2)); bID = Number(b.id.slice(2)); return aID - bID; @@ -4146,7 +3997,6 @@ }, kb: function() { var control; - control = $.id('threadingControl'); return control.click(); } @@ -4173,7 +4023,6 @@ }, node: function() { var quotelink, _i, _len, _ref; - if (this.isClone) { return; } @@ -4209,7 +4058,6 @@ }, node: function() { var deadlink, _i, _len, _ref; - _ref = $$('.deadlink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { deadlink = _ref[_i]; @@ -4224,7 +4072,6 @@ }, parseDeadlink: function(deadlink) { var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; - if (deadlink.parentNode.className === 'prettyprint') { $.replace(deadlink, __slice.call(deadlink.childNodes)); return; @@ -4304,7 +4151,6 @@ cypher: $.el('div'), node: function() { var a, child, cypher, cypherText, data, embed, embedder, embeds, i, index, len, link, links, lookahead, name, next, node, nodes, snapshot, spoiler, text, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2; - if (this.isClone && Conf['Embedding']) { _ref = $$('.embedder', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -4389,7 +4235,6 @@ }, toggle: function() { var el, embed, style, type, url; - embed = this.previousElementSibling; if (this.className.contains("embedded")) { el = $.el('a', { @@ -4483,7 +4328,6 @@ style: 'height: auto; width: 500px; display: inline-block;', el: function() { var div; - div = $.el('div', { className: "soundcloud", name: "soundcloud" @@ -4509,7 +4353,6 @@ regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/, el: function() { var div; - return div = $.el('iframe', { src: "http://pastebin.com/embed_iframe.php?i=" + this.name }); @@ -4519,7 +4362,6 @@ regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/, el: function() { var div; - return div = $.el('iframe', { src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js" }); @@ -4530,7 +4372,6 @@ }, text: function() { var file, response; - response = JSON.parse(this.responseText).files; for (file in response) { if (response.hasOwnProperty(file)) { @@ -4551,14 +4392,12 @@ }, embedder: function(a) { var callbacks, embed, key, match, service, titles, type, _ref; - if (!Conf['Link Title']) { return [a]; } titles = {}; callbacks = function() { var title; - return a.textContent = (function() { switch (this.status) { case 200: @@ -4600,7 +4439,6 @@ if (Conf['Link Title'] && (service = type.title)) { $.get('CachedTitles', {}, function(item) { var err, title; - titles = item['CachedTitles']; if (title = titles[match[1]]) { a.textContent = title[0]; @@ -4624,7 +4462,6 @@ QR = { init: function() { var sc; - if (!Conf['Quick Reply']) { return; } @@ -4671,7 +4508,6 @@ }, initReady: function() { var link; - QR.postingIsEnabled = !!$.id('postForm'); if (!QR.postingIsEnabled) { return; @@ -4691,13 +4527,11 @@ $.before($.id('postForm'), link); $.on(d, 'QRGetSelectedPost', function(_arg) { var cb; - cb = _arg.detail; return cb(QR.selected); }); $.on(d, 'QRAddPreSubmitHook', function(_arg) { var cb; - cb = _arg.detail; return QR.preSubmitHooks.push(cb); }); @@ -4726,7 +4560,6 @@ }, open: function() { var err; - if (QR.nodes) { QR.nodes.el.hidden = false; QR.unhide(); @@ -4745,7 +4578,6 @@ }, close: function() { var i, _i, _len, _ref; - if (QR.req) { QR.abort(); return; @@ -4792,7 +4624,6 @@ }, error: function(err) { var el; - QR.open(); if (typeof err === 'string') { el = $.tn(err); @@ -4820,7 +4651,6 @@ notifications: [], cleanNotifications: function() { var notification, _i, _len, _ref; - _ref = QR.notifications; for (_i = 0, _len = _ref.length; _i < _len; _i++) { notification = _ref[_i]; @@ -4830,7 +4660,6 @@ }, status: function() { var disabled, status, value; - if (!QR.nodes) { return; } @@ -4851,7 +4680,6 @@ QR.persona.getPassword(); return $.get('QR.personas', Conf['QR.personas'], function(_arg) { var arr, item, personas, type, types, _i, _len, _ref; - personas = _arg['QR.personas']; types = { name: [], @@ -4871,7 +4699,6 @@ }, parseItem: function(item, types) { var boards, match, type, val, _ref, _ref1; - if (item[0] === '#') { return; } @@ -4900,7 +4727,6 @@ }, loadPersonas: function(type, arr) { var list, val, _i, _len; - list = $("#list-" + type, QR.nodes.el); for (_i = 0, _len = arr.length; _i < _len; _i++) { val = arr[_i]; @@ -4914,7 +4740,6 @@ }, getPassword: function() { var input, m; - if (!QR.persona.pwd) { QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : $.id('delPassword').value; } @@ -4923,7 +4748,6 @@ get: function(cb) { return $.get('QR.persona', {}, function(_arg) { var persona; - persona = _arg['QR.persona']; return cb(persona); }); @@ -4931,7 +4755,6 @@ set: function(post) { return $.get('QR.persona', {}, function(_arg) { var persona; - persona = _arg['QR.persona']; persona = { name: post.name, @@ -4945,7 +4768,6 @@ cooldown: { init: function() { var board; - if (!Conf['Cooldown']) { return; } @@ -4987,7 +4809,6 @@ }, sync: function(cooldowns) { var id; - for (id in cooldowns) { QR.cooldown.cooldowns[id] = cooldowns[id]; } @@ -4995,7 +4816,6 @@ }, set: function(data) { var cooldown, delay, hasFile, isReply, isSage, post, req, start, type, upSpd; - if (!Conf['Cooldown']) { return; } @@ -5035,7 +4855,6 @@ }, count: function() { var cooldown, cooldowns, elapsed, hasFile, isReply, isSage, now, post, seconds, start, type, types, upSpd, upSpdAccuracy, update, _ref; - if (!Object.keys(QR.cooldown.cooldowns).length) { $["delete"]("" + g.BOARD + ".cooldown"); delete QR.cooldown.isCounting; @@ -5089,7 +4908,6 @@ }, quote: function(e) { var OP, caretPos, com, index, post, range, s, sel, selectionRoot, text, thread, _ref; - if (e != null) { e.preventDefault(); } @@ -5129,7 +4947,6 @@ }, characterCount: function() { var count, counter; - counter = QR.nodes.charCount; count = QR.nodes.com.textLength; counter.textContent = count; @@ -5138,7 +4955,6 @@ }, drag: function(e) { var toggle; - toggle = e.type === 'dragstart' ? $.off : $.on; toggle(d, 'dragover', QR.dragOver); return toggle(d, 'drop', QR.dropFile); @@ -5158,7 +4974,6 @@ }, paste: function(e) { var blob, files, item, _i, _len, _ref; - files = []; _ref = e.clipboardData.items; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -5186,7 +5001,6 @@ }, fileInput: function(files) { var file, length, max, post, _i, _len; - if (this instanceof Element) { files = __slice.call(this.files); QR.nodes.fileInput.value = null; @@ -5235,7 +5049,6 @@ function _Class(select) { var el, elm, event, prev, _i, _j, _len, _len1, _ref, _ref1, _this = this; - el = $.el('a', { className: 'qr-preview', draggable: true, @@ -5295,7 +5108,6 @@ _Class.prototype.rm = function() { var index; - $.rm(this.nodes.el); index = QR.posts.indexOf(this); if (QR.posts.length === 1) { @@ -5313,7 +5125,6 @@ _Class.prototype.lock = function(lock) { var name, _i, _len, _ref; - if (lock == null) { lock = true; } @@ -5338,7 +5149,6 @@ _Class.prototype.select = function() { var rectEl, rectList; - if (QR.selected) { QR.selected.nodes.el.id = null; QR.selected.forceSave(); @@ -5355,7 +5165,6 @@ _Class.prototype.load = function() { var name, _i, _len, _ref; - _ref = ['thread', 'name', 'email', 'sub', 'com']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { name = _ref[_i]; @@ -5367,7 +5176,6 @@ _Class.prototype.save = function(input) { var value, _ref; - if (input.type === 'checkbox') { this.spoiler = input.checked; return; @@ -5386,7 +5194,6 @@ _Class.prototype.forceSave = function() { var name, _i, _len, _ref; - if (this !== QR.selected) { return; } @@ -5418,7 +5225,6 @@ _Class.prototype.setThumbnail = function(fileURL) { var img, reader, _this = this; - if (!window.URL) { if (!fileURL) { reader = new FileReader(); @@ -5434,7 +5240,6 @@ img = $.el('img'); img.onload = function() { var applyBlob, cv, data, height, i, l, s, ui8a, width, _i; - s = 90 * 2; if (_this.file.type === 'image/gif') { s *= 3; @@ -5514,11 +5319,9 @@ _Class.prototype.pasteText = function(file) { var reader, _this = this; - reader = new FileReader(); reader.onload = function(e) { var text; - text = e.target.result; if (_this.com) { _this.com += "\n" + text; @@ -5556,7 +5359,6 @@ _Class.prototype.drop = function() { var el, index, newIndex, oldIndex, post; - el = $('.drag', this.parentNode); $.rmClass(el, 'drag'); $.rmClass(this, 'over'); @@ -5591,7 +5393,6 @@ ready: function() { var imgContainer, input, observer, setLifetime, _this = this; - setLifetime = function(e) { return _this.lifetime = e.detail; }; @@ -5633,7 +5434,6 @@ }); $.get('captchas', [], function(_arg) { var captchas; - captchas = _arg.captchas; return _this.sync(captchas); }); @@ -5650,7 +5450,6 @@ }, getOne: function() { var captcha, challenge, response; - this.clear(); if (captcha = this.captchas.shift()) { challenge = captcha.challenge, response = captcha.response; @@ -5675,7 +5474,6 @@ }, save: function() { var response; - if (!(response = this.nodes.input.value.trim())) { return; } @@ -5690,7 +5488,6 @@ }, clear: function() { var captcha, i, now, _i, _len, _ref; - now = Date.now(); _ref = this.captchas; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { @@ -5708,7 +5505,6 @@ }, load: function() { var challenge; - if (!this.nodes.challenge.firstChild) { return; } @@ -5721,7 +5517,6 @@ }, count: function() { var count; - count = this.captchas.length; this.nodes.input.placeholder = (function() { switch (count) { @@ -5754,7 +5549,6 @@ }, dialog: function() { var dialog, elm, mimeTypes, name, nodes, thread, _i, _j, _len, _len1, _ref, _ref1; - dialog = UI.dialog('qr', 'top:0;right:0;', "
×
No selected file×+
"); QR.nodes = nodes = { el: dialog, @@ -5874,7 +5668,6 @@ preSubmitHooks: [], submit: function(e) { var callbacks, challenge, err, filetag, hook, opts, post, postData, response, textOnly, thread, threadID, _i, _len, _ref, _ref1; - if (e != null) { e.preventDefault(); } @@ -5987,7 +5780,6 @@ }, response: function() { var URL, ban, board, err, h1, isReply, m, post, postID, req, threadID, tmpDoc, _, _ref, _ref1; - req = QR.req; delete QR.req; post = QR.posts[0]; @@ -6090,7 +5882,6 @@ FappeTyme = { init: function() { var el, input; - if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { return; } @@ -6142,7 +5933,6 @@ }, node: function() { var thumb, _ref; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6167,7 +5957,6 @@ }, toggleAll: function() { var ID, file, func, post, _i, _len, _ref, _ref1; - $.event('CloseMenu'); if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { ImageExpand.EAI.className = 'contract-all-shortcut'; @@ -6201,7 +5990,6 @@ }, toggle: function(post) { var headRect, node, rect, root, thumb, top; - thumb = post.file.thumb; if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { ImageExpand.expand(post); @@ -6246,7 +6034,6 @@ }, expand: function(post, src) { var img, thumb; - thumb = post.file.thumb; if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { return; @@ -6274,7 +6061,6 @@ }, completeExpand: function(post) { var prev, thumb; - thumb = post.file.thumb; if (!$.hasClass(thumb, 'expanding')) { return; @@ -6288,7 +6074,6 @@ prev = post.nodes.root.getBoundingClientRect(); return $.queueTask(function() { var curr, root; - $.addClass(post.nodes.root, 'expanded-image'); $.rmClass(post.file.thumb, 'expanding'); if (!(prev.top + prev.height <= 0)) { @@ -6301,7 +6086,6 @@ }, error: function() { var URL, post, src, timeoutID; - post = Get.postFromNode(this); $.rm(this); delete post.file.fullImage; @@ -6327,7 +6111,6 @@ return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { onload: function() { var postObj, _i, _len, _ref; - if (this.status !== 200) { return; } @@ -6351,7 +6134,6 @@ menu: { init: function() { var conf, createSubEntry, el, key, subEntries, _ref; - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { return; } @@ -6375,7 +6157,6 @@ }, createSubEntry: function(type, config) { var input, label; - label = $.el('label', { innerHTML: " " + type }); @@ -6411,7 +6192,6 @@ }, node: function() { var _ref; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6419,7 +6199,6 @@ }, mouseover: function(e) { var el, post; - post = Get.postFromNode(this); el = $.el('img', { id: 'ihover', @@ -6441,7 +6220,6 @@ error: function() { var URL, post, src, timeoutID, _this = this; - if (!doc.contains(this)) { return; } @@ -6466,7 +6244,6 @@ return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { onload: function() { var postObj, _i, _len, _ref; - if (this.status !== 200) { return; } @@ -6492,7 +6269,6 @@ ImageLoader = { init: function() { var prefetch; - if (g.VIEW === 'catalog') { return; } @@ -6519,7 +6295,6 @@ }, node: function() { var URL, img, string, style, thumb, type, _ref, _ref1; - if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6541,7 +6316,6 @@ }, toggle: function() { var enabled, id, post, _ref; - enabled = Conf['prefetch'] = this.checked; if (enabled) { _ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts; @@ -6565,7 +6339,6 @@ }, node: function() { var thumb, _ref; - if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { return; } @@ -6578,7 +6351,6 @@ ArchiveLink = { init: function() { var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { return; } @@ -6591,7 +6363,6 @@ order: 90, open: function(_arg) { var ID, board, thread; - ID = _arg.ID, thread = _arg.thread, board = _arg.board; return !!Redirect.to('thread', { postID: ID, @@ -6610,14 +6381,12 @@ }, createSubEntry: function(text, type) { var el, open; - el = $.el('a', { textContent: text, target: '_blank' }); open = type === 'post' ? function(_arg) { var ID, board, thread; - ID = _arg.ID, thread = _arg.thread, board = _arg.board; el.href = Redirect.to('thread', { postID: ID, @@ -6627,7 +6396,6 @@ return true; } : function(post) { var value; - value = Filter[type](post); if (!value) { return false; @@ -6650,7 +6418,6 @@ DeleteLink = { init: function() { var div, fileEl, fileEntry, postEl, postEntry; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { return; } @@ -6678,7 +6445,6 @@ el: fileEl, open: function(_arg) { var file; - file = _arg.file; if (!file || file.isDead) { return false; @@ -6694,7 +6460,6 @@ order: 40, open: function(post) { var node; - if (post.isDead || post.board.ID === 'q') { return false; } @@ -6709,7 +6474,6 @@ }, "delete": function() { var fileOnly, form, link, post; - post = DeleteLink.post; if (DeleteLink.cooldown.counting === post) { return; @@ -6738,7 +6502,6 @@ }, load: function(link, post, fileOnly, html) { var msg, s, tmpDoc; - tmpDoc = d.implementation.createHTMLDocument(''); tmpDoc.documentElement.innerHTML = html; if (tmpDoc.title === '4chan - Banned') { @@ -6761,7 +6524,6 @@ cooldown: { start: function(post, node) { var length, seconds, _ref; - if (!((_ref = QR.db) != null ? _ref.get({ boardID: post.board.ID, threadID: post.thread.ID, @@ -6795,7 +6557,6 @@ DownloadLink = { init: function() { var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { return; } @@ -6809,7 +6570,6 @@ order: 100, open: function(_arg) { var file; - file = _arg.file; if (!file) { return false; @@ -6835,7 +6595,6 @@ }, node: function() { var button; - button = Menu.makeButton(this); if (this.isClone) { $.replace($('.menu-button', this.nodes.info), button); @@ -6845,11 +6604,9 @@ }, makeButton: (function() { var a; - a = null; return function(post) { var clone; - a || (a = $.el('a', { className: 'menu-button fourchanx-link', innerHTML: '', @@ -6866,7 +6623,6 @@ })(), toggle: function(e) { var post; - post = this.dataset.clone ? Get.postFromNode(this) : g.posts[this.dataset.postid]; return Menu.menu.toggle(e, this, post); } @@ -6875,7 +6631,6 @@ ReportLink = { init: function() { var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { return; } @@ -6897,7 +6652,6 @@ }, report: function() { var id, post, set, url; - post = ReportLink.post; url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; id = Date.now(); @@ -6910,7 +6664,6 @@ init: function() { return $.ready(function() { var href; - Favicon.el = $('link[rel="shortcut icon"]', d.head); Favicon.el.type = 'image/x-icon'; href = Favicon.el.href; @@ -6983,7 +6736,6 @@ init: function() { var sc, _this = this; - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { return; } @@ -7013,7 +6765,6 @@ }, node: function() { var ID, fileCount, post, postCount, _ref; - postCount = 0; fileCount = 0; _ref = this.posts; @@ -7031,7 +6782,6 @@ }, onUpdate: function(e) { var fileCount, postCount, _ref; - if (e.detail[404]) { return; } @@ -7040,7 +6790,6 @@ }, update: function(postCount, fileCount) { var fileCountEl, postCountEl, thread; - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; postCountEl.textContent = postCount; fileCountEl.textContent = fileCount; @@ -7067,7 +6816,6 @@ }, onThreadsLoad: function() { var page, pages, thread, _i, _j, _len, _len1, _ref; - if (!Conf["Page Count in Stats"]) { return; } @@ -7095,7 +6843,6 @@ init: function() { var checked, conf, el, input, name, sc, settings, subEntries, _ref, _this = this; - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { return; } @@ -7246,7 +6993,6 @@ }, interval: function() { var val; - val = +this.value; if (val < 1) { val = 1; @@ -7256,7 +7002,6 @@ }, load: function() { var klass, req, text, _ref; - req = ThreadUpdater.req; switch (req.status) { case 200: @@ -7300,7 +7045,6 @@ }, getInterval: function() { var i, j; - i = ThreadUpdater.interval; j = Math.min(ThreadUpdater.outdateCount, 10); if (!d.hidden) { @@ -7310,14 +7054,12 @@ }, intervalShortcut: function() { var settings; - Settings.open('Advanced'); settings = $.id('fourchanx-settings'); return $('input[name=Interval]', settings).focus(); }, set: function(name, text, klass) { var el, node; - el = ThreadUpdater[name]; if (node = el.firstChild) { node.data = text; @@ -7330,7 +7072,6 @@ }, timeout: function() { var n; - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); if (!(n = --ThreadUpdater.seconds)) { return ThreadUpdater.update(); @@ -7343,7 +7084,6 @@ }, update: function() { var url; - if (!ThreadUpdater.online) { return; } @@ -7368,7 +7108,6 @@ }, updateThreadStatus: function(title, OP) { var icon, message, root, titleLC; - titleLC = title.toLowerCase(); if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { return; @@ -7395,7 +7134,6 @@ }, parse: function(postObjects) { var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, root, scroll, _i, _len, _ref; - OP = postObjects[0]; Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; ThreadUpdater.updateThreadStatus('Sticky', OP); @@ -7481,7 +7219,6 @@ } $.queueTask(function() { var length, threadID; - threadID = ThreadUpdater.thread.ID; length = $$('.thread > .postContainer', ThreadUpdater.root).length; return Fourchan.parseThread(threadID, length - count, length); @@ -7502,7 +7239,6 @@ ThreadWatcher = { init: function() { var sc; - if (!Conf['Thread Watcher']) { return; } @@ -7536,7 +7272,6 @@ node: function() { var favicon, _this = this; - favicon = $.el('a', { className: 'watch-thread-link', href: 'javascript:;' @@ -7556,7 +7291,6 @@ }, refresh: function(watched) { var ID, board, div, favicon, id, link, nodes, props, thread, x, _ref, _ref1; - if (!watched) { $.get('WatchedThreads', {}, function(item) { return ThreadWatcher.refresh(item['WatchedThreads']); @@ -7605,13 +7339,11 @@ }, x: function() { var thread; - thread = this.nextElementSibling.pathname.split('/'); return ThreadWatcher.unwatch(thread[1], thread[3]); }, post: function(e) { var board, postID, threadID, _ref; - _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; if (postID === threadID) { if (Conf['Auto Watch']) { @@ -7632,7 +7364,6 @@ unwatch: function(board, threadID) { return $.get('WatchedThreads', {}, function(item) { var watched; - watched = item['WatchedThreads']; delete watched[board][threadID]; if (!Object.keys(watched[board]).length) { @@ -7645,7 +7376,6 @@ watch: function(thread) { return $.get('WatchedThreads', {}, function(item) { var watched, _name; - watched = item['WatchedThreads']; watched[_name = thread.board] || (watched[_name] = {}); watched[thread.board][thread] = { @@ -7691,7 +7421,6 @@ }, ready: function() { var ID, post, posts, _ref; - $.off(d, '4chanXInitFinished', Unread.ready); posts = []; _ref = Unread.thread.posts; @@ -7708,7 +7437,6 @@ }, scroll: function() { var checkPosition, hash, onload, post, posts, prevID, root; - if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { return; } @@ -7740,7 +7468,6 @@ } checkPosition = function(target) { var height, top, _ref; - _ref = target.getBoundingClientRect(), top = _ref.top, height = _ref.height; return top + height - doc.clientHeight > 0; }; @@ -7748,7 +7475,6 @@ }, sync: function() { var lastReadPost; - lastReadPost = Unread.db.get({ boardID: Unread.thread.board.ID, threadID: Unread.thread.ID, @@ -7765,7 +7491,6 @@ }, addPosts: function(posts) { var ID, data, post, _i, _len, _ref; - for (_i = 0, _len = posts.length; _i < _len; _i++) { post = posts[_i]; ID = post.ID; @@ -7793,7 +7518,6 @@ }, addPostQuotingYou: function(post) { var quotelink, _i, _len, _ref; - if (!QR.db) { return; } @@ -7814,7 +7538,6 @@ }, readSinglePost: function(post) { var i; - if ((i = Unread.posts.indexOf(post)) === -1) { return; } @@ -7830,7 +7553,6 @@ }, readArray: function(arr) { var i, post, _i, _len; - for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { post = arr[i]; if (post.ID > Unread.lastReadPost) { @@ -7841,7 +7563,6 @@ }, read: $.debounce(50, function(e) { var ID, bottom, height, i, post, posts, read; - if (d.hidden || !Unread.posts.length) { return; } @@ -7875,7 +7596,6 @@ }), setLine: function(force) { var post, root; - if (!(d.hidden || force === true)) { return; } @@ -7890,7 +7610,6 @@ }, update: function() { var count; - count = Unread.posts.length; if (Conf['Unread Count']) { d.title = "" + (Conf['Quoted Title'] && Unread.postsQuotingYou.length ? '(!) ' : '') + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); @@ -7909,7 +7628,6 @@ file: {}, init: function() { var archive, arr, boardID, data, id, name, type, _i, _len, _ref, _ref1, _ref2, _ref3; - _ref = Conf['selectedArchives']; for (boardID in _ref) { data = _ref[boardID]; @@ -7952,7 +7670,7 @@ 'http': false, 'https': true, 'software': 'foolfuuka', - 'boards': ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vg', 'vp', 'vr', 'wsg'], + 'boards': ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg'], 'files': ['a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg'] }, 'NSFW Foolz': { @@ -7994,6 +7712,14 @@ 'boards': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv'], 'files': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv'] }, + 'World Athletic Project': { + 'domain': 'fuuka.worldathleticproject.org', + 'http': true, + 'https': false, + 'software': 'foolfuuka', + 'boards': ['e', 'h', 'p', 's', 'u'], + 'files': ['e', 'h', 'p', 's', 'u'] + }, 'Install Gentoo': { 'domain': 'archive.installgentoo.net', 'http': false, @@ -8020,7 +7746,6 @@ }, to: function(dest, data) { var archive; - archive = (dest === 'search' ? Redirect.thread : Redirect[dest])[data.boardID]; if (!archive) { return ''; @@ -8029,7 +7754,6 @@ }, protocol: function(archive) { var protocol; - protocol = location.protocol; if (!archive[protocol.slice(0, -1)]) { protocol = protocol === 'https:' ? 'http:' : 'https:'; @@ -8038,7 +7762,6 @@ }, thread: function(archive, _arg) { var boardID, path, postID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID; path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; if (archive.software === 'foolfuuka') { @@ -8051,7 +7774,6 @@ }, post: function(archive, _arg) { var boardID, postID, protocol; - boardID = _arg.boardID, postID = _arg.postID; protocol = Redirect.protocol(archive); if (['Foolz', 'NSFW Foolz'].contains(archive.name)) { @@ -8061,13 +7783,11 @@ }, file: function(archive, _arg) { var boardID, filename; - boardID = _arg.boardID, filename = _arg.filename; return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename; }, search: function(archive, _arg) { var boardID, path, type, value; - boardID = _arg.boardID, type = _arg.type, value = _arg.value; type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; value = encodeURIComponent(value); @@ -8086,7 +7806,6 @@ }, setup: function() { var btn, entry, psa; - $.off(d, '4chanXInitFinished', PSAHiding.setup); if (!(psa = $.id('globalMessage'))) { $.rmClass(doc, 'hide-announcement'); @@ -8115,7 +7834,6 @@ $.on(btn, 'click', PSAHiding.toggle); $.get('hiddenPSA', 0, function(_arg) { var hiddenPSA; - hiddenPSA = _arg.hiddenPSA; PSAHiding.sync(hiddenPSA); $.before(psa, btn); @@ -8125,7 +7843,6 @@ }, toggle: function(e) { var UTC; - if ($.hasClass(this, 'hide-announcement')) { UTC = +$.id('globalMessage').dataset.utc; $.set('hiddenPSA', UTC); @@ -8137,7 +7854,6 @@ }, sync: function(UTC) { var hr, psa; - psa = $.id('globalMessage'); psa.hidden = PSAHiding.btn.hidden = UTC && UTC >= +psa.dataset.utc ? true : false; if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') { @@ -8149,7 +7865,6 @@ CatalogLinks = { init: function() { var el, input; - if (!Conf['Catalog Links']) { return; } @@ -8173,14 +7888,12 @@ }, toggle: function() { var useCatalog; - $.event('CloseMenu'); $.set('Header catalog links', useCatalog = this.checked); return CatalogLinks.set(useCatalog); }, set: function(useCatalog) { var a, board, path, _i, _len, _ref; - path = useCatalog ? 'catalog' : ''; _ref = $$("#board-list a[href*=\"boards.4chan.org\"]:not(.catalog),\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -8214,7 +7927,6 @@ }, node: function(post) { var str, uid; - if (!(uid = $('.hand', this.nodes.uniqueID))) { return; } @@ -8226,7 +7938,6 @@ ids: {}, compute: function(str) { var hash, rgb; - hash = this.hash(str); rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF]; rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125; @@ -8235,13 +7946,11 @@ }, apply: function() { var rgb; - rgb = IDColor.ids[this] || IDColor.compute(this); return ("background-color: rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "); color: ") + (rgb[3] ? "black; border-radius: 3px; padding: 0px 2px;" : "white; border-radius: 3px; padding: 0px 2px;"); }, hash: function(str) { var i, j, msg; - msg = 0; i = 0; j = str.length; @@ -8280,7 +7989,6 @@ Emoji = { init: function() { var css, icon, name, pos, _ref; - if (!Conf['Emoji']) { return; } @@ -8350,7 +8058,6 @@ }, node: function() { var a; - if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) { return $.on(a, 'click', ExpandComment.cb); } @@ -8358,14 +8065,12 @@ callbacks: [], cb: function(e) { var post; - e.preventDefault(); post = Get.postFromNode(this); return ExpandComment.expand(post); }, expand: function(post) { var a; - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { $.replace(post.nodes.shortComment, post.nodes.longComment); post.nodes.comment = post.nodes.longComment; @@ -8381,7 +8086,6 @@ }, contract: function(post) { var a; - if (!post.nodes.shortComment) { return; } @@ -8392,7 +8096,6 @@ }, parse: function(req, a, post) { var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - status = req.status; if (![200, 304].contains(status)) { a.textContent = "Error " + req.statusText + " (" + status + ")"; @@ -8449,7 +8152,6 @@ }, node: function() { var a, span; - if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { return; } @@ -8463,13 +8165,11 @@ }, cbToggle: function() { var op; - op = Get.postFromRoot(this.previousElementSibling); return ExpandThread.toggle(op.thread); }, toggle: function(thread) { var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - threadRoot = thread.OP.nodes.root.parentNode; a = $('.summary', threadRoot); switch (thread.isExpanded) { @@ -8538,7 +8238,6 @@ }, parse: function(req, thread, a) { var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; - if (a.textContent[0] === '+') { return; } @@ -8596,7 +8295,6 @@ }, createFunc: function(format) { var code; - code = format.replace(/%(.)/g, function(s, c) { if (c in FileInfo.formatters) { return "' + FileInfo.formatters." + c + ".call(post) + '"; @@ -8608,7 +8306,6 @@ }, convertUnit: function(size, unit) { var i; - if (unit === 'B') { return "" + (size.toFixed()) + " Bytes"; } @@ -8639,7 +8336,6 @@ }, n: function() { var fullname, shortname; - fullname = this.file.name; shortname = Build.shortFilename(this.file.name, this.isReply); if (fullname === shortname) { @@ -8683,7 +8379,6 @@ Fourchan = { init: function() { var board; - if (g.VIEW === 'catalog') { return; } @@ -8705,7 +8400,6 @@ }, code: function() { var pre, _i, _len, _ref; - if (this.isClone) { return; } @@ -8735,13 +8429,11 @@ Keybinds = { init: function() { var init; - if (g.VIEW === 'catalog' || !Conf['Keybinds']) { return; } init = function() { var node, _i, _len, _ref; - $.off(d, '4chanXInitFinished', init); $.on(d, 'keydown', Keybinds.keydown); _ref = $$('[accesskey]'); @@ -8754,7 +8446,6 @@ }, keydown: function(e) { var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; - if (!(key = Keybinds.keyCode(e))) { return; } @@ -8929,7 +8620,6 @@ }, keyCode: function(e) { var kc, key; - key = (function() { switch (kc = e.keyCode) { case 8: @@ -8985,7 +8675,6 @@ }, tags: function(tag, ta) { var range, selEnd, selStart, value; - value = ta.value; selStart = ta.selectionStart; selEnd = ta.selectionEnd; @@ -8996,13 +8685,11 @@ }, sage: function() { var isSage; - isSage = /sage/i.test(QR.nodes.email.value); return QR.nodes.email.value = isSage ? "" : "sage"; }, img: function(thread, all) { var post; - if (all) { return ImageExpand.cb.toggleAll(); } else { @@ -9012,7 +8699,6 @@ }, open: function(thread, tab) { var url; - if (g.VIEW !== 'index') { return; } @@ -9025,7 +8711,6 @@ }, hl: function(delta, thread) { var axe, headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; - if (!delta) { if (postEl = $('.reply.highlight', thread)) { $.rmClass(postEl, 'highlight'); @@ -9085,7 +8770,6 @@ Nav = { init: function() { var append, next, prev, span; - switch (g.VIEW) { case 'index': if (!Conf['Index Navigation']) { @@ -9136,7 +8820,6 @@ }, getThread: function(full) { var headRect, i, rect, thread, threads, topMargin, _i, _len; - if (Conf['Bottom header'] || !Conf['Fixed Header']) { topMargin = 0; } else { @@ -9162,7 +8845,6 @@ }, scroll: function(delta) { var i, rect, thread, threads, top, topMargin, _ref, _ref1; - _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; top = rect.top - topMargin; if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) { @@ -9188,7 +8870,6 @@ }, node: function() { var dateEl; - if (this.isClone) { return; } @@ -9198,7 +8879,6 @@ }, relative: function(diff, now, date) { var days, months, number, rounded, unit, years; - unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); rounded = Math.round(number); if (rounded !== 1) { @@ -9209,7 +8889,6 @@ stale: [], flush: function() { var now, update, _i, _len, _ref; - if (d.hidden) { return; } @@ -9225,16 +8904,13 @@ }, setUpdate: function(post) { var markStale, setOwnTimeout, update; - setOwnTimeout = function(diff) { var delay; - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; return setTimeout(markStale, delay); }; update = function(now) { var date, diff, relative, singlePost, _i, _len, _ref; - date = post.info.date; diff = now - date; relative = RelativeDates.relative(diff, now, date); @@ -9275,7 +8951,6 @@ }, node: function(post) { var spoiler, spoilers, _i, _len; - spoilers = $$('s', this.nodes.comment); for (_i = 0, _len = spoilers.length; _i < _len; _i++) { spoiler = spoilers[_i]; @@ -9295,7 +8970,6 @@ }, ready: function() { var field; - field = $.id('recaptcha_response_field'); $.on(field, 'keydown', function(e) { if (e.keyCode === 8 && !field.value) { @@ -9304,7 +8978,6 @@ }); return $.on($('form'), 'submit', function(e) { var response; - e.preventDefault(); response = field.value.trim(); if (!/\s/.test(response)) { @@ -9318,7 +8991,6 @@ Sauce = { init: function() { var err, link, links, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Sauce']) { return; } @@ -9350,7 +9022,6 @@ }, createSauceLink: function(link) { var m, text; - link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { switch (parameter) { case '%TURL': @@ -9371,7 +9042,6 @@ }, node: function() { var link, nodes, _i, _len, _ref; - if (this.isClone || !this.file) { return; } @@ -9404,7 +9074,6 @@ }, createFunc: function(format) { var code; - code = format.replace(/%([A-Za-z])/g, function(s, c) { if (c in Time.formatters) { return "' + Time.formatters." + c + ".call(date) + '"; @@ -9489,7 +9158,6 @@ Settings = { init: function() { var link, settings; - link = $.el('a', { className: 'settings-link', textContent: 'Settings', @@ -9499,7 +9167,6 @@ Header.addShortcut(link); $.get('previousversion', null, function(item) { var changelog, el, previous; - if (previous = item['previousversion']) { if (previous === g.VERSION) { return; @@ -9537,7 +9204,6 @@ }, open: function(openSection) { var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref; - $.off(d, '4chanXInitFinished', Settings.open); if (Settings.dialog) { return; @@ -9590,7 +9256,6 @@ sections: [], addSection: function(title, open) { var hyphenatedTitle, _ref; - if (typeof title !== 'string') { _ref = title.detail, title = _ref.title, open = _ref.open; } @@ -9603,7 +9268,6 @@ }, openSection: function() { var section, selected; - if (selected = $('.tab-selected', Settings.dialog)) { $.rmClass(selected, 'tab-selected'); } @@ -9617,7 +9281,6 @@ }, main: function(section) { var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref; - items = {}; inputs = {}; _ref = Config.main; @@ -9642,7 +9305,6 @@ } $.get(items, function(items) { var val; - for (key in items) { val = items[key]; inputs[key].checked = val; @@ -9657,7 +9319,6 @@ boards: {} }, function(item) { var ID, board, thread, _ref1; - _ref1 = item.hiddenThreads.boards; for (ID in _ref1) { board = _ref1[ID]; @@ -9672,7 +9333,6 @@ boards: {} }, function(item) { var ID, board, post, thread, _ref1; - _ref1 = item.hiddenPosts.boards; for (ID in _ref1) { board = _ref1[ID]; @@ -9692,7 +9352,6 @@ boards: {} }, function(item) { var boardID; - for (boardID in item.hiddenThreads.boards) { localStorage.removeItem("4chan-hide-t-" + boardID); } @@ -9703,7 +9362,6 @@ }, "export": function(now, data) { var a, db, p, _i, _len; - if (typeof now !== 'number') { now = Date.now(); data = { @@ -9740,7 +9398,6 @@ }, onImport: function() { var file, output, reader; - if (!(file = this.files[0])) { return; } @@ -9752,7 +9409,6 @@ reader = new FileReader(); reader.onload = function(e) { var data, err; - try { data = JSON.parse(e.target.result); Settings.loadSettings(data); @@ -9769,7 +9425,6 @@ }, loadSettings: function(data) { var key, val, version, _ref; - version = data.version.split('.'); if (version[0] === '2') { data = Settings.convertSettings(data, { @@ -9859,7 +9514,6 @@ }, convertSettings: function(data, map) { var newKey, prevKey; - for (prevKey in map) { newKey = map[prevKey]; if (newKey) { @@ -9871,7 +9525,6 @@ }, filter: function(section) { var select; - section.innerHTML = "
"; select = $('select', section); $.on(select, 'change', Settings.selectFilter); @@ -9879,7 +9532,6 @@ }, selectFilter: function() { var div, name, ta; - div = this.nextElementSibling; if ((name = this.value) !== 'guide') { $.rmAll(div); @@ -9899,7 +9551,6 @@ }, sauce: function(section) { var ta; - section.innerHTML = "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
    These parameters will be replaced by their corresponding values:\n
  • %TURL: Thumbnail URL.
  • %URL: Full image URL.
  • %MD5: MD5 hash.
  • %board: Current board.
"; ta = $('textarea', section); $.get('sauces', Conf['sauces'], function(item) { @@ -9909,7 +9560,6 @@ }, advanced: function(section) { var archive, boardID, boardOptions, boardSelect, boards, data, event, input, inputs, item, items, name, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4; - section.innerHTML = "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Disabled selections indicate that only one archive is available for that board and redirection type.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
Board link: g
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:\"Install Gentoo\"
Index-only link: g-index
Catalog-only link: g-catalog
External link: external-text:\"Google\",\"http://www.google.com\"
Combinations are possible: g-index-text:\"Technology Index\"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
Time Formatting is disabled.
:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Quick Reply Personas is disabled.

\n One item per line.
\n Items will be added in the relevant input's auto-completion list.
\n Password items will always be used, since there is no password input.
\n Lines starting with a # will be ignored.\n

    You can use these settings with each item, separate them with semicolons:\n
  • Possible items are: name, email, subject and password.
  • Wrap values of items with quotes, like this: email:\"sage\".
  • Force values as defaults with the always keyword, for example: email:\"sage\";always.
  • Select specific boards for an item, separated with commas, for example: email:\"sage\";boards:jp;always.
Unread Favicon is disabled.
Emoji is disabled.
\n Sage Icon:
\n Position:
Thread Updater is disabled.
\n Interval:
"; items = {}; inputs = {}; @@ -9929,7 +9579,6 @@ $.on(ta, 'change', $.cb.value); $.get(items, function(items) { var key, val; - for (key in items) { val = items[key]; if (['emojiPos'].contains(key)) { @@ -10000,7 +9649,6 @@ }); $.get('selectedArchives', Conf['selectedArchives'], function(_arg) { var option, selectedArchives, type; - selectedArchives = _arg.selectedArchives; for (boardID in selectedArchives) { data = selectedArchives[boardID]; @@ -10015,7 +9663,6 @@ }, addArchiveCell: function(boardID, data, type) { var archive, i, length, options, select, td; - length = data[type].length; td = $.el('td', { className: 'archive-cell' @@ -10045,10 +9692,8 @@ }, saveSelectedArchive: function() { var _this = this; - return $.get('selectedArchives', Conf['selectedArchives'], function(_arg) { var selectedArchives, _name; - selectedArchives = _arg.selectedArchives; (selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value; return $.set('selectedArchives', selectedArchives); @@ -10059,7 +9704,6 @@ }, time: function() { var funk; - funk = Time.createFunc(this.value); return this.nextElementSibling.textContent = funk(Time, new Date()); }, @@ -10068,7 +9712,6 @@ }, fileInfo: function() { var data, funk; - data = { isReply: true, file: { @@ -10107,7 +9750,6 @@ }, keybinds: function(section) { var arr, input, inputs, items, key, tbody, tr, _ref; - section.innerHTML = "
Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
ActionsKeybinds
"; tbody = $('tbody', section); items = {}; @@ -10128,7 +9770,6 @@ } return $.get(items, function(items) { var val; - for (key in items) { val = items[key]; inputs[key].value = val; @@ -10137,7 +9778,6 @@ }, keybind: function(e) { var key; - if (e.keyCode === 9) { return; } @@ -10154,10 +9794,8 @@ Main = { init: function(items) { var db, flatten, _i, _len; - flatten = function(parent, obj) { var key, val; - if (obj instanceof Array) { Conf[parent] = obj[0]; } else if (typeof obj === 'object') { @@ -10181,13 +9819,11 @@ $.on(d, '4chanMainInit', Main.initStyle); return $.asap((function() { var _ref; - return d.head && $('link[rel="shortcut icon"]', d.head) || ((_ref = d.readyState) === 'interactive' || _ref === 'complete'); }), Main.initStyle); }, initFeatures: function(items) { var init, pathname, _ref; - Conf = items; pathname = location.pathname.split('/'); g.BOARD = new Board(pathname[1]); @@ -10216,7 +9852,6 @@ case 'images.4chan.org': $.ready(function() { var URL; - if (Conf['404 Redirect'] && d.title === '4chan - 404 Not Found') { Redirect.init(); pathname = location.pathname.split('/'); @@ -10233,7 +9868,6 @@ } init = function(features) { var err, module, name; - for (name in features) { module = features[name]; try { @@ -10309,7 +9943,6 @@ }, initStyle: function() { var mainStyleSheet, observer, setStyle, style, styleSheets, _ref; - $.off(d, '4chanMainInit', Main.initStyle); if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) { return; @@ -10330,7 +9963,6 @@ styleSheets = $$('link[rel="alternate stylesheet"]', d.head); setStyle = function() { var styleSheet, _i, _len; - $.rmClass(doc, style); for (_i = 0, _len = styleSheets.length; _i < _len; _i++) { styleSheet = styleSheets[_i]; @@ -10357,7 +9989,6 @@ }, initReady: function() { var board, boardChild, err, errors, href, passLink, posts, styleSelector, thread, threadChild, threads, _i, _j, _len, _len1, _ref, _ref1; - if (d.title === '4chan - 404 Not Found') { if (Conf['404 Redirect'] && g.VIEW === 'thread') { href = Redirect.to('thread', { @@ -10434,7 +10065,6 @@ }, callbackNodes: function(klass, nodes) { var callback, err, errors, i, len, node, _i, _len, _ref; - len = nodes.length; _ref = klass.prototype.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -10462,11 +10092,9 @@ }, callbackNodesDB: function(klass, nodes, cb) { var errors, func, i, len, node, queue, softTask; - queue = []; softTask = function() { var args, func, task; - task = queue.shift(); func = task[0]; args = Array.prototype.slice.call(task, 1); @@ -10485,7 +10113,6 @@ errors = null; func = function(node, i) { var callback, err, _i, _len, _ref; - _ref = klass.prototype.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { callback = _ref[_i]; @@ -10519,7 +10146,6 @@ }, addCallback: function(e) { var Klass, obj; - obj = e.detail; if (typeof obj.callback.name !== 'string') { throw new Error("Invalid callback name: " + obj.callback.name); @@ -10539,7 +10165,6 @@ }, message: function(e) { var el, version; - version = e.data.version; if (version && version !== g.VERSION) { el = $.el('span', { @@ -10550,14 +10175,12 @@ }, checkUpdate: function() { var now; - if (!(Conf['Check for Updates'] && Main.isThisPageLegit())) { return; } now = Date.now(); return $.get('lastchecked', 0, function(_arg) { var lastchecked; - lastchecked = _arg.lastchecked; if (lastchecked > now - $.DAY) { return; @@ -10573,7 +10196,6 @@ }, handleErrors: function(errors) { var div, error, logs, _i, _len; - if (!(errors instanceof Array)) { error = errors; } else if (errors.length === 1) { @@ -10588,7 +10210,6 @@ }); $.on(div.lastElementChild, 'click', function() { var _ref; - return _ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = _ref[0], logs.hidden = _ref[1], _ref; }); logs = $.el('div', { @@ -10602,7 +10223,6 @@ }, parseError: function(data) { var error, message; - Main.logError(data); message = $.el('div', { textContent: data.message @@ -10619,7 +10239,6 @@ }, isThisPageLegit: function() { var _ref; - if (!('thisPageIsLegit' in Main)) { Main.thisPageIsLegit = location.hostname === 'boards.4chan.org' && !$('link[href*="favicon-status.ico"]', d.head) && ((_ref = d.title) !== '4chan - Temporarily Offline' && _ref !== '4chan - Error'); } diff --git a/builds/crx/manifest.json b/builds/crx/manifest.json index 7ce1cb8db..9cd176c4e 100644 --- a/builds/crx/manifest.json +++ b/builds/crx/manifest.json @@ -1,6 +1,6 @@ { "name": "4chan X", - "version": "1.2.21", + "version": "1.2.22", "manifest_version": 2, "description": "Cross-browser userscript for maximum lurking on 4chan.", "icons": { diff --git a/builds/crx/script.js b/builds/crx/script.js index ba672a2c2..ec9b3c52c 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.21 - 2013-07-22 +* 4chan X - Version 1.2.22 - 2013-07-23 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -300,7 +300,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.21', + VERSION: '1.2.22', NAMESPACE: '4chan X.', boards: {}, threads: {}, @@ -317,7 +317,6 @@ Array.prototype.add = function(object, position) { var keep; - keep = this.slice(position); this.length = position; this.push(object); @@ -330,7 +329,6 @@ Array.prototype.indexOf = function(object) { var i; - i = this.length; while (i--) { if (this[i] === object) { @@ -342,7 +340,6 @@ Array.prototype.pushArrays = function() { var arg, args, _i, _len; - args = arguments; for (_i = 0, _len = args.length; _i < _len; _i++) { arg = args[_i]; @@ -353,7 +350,6 @@ Array.prototype.remove = function(object) { var index; - if ((index = this.indexOf(object)) > -1) { return this.splice(index, 1); } else { @@ -370,7 +366,6 @@ $.extend = function(object, properties) { var key, val; - for (key in properties) { val = properties[key]; if (!properties.hasOwnProperty(key)) { @@ -388,7 +383,6 @@ $.ready = function(fc) { var cb, _ref; - if ((_ref = d.readyState) === 'interactive' || _ref === 'complete') { $.queueTask(fc); return; @@ -402,7 +396,6 @@ $.formData = function(form) { var fd, key, val; - if (form instanceof HTMLFormElement) { return new FormData(form); } @@ -423,7 +416,6 @@ $.ajax = function(url, callbacks, opts) { var cred, err, form, headers, key, r, sync, type, upCallbacks, val; - if (opts == null) { opts = {}; } @@ -449,11 +441,9 @@ $.cache = (function() { var reqs; - reqs = {}; return function(url, cb) { var err, req, rm; - if (req = reqs[url]) { if (req.readyState === 4) { cb.call(req, req.evt); @@ -469,7 +459,6 @@ req = $.ajax(url, { onload: function(e) { var _i, _len, _ref; - _ref = this.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { cb = _ref[_i]; @@ -511,7 +500,6 @@ $.addStyle = function(css, id) { var style; - style = $.el('style', { id: id, textContent: css @@ -558,7 +546,6 @@ } else { return function(el) { var _ref; - return (_ref = el.parentNode) != null ? _ref.removeChild(el) : void 0; }; } @@ -566,7 +553,6 @@ $.rmAll = function(root) { var node; - while (node = root.firstChild) { root.removeChild(node); } @@ -582,7 +568,6 @@ $.nodes = function(nodes) { var frag, node, _i, _len; - if (!(nodes instanceof Array)) { return nodes; } @@ -616,7 +601,6 @@ $.el = function(tag, properties) { var el; - el = d.createElement(tag); if (properties) { $.extend(el, properties); @@ -626,7 +610,6 @@ $.on = function(el, events, handler) { var event, _i, _len, _ref; - _ref = events.split(' '); for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; @@ -636,7 +619,6 @@ $.off = function(el, events, handler) { var event, _i, _len, _ref; - _ref = events.split(' '); for (_i = 0, _len = _ref.length; _i < _len; _i++) { event = _ref[_i]; @@ -660,7 +642,6 @@ $.debounce = function(wait, fn) { var args, exec, lastCall, that, timeout; - lastCall = 0; timeout = null; that = null; @@ -682,11 +663,9 @@ $.queueTask = (function() { var execTask, taskChannel, taskQueue; - taskQueue = []; execTask = function() { var args, func, task; - task = taskQueue.shift(); func = task[0]; args = Array.prototype.slice.call(task, 1); @@ -709,7 +688,6 @@ $.globalEval = function(code) { var script; - script = $.el('script', { textContent: code }); @@ -719,7 +697,6 @@ $.bytesToString = function(size) { var unit; - unit = 0; while (size >= 1024) { size /= 1024; @@ -738,7 +715,6 @@ $.sync = (function() { chrome.storage.onChanged.addListener(function(changes) { var cb, key; - for (key in changes) { if (cb = $.syncing[key]) { cb(changes[key].newValue); @@ -752,7 +728,6 @@ $.item = function(key, val) { var item; - item = {}; item[key] = val; return item; @@ -766,7 +741,6 @@ $.get = function(key, val, cb) { var count, done, items, localItems, syncItems; - if (typeof cb === 'function') { items = $.item(key, val); } else { @@ -786,7 +760,6 @@ count = 0; done = function(item) { var lastError; - lastError = chrome.runtime.lastError; if (lastError) { c.error(lastError, lastError.message || 'No message.'); @@ -808,12 +781,10 @@ $.set = (function() { var items, localItems, set; - items = {}; localItems = {}; set = $.debounce($.SECOND, function() { var err, key, _i, _len, _ref; - _ref = $.localKeys; for (_i = 0, _len = _ref.length; _i < _len; _i++) { key = _ref[_i]; @@ -898,7 +869,6 @@ function Post(root, thread, board, that) { var alt, anchor, capcode, date, email, file, fileInfo, flag, info, name, post, size, subject, thumb, tripcode, uniqueID, unit; - this.thread = thread; this.board = board; if (that == null) { @@ -997,7 +967,6 @@ Post.prototype.parseComment = function() { var bq, data, i, node, nodes, text, _i, _len, _ref; - bq = this.nodes.comment.cloneNode(true); _ref = $$('.abbr, .capcodeReplies, .exif, b', bq); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1015,7 +984,6 @@ Post.prototype.parseQuotes = function() { var hash, pathname, quotelink, quotes, _i, _len, _ref; - quotes = {}; _ref = $$('.quotelink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1045,7 +1013,6 @@ Post.prototype.kill = function(file, now) { var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1; - now || (now = new Date()); if (file) { if (this.file.isDead) { @@ -1094,7 +1061,6 @@ Post.prototype.resurrect = function() { var clone, quotelink, strong, _i, _j, _len, _len1, _ref, _ref1; - delete this.isDead; delete this.timeOfDeath; $.rmClass(this.nodes.root, 'deleted-post'); @@ -1128,7 +1094,6 @@ Post.prototype.rmClone = function(index) { var clone, _i, _len, _ref; - this.clones.splice(index, 1); _ref = this.clones.slice(index); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -1146,7 +1111,6 @@ function Clone(origin, context) { var file, index, info, inline, inlined, key, nodes, post, root, val, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; - this.origin = origin; this.context = context; _ref = ['ID', 'fullID', 'board', 'thread', 'info', 'quotes', 'isReply']; @@ -1235,7 +1199,6 @@ function DataBoard(key, sync) { var init, _this = this; - this.key = key; this.data = Conf[key]; $.sync(key, this.onSync.bind(this)); @@ -1252,7 +1215,6 @@ DataBoard.prototype["delete"] = function(_arg) { var boardID, postID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID; if (postID) { delete this.data.boards[boardID][threadID][postID]; @@ -1273,7 +1235,6 @@ DataBoard.prototype.deleteIfEmpty = function(_arg) { var boardID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID; if (threadID) { if (!Object.keys(this.data.boards[boardID][threadID]).length) { @@ -1289,7 +1250,6 @@ DataBoard.prototype.set = function(_arg) { var boardID, postID, threadID, val, _base, _base1, _base2; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, val = _arg.val; if (postID !== void 0) { ((_base = ((_base1 = this.data.boards)[boardID] || (_base1[boardID] = {})))[threadID] || (_base[threadID] = {}))[postID] = val; @@ -1303,7 +1263,6 @@ DataBoard.prototype.get = function(_arg) { var ID, board, boardID, defaultValue, postID, thread, threadID, val, _i, _len; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID, defaultValue = _arg.defaultValue; if (board = this.data.boards[boardID]) { if (!threadID) { @@ -1327,7 +1286,6 @@ DataBoard.prototype.clean = function() { var boardID, now, val, _ref; - _ref = this.data.boards; for (boardID in _ref) { val = _ref[boardID]; @@ -1347,10 +1305,8 @@ DataBoard.prototype.ajaxClean = function(boardID) { var _this = this; - return $.cache("//api.4chan.org/" + boardID + "/threads.json", function(e) { var board, page, thread, threads, _i, _j, _len, _len1, _ref, _ref1; - if (e.target.status === 404) { _this["delete"](boardID); } else if (e.target.status === 200) { @@ -1461,7 +1417,6 @@ init: function() { var barFixedToggler, barPositionToggler, customNavToggler, editCustomNav, footerToggler, headerToggler, linkJustifyToggler, _this = this; - this.menu = new UI.Menu('header'); this.menuButton = $.el('span', { className: 'menu-button', @@ -1545,7 +1500,6 @@ } $.asap((function() { var _ref; - return $.id('boardNavMobile') || ((_ref = d.readyState) === 'interactive' || _ref === 'complete'); }), Header.setBoardList); $.prepend(d.body, _this.bar); @@ -1554,7 +1508,6 @@ }); return $.ready(function() { var a, cs; - _this.footer = $.id('boardNavDesktopFoot'); if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { a.className = 'current'; @@ -1588,7 +1541,6 @@ }), setBoardList: function() { var a, boardList, btn, fourchannav, fullBoardList; - fourchannav = $.id('boardNavDesktop'); if (a = $("a[href*='/" + g.BOARD + "/']", fourchannav)) { a.className = 'current'; @@ -1610,7 +1562,6 @@ }, generateBoardList: function(text) { var as, list, nodes; - list = $('#custom-board-list', Header.bar); $.rmAll(list); if (!text) { @@ -1619,7 +1570,6 @@ as = $$('#full-board-list a', Header.bar); nodes = text.match(/[\w@]+((-(all|title|replace|full|index|catalog|url:"[^"]+[^"]"|text:"[^"]+")|\,"[^"]+[^"]"))*|[^\w@]+/g).map(function(t) { var a, board, m, _i, _len; - if (/^[^\w@]/.test(t)) { return $.tn(t); } @@ -1666,7 +1616,6 @@ }, toggleBoardList: function() { var bar, custom, full, showBoardList; - bar = Header.bar; custom = $('#custom-board-list', bar); full = $('#full-board-list', bar); @@ -1702,7 +1651,6 @@ }, toggleLinkJustify: function() { var centered; - $.event('CloseMenu'); centered = this.nodeName === 'INPUT' ? this.checked : void 0; Header.setLinkJustify(centered); @@ -1732,7 +1680,6 @@ }, toggleBarVisibility: function(e) { var hide, message; - if (e.type === 'mousedown' && e.button !== 0) { return; } @@ -1749,7 +1696,6 @@ }, toggleFooterVisibility: function() { var hide, message; - $.event('CloseMenu'); hide = this.nodeName === 'INPUT' ? this.checked : !!Header.footer.hidden; Header.setFooterVisibility(hide); @@ -1759,7 +1705,6 @@ }, setCustomNav: function(show) { var btn, cust, full, _ref; - Header.customNavToggler.checked = show; cust = $('#custom-board-list', Header.bar); full = $('#full-board-list', Header.bar); @@ -1772,14 +1717,12 @@ }, editCustomNav: function() { var settings; - Settings.open('Advanced'); settings = $.id('fourchanx-settings'); return $('input[name=boardnav]', settings).focus(); }, hashScroll: function() { var hash, post; - if (!((hash = this.location.hash.slice(1)) && (post = $.id(hash)))) { return; } @@ -1790,7 +1733,6 @@ }, scrollToPost: function(post) { var headRect, top; - top = post.getBoundingClientRect().top; if (Conf['Fixed Header'] && !Conf['Bottom Header']) { headRect = Header.bar.getBoundingClientRect(); @@ -1800,7 +1742,6 @@ }, addShortcut: function(el) { var shortcut; - shortcut = $.el('span', { className: 'shortcut fourchanx-link' }); @@ -1812,7 +1753,6 @@ }, createNotification: function(e) { var cb, content, lifetime, notif, type, _ref; - _ref = e.detail, type = _ref.type, content = _ref.content, lifetime = _ref.lifetime, cb = _ref.cb; notif = new Notification(type, content, lifetime); if (cb) { @@ -1825,7 +1765,6 @@ spoilerRange: {}, shortFilename: function(filename, isReply) { var threshold; - threshold = isReply ? 30 : 40; if (filename.length - 4 > threshold) { return "" + filename.slice(0, threshold - 5) + "(...)." + filename.slice(-3); @@ -1835,7 +1774,6 @@ }, postFromObject: function(data, boardID) { var o; - o = { postID: data.no, threadID: data.resto || data.no, @@ -1879,7 +1817,6 @@ */ var a, boardID, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, spoilerRange, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref; - postID = o.postID, threadID = o.threadID, boardID = o.boardID, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file; isOP = postID === threadID; staticPath = '//static.4chan.org/image/'; @@ -1975,7 +1912,6 @@ Get = { threadExcerpt: function(thread) { var OP, excerpt, _ref; - OP = thread.OP; excerpt = ((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || Conf['Anonymize'] && 'Anonymous' || $('.nameBlock', OP.nodes.info).textContent.trim(); if (excerpt.length > 70) { @@ -1988,7 +1924,6 @@ }, postFromRoot: function(root) { var boardID, index, link, post, postID; - link = $('a[title="Highlight this post"]', root); boardID = link.pathname.split('/')[1]; postID = link.hash.slice(2); @@ -2008,7 +1943,6 @@ }, postDataFromLink: function(link) { var boardID, path, postID, threadID; - if (link.hostname === 'boards.4chan.org') { path = link.pathname.split('/'); boardID = path[1]; @@ -2027,7 +1961,6 @@ }, allQuotelinksLinkingTo: function(post) { var ID, quote, quotedPost, quotelinks, quoterPost, _i, _j, _k, _len, _len1, _len2, _ref, _ref1, _ref2, _ref3; - quotelinks = []; _ref = g.posts; for (ID in _ref) { @@ -2056,14 +1989,12 @@ } return quotelinks.filter(function(quotelink) { var boardID, postID, _ref4; - _ref4 = Get.postDataFromLink(quotelink), boardID = _ref4.boardID, postID = _ref4.postID; return boardID === post.board.ID && postID === post.ID; }); }, postClone: function(boardID, threadID, postID, root, context) { var post, url; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2084,7 +2015,6 @@ }, insert: function(post, root, context) { var clone, nodes; - if (!root.parentNode) { return; } @@ -2098,7 +2028,6 @@ }, fetchedPost: function(req, boardID, threadID, postID, root, context) { var board, post, posts, status, thread, url, _i, _len; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2148,7 +2077,6 @@ }, archivedPost: function(req, boardID, postID, root, context) { var board, bq, comment, data, o, post, thread, threadID, _ref; - if (post = g.posts["" + boardID + "." + postID]) { Get.insert(post, root, context); return; @@ -2242,10 +2170,8 @@ UI = (function() { var Menu, dialog, drag, dragend, dragstart, hover, hoverend, hoverstart, touchend, touchmove; - dialog = function(id, position, html) { var child, el, move, _i, _len, _ref; - el = $.el('div', { className: 'dialog', innerHTML: html, @@ -2285,7 +2211,6 @@ Menu.prototype.makeMenu = function() { var menu; - menu = $.el('div', { className: 'dialog', id: 'menu', @@ -2300,7 +2225,6 @@ Menu.prototype.toggle = function(e, button, data) { var previousButton; - e.preventDefault(); e.stopPropagation(); if (currentMenu) { @@ -2318,7 +2242,6 @@ Menu.prototype.open = function(button, data) { var bLeft, bRect, bTop, bottom, cHeight, cWidth, entry, left, mRect, menu, right, style, top, _i, _len, _ref, _ref1, _ref2; - menu = this.makeMenu(); currentMenu = menu; lastToggledButton = button; @@ -2357,7 +2280,6 @@ Menu.prototype.insertEntry = function(entry, parent, data) { var subEntry, submenu, _i, _len, _ref; - if (typeof entry.open === 'function') { if (!entry.open(data)) { return; @@ -2391,7 +2313,6 @@ Menu.prototype.findNextEntry = function(entry, direction) { var entries; - entries = __slice.call(entry.parentNode.children); entries.sort(function(first, second) { return +(first.style.order || first.style.webkitOrder) - +(second.style.order || second.style.webkitOrder); @@ -2401,7 +2322,6 @@ Menu.prototype.keybinds = function(e) { var entry, next, nextPrev, subEntry, submenu; - entry = $('.focused', currentMenu); while (subEntry = $('.focused', entry)) { entry = subEntry; @@ -2447,7 +2367,6 @@ Menu.prototype.focus = function(entry) { var bottom, cHeight, cWidth, eRect, focused, left, right, sRect, style, submenu, top, _i, _len, _ref, _ref1, _ref2; - while (focused = $.x('parent::*/child::*[contains(@class,"focused")]', entry)) { $.rmClass(focused, 'focused'); } @@ -2475,7 +2394,6 @@ Menu.prototype.addEntry = function(e) { var entry; - entry = e.detail; if (entry.type !== this.type) { return; @@ -2486,7 +2404,6 @@ Menu.prototype.parseEntry = function(entry) { var el, style, subEntries, subEntry, _i, _len; - el = entry.el, subEntries = entry.subEntries; $.addClass(el, 'entry'); $.on(el, 'focus mouseover', (function(e) { @@ -2510,7 +2427,6 @@ })(); dragstart = function(e) { var el, isTouching, o, rect, screenHeight, screenWidth, _ref; - if (e.type === 'mousedown' && e.button !== 0) { return; } @@ -2549,7 +2465,6 @@ }; touchmove = function(e) { var touch, _i, _len, _ref; - _ref = e.changedTouches; for (_i = 0, _len = _ref.length; _i < _len; _i++) { touch = _ref[_i]; @@ -2561,7 +2476,6 @@ }; drag = function(e) { var bottom, clientX, clientY, left, right, style, top; - clientX = e.clientX, clientY = e.clientY; left = clientX - this.dx; left = left < 10 ? 0 : this.width - left < 10 ? null : left / this.screenWidth * 100 + '%'; @@ -2577,7 +2491,6 @@ }; touchend = function(e) { var touch, _i, _len, _ref; - _ref = e.changedTouches; for (_i = 0, _len = _ref.length; _i < _len; _i++) { touch = _ref[_i]; @@ -2599,7 +2512,6 @@ }; hoverstart = function(_arg) { var asapTest, cb, el, endEvents, latestEvent, o, root; - root = _arg.root, el = _arg.el, latestEvent = _arg.latestEvent, endEvents = _arg.endEvents, asapTest = _arg.asapTest, cb = _arg.cb; o = { root: root, @@ -2628,7 +2540,6 @@ }; hover = function(e) { var clientX, clientY, height, left, right, style, top, _ref; - this.latestEvent = e; height = this.el.offsetHeight; clientX = e.clientX, clientY = e.clientY; @@ -2671,7 +2582,6 @@ }, node: function() { var email, name, tripcode, _ref; - if (this.info.capcode || this.isClone) { return; } @@ -2698,7 +2608,6 @@ filters: {}, init: function() { var boards, err, filter, hl, key, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4; - if (g.VIEW === 'catalog' || !Conf['Filter']) { return; } @@ -2735,7 +2644,6 @@ op = ((_ref2 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref2[1] : void 0) || 'yes'; stub = (function() { var _ref3; - switch ((_ref3 = filter.match(/stub:(yes|no)/)) != null ? _ref3[1] : void 0) { case 'yes': return true; @@ -2766,7 +2674,6 @@ }, createFilter: function(regexp, op, stub, hl, top) { var settings, test; - test = typeof regexp === 'string' ? function(value) { return regexp === value; } : function(value) { @@ -2790,7 +2697,6 @@ }, node: function() { var filter, firstThread, key, result, thisThread, value, _i, _len, _ref; - if (this.isClone) { return; } @@ -2902,7 +2808,6 @@ menu: { init: function() { var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) { return; } @@ -2928,7 +2833,6 @@ }, createSubEntry: function(text, type) { var el; - el = $.el('a', { href: 'javascript:;', textContent: text @@ -2939,7 +2843,6 @@ el: el, open: function(post) { var value; - value = Filter[type](post); return value !== false; } @@ -2947,7 +2850,6 @@ }, makeFilter: function() { var re, type, value; - type = this.dataset.type; value = Filter[type](Filter.menu.post); re = ['uniqueID', 'MD5'].contains(type) ? value : value.replace(/\/|\\|\^|\$|\n|\.|\(|\)|\{|\}|\[|\]|\?|\*|\+|\|/g, function(c) { @@ -2962,7 +2864,6 @@ re = ['uniqueID', 'MD5'].contains(type) ? "/" + re + "/" : "/^" + re + "$/"; return $.get(type, Conf[type], function(item) { var save, section, select, ta, tl; - save = item[type]; save = save ? "" + save + "\n" + re : re; $.set(type, save); @@ -2996,7 +2897,6 @@ }, node: function() { var data; - if (!this.isReply || this.isClone) { return; } @@ -3020,7 +2920,6 @@ menu: { init: function() { var apply, div, hideStubLink, makeStub, replies, thisPost; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; } @@ -3091,7 +2990,6 @@ order: 20, open: function(post) { var data; - if (!post.isReply || post.isClone || !post.isHidden) { return false; } @@ -3123,7 +3021,6 @@ order: 15, open: function(post) { var data; - if (!post.isReply || post.isClone || !post.isHidden) { return false; } @@ -3140,7 +3037,6 @@ }, hide: function() { var makeStub, parent, post, replies, thisPost; - parent = this.parentNode; thisPost = $('input[name=thisPost]', parent).checked; replies = $('input[name=replies]', parent).checked; @@ -3159,7 +3055,6 @@ }, show: function() { var data, parent, post, replies, thisPost; - parent = this.parentNode; thisPost = $('input[name=thisPost]', parent).checked; replies = $('input[name=replies]', parent).checked; @@ -3183,7 +3078,6 @@ }, hideStub: function() { var post; - post = PostHiding.menu.post; post.nodes.root.hidden = true; $.event('CloseMenu'); @@ -3191,7 +3085,6 @@ }, makeButton: function(post, type) { var a; - a = $.el('a', { className: "" + type + "-reply-button", innerHTML: " " + (type === 'hide' ? '-' : '+') + " ", @@ -3202,7 +3095,6 @@ }, saveHiddenState: function(post, isHiding, thisPost, makeStub, hideRecursively) { var data; - data = { boardID: post.board.ID, threadID: post.thread.ID, @@ -3221,7 +3113,6 @@ }, toggle: function() { var post; - post = Get.postFromNode(this); if (post.isHidden) { PostHiding.show(post); @@ -3232,7 +3123,6 @@ }, hide: function(post, makeStub, hideRecursively) { var a, postInfo, quotelink, _i, _len, _ref; - if (makeStub == null) { makeStub = Conf['Stubs']; } @@ -3270,7 +3160,6 @@ }, show: function(post, showRecursively) { var quotelink, _i, _len, _ref; - if (showRecursively == null) { showRecursively = Conf['Recursive Hiding']; } @@ -3306,7 +3195,6 @@ }, node: function() { var i, obj, quote, recursive, _i, _j, _len, _len1, _ref, _ref1; - if (this.isClone) { return; } @@ -3324,7 +3212,6 @@ }, add: function() { var args, obj, post, recursive, _base, _name; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; obj = (_base = Recursive.recursives)[_name = post.fullID] || (_base[_name] = { recursives: [], @@ -3335,7 +3222,6 @@ }, rm: function(recursive, post) { var i, obj, rec, _i, _len, _ref; - if (!(obj = Recursive.recursives[post.fullID])) { return; } @@ -3350,7 +3236,6 @@ }, apply: function() { var ID, args, fullID, post, recursive, _ref; - recursive = arguments[0], post = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : []; fullID = post.fullID; _ref = g.posts; @@ -3377,7 +3262,6 @@ }, node: function() { var data; - if (data = ThreadHiding.db.get({ boardID: this.board.ID, threadID: this.ID @@ -3391,7 +3275,6 @@ }, syncCatalog: function() { var hiddenThreads, hiddenThreadsOnCatalog, threadID; - hiddenThreads = ThreadHiding.db.get({ boardID: g.BOARD.ID, defaultValue: {} @@ -3418,7 +3301,6 @@ cleanCatalog: function(hiddenThreadsOnCatalog) { return $.cache("//api.4chan.org/" + g.BOARD + "/threads.json", function() { var page, thread, threads, _i, _j, _len, _len1, _ref, _ref1; - if (this.status !== 200) { return; } @@ -3444,7 +3326,6 @@ menu: { init: function() { var apply, div, hideStubLink, makeStub; - if (g.VIEW !== 'index' || !Conf['Menu'] || !Conf['Thread Hiding Link']) { return; } @@ -3471,7 +3352,6 @@ order: 20, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || thread.isHidden) { return false; @@ -3493,7 +3373,6 @@ order: 15, open: function(_arg) { var isReply, thread; - thread = _arg.thread, isReply = _arg.isReply; if (isReply || !thread.isHidden) { return false; @@ -3504,7 +3383,6 @@ }, hide: function() { var makeStub, thread; - makeStub = $('input', this.parentNode).checked; thread = ThreadHiding.menu.thread; ThreadHiding.hide(thread, makeStub); @@ -3513,7 +3391,6 @@ }, hideStub: function() { var thread; - thread = ThreadHiding.menu.thread; ThreadHiding.hide(thread, false); $.event('CloseMenu'); @@ -3521,7 +3398,6 @@ }, makeButton: function(thread, type) { var a; - a = $.el('a', { className: "" + type + "-thread-button", innerHTML: " " + (type === 'hide' ? '-' : '+') + " ", @@ -3533,7 +3409,6 @@ }, saveHiddenState: function(thread, makeStub) { var hiddenThreadsOnCatalog; - hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem("4chan-hide-t-" + g.BOARD)) || {}; if (thread.isHidden) { ThreadHiding.db.set({ @@ -3566,7 +3441,6 @@ }, hide: function(thread, makeStub) { var OP, a, numReplies, opInfo, span, threadRoot; - if (makeStub == null) { makeStub = Conf['Stubs']; } @@ -3597,7 +3471,6 @@ }, show: function(thread) { var threadRoot; - if (thread.stub) { $.rm(thread.stub); delete thread.stub; @@ -3610,7 +3483,6 @@ QuoteBacklink = { init: function() { var format; - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { return; } @@ -3628,7 +3500,6 @@ }, firstNode: function() { var a, clone, container, containers, frag, link, post, quote, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - if (this.isClone || !this.quotes.length) { return; } @@ -3666,7 +3537,6 @@ }, secondNode: function() { var container; - if (this.isClone && (this.origin.isReply || Conf['OP Backlinks'])) { this.nodes.backlinkContainer = $('.container', this.nodes.info); return; @@ -3680,7 +3550,6 @@ }, getContainer: function(id) { var _base; - return (_base = this.containers)[id] || (_base[id] = $.el('span', { className: 'container' })); @@ -3703,7 +3572,6 @@ }, node: function() { var board, boardID, quotelink, quotelinks, quotes, thread, threadID, _i, _len, _ref, _ref1; - if (this.isClone && this.thread === this.context.thread) { return; } @@ -3739,7 +3607,6 @@ if (Conf['Quote Hash Navigation']) { this.node = function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3752,7 +3619,6 @@ } else { this.node = function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3776,7 +3642,6 @@ }, toggle: function(e) { var boardID, context, postID, threadID, _ref; - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || e.button !== 0) { return; } @@ -3802,7 +3667,6 @@ }, add: function(quotelink, boardID, threadID, postID, context) { var inline, isBacklink, post, qroot, root; - isBacklink = $.hasClass(quotelink, 'backlink'); inline = $.el('div', { id: "i" + postID, @@ -3827,7 +3691,6 @@ }, rm: function(quotelink, boardID, threadID, postID, context) { var el, inlined, isBacklink, post, qroot, root, _ref; - isBacklink = $.hasClass(quotelink, 'backlink'); root = QuoteInline.findRoot(quotelink, isBacklink); root = $.x("following-sibling::div[@id='i" + postID + "'][1]", root); @@ -3869,7 +3732,6 @@ }, node: function() { var boardID, op, postID, quotelink, quotelinks, quotes, _i, _j, _len, _len1, _ref; - if (this.isClone && this.thread === this.context.thread) { return; } @@ -3912,7 +3774,6 @@ }, node: function() { var link, _i, _len, _ref; - _ref = this.nodes.quotelinks.concat(__slice.call(this.nodes.backlinks)); for (_i = 0, _len = _ref.length; _i < _len; _i++) { link = _ref[_i]; @@ -3921,7 +3782,6 @@ }, mouseover: function(e) { var boardID, clone, origin, post, postID, posts, qp, quote, quoterID, threadID, _i, _j, _len, _len1, _ref, _ref1; - if ($.hasClass(this, 'inlined')) { return; } @@ -3965,7 +3825,6 @@ }, mouseout: function() { var clone, post, root, _i, _len, _ref; - if (!(root = this.el.firstElementChild)) { return; } @@ -3995,7 +3854,6 @@ }, node: function() { var boardID, postID, quotelink, _i, _len, _ref, _ref1, _ref2; - if (this.isClone) { return; } @@ -4018,7 +3876,6 @@ QuoteThreading = { init: function() { var input; - if (!(Conf['Quote Threading'] && g.VIEW === 'thread')) { return; } @@ -4041,7 +3898,6 @@ }, setup: function() { var ID, post, posts; - $.off(d, '4chanXInitFinished', QuoteThreading.setup); posts = g.posts; for (ID in posts) { @@ -4054,7 +3910,6 @@ }, node: function() { var ID, fullID, keys, len, post, posts, qid, quote, quotes, uniq, _i, _len; - if (this.isClone || !QuoteThreading.enabled || this.thread.OP === this) { return; } @@ -4084,7 +3939,6 @@ }, nodeinsert: function() { var bottom, height, posts, qpost, qroot, threadContainer, top, _ref; - posts = g.posts; qpost = posts[this.threaded]; delete this.threaded; @@ -4114,14 +3968,12 @@ }, toggle: function() { var container, containers, node, nodes, replies, reply, thread, _i, _j, _len, _len1; - thread = $('.thread'); replies = $$('.thread > .replyContainer, .threadContainer > .replyContainer', thread); QuoteThreading.enabled = this.checked; if (this.checked) { nodes = (function() { var _i, _len, _results; - _results = []; for (_i = 0, _len = replies.length; _i < _len; _i++) { reply = replies[_i]; @@ -4136,7 +3988,6 @@ } else { replies.sort(function(a, b) { var aID, bID; - aID = Number(a.id.slice(2)); bID = Number(b.id.slice(2)); return aID - bID; @@ -4152,7 +4003,6 @@ }, kb: function() { var control; - control = $.id('threadingControl'); return control.click(); } @@ -4179,7 +4029,6 @@ }, node: function() { var quotelink, _i, _len, _ref; - if (this.isClone) { return; } @@ -4215,7 +4064,6 @@ }, node: function() { var deadlink, _i, _len, _ref; - _ref = $$('.deadlink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { deadlink = _ref[_i]; @@ -4230,7 +4078,6 @@ }, parseDeadlink: function(deadlink) { var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; - if (deadlink.parentNode.className === 'prettyprint') { $.replace(deadlink, __slice.call(deadlink.childNodes)); return; @@ -4310,7 +4157,6 @@ cypher: $.el('div'), node: function() { var a, child, cypher, cypherText, data, embed, embedder, embeds, i, index, len, link, links, lookahead, name, next, node, nodes, snapshot, spoiler, text, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2; - if (this.isClone && Conf['Embedding']) { _ref = $$('.embedder', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -4395,7 +4241,6 @@ }, toggle: function() { var el, embed, style, type, url; - embed = this.previousElementSibling; if (this.className.contains("embedded")) { el = $.el('a', { @@ -4489,7 +4334,6 @@ style: 'height: auto; width: 500px; display: inline-block;', el: function() { var div; - div = $.el('div', { className: "soundcloud", name: "soundcloud" @@ -4515,7 +4359,6 @@ regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/, el: function() { var div; - return div = $.el('iframe', { src: "http://pastebin.com/embed_iframe.php?i=" + this.name }); @@ -4525,7 +4368,6 @@ regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/, el: function() { var div; - return div = $.el('iframe', { src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js" }); @@ -4536,7 +4378,6 @@ }, text: function() { var file, response; - response = JSON.parse(this.responseText).files; for (file in response) { if (response.hasOwnProperty(file)) { @@ -4557,14 +4398,12 @@ }, embedder: function(a) { var callbacks, embed, key, match, service, titles, type, _ref; - if (!Conf['Link Title']) { return [a]; } titles = {}; callbacks = function() { var title; - return a.textContent = (function() { switch (this.status) { case 200: @@ -4606,7 +4445,6 @@ if (Conf['Link Title'] && (service = type.title)) { $.get('CachedTitles', {}, function(item) { var err, title; - titles = item['CachedTitles']; if (title = titles[match[1]]) { a.textContent = title[0]; @@ -4630,7 +4468,6 @@ QR = { init: function() { var sc; - if (!Conf['Quick Reply']) { return; } @@ -4677,7 +4514,6 @@ }, initReady: function() { var link; - QR.postingIsEnabled = !!$.id('postForm'); if (!QR.postingIsEnabled) { return; @@ -4697,13 +4533,11 @@ $.before($.id('postForm'), link); $.on(d, 'QRGetSelectedPost', function(_arg) { var cb; - cb = _arg.detail; return cb(QR.selected); }); $.on(d, 'QRAddPreSubmitHook', function(_arg) { var cb; - cb = _arg.detail; return QR.preSubmitHooks.push(cb); }); @@ -4733,7 +4567,6 @@ }, open: function() { var err; - if (QR.nodes) { QR.nodes.el.hidden = false; QR.unhide(); @@ -4752,7 +4585,6 @@ }, close: function() { var i, _i, _len, _ref; - if (QR.req) { QR.abort(); return; @@ -4799,7 +4631,6 @@ }, error: function(err) { var el; - QR.open(); if (typeof err === 'string') { el = $.tn(err); @@ -4827,7 +4658,6 @@ notifications: [], cleanNotifications: function() { var notification, _i, _len, _ref; - _ref = QR.notifications; for (_i = 0, _len = _ref.length; _i < _len; _i++) { notification = _ref[_i]; @@ -4837,7 +4667,6 @@ }, status: function() { var disabled, status, value; - if (!QR.nodes) { return; } @@ -4858,7 +4687,6 @@ QR.persona.getPassword(); return $.get('QR.personas', Conf['QR.personas'], function(_arg) { var arr, item, personas, type, types, _i, _len, _ref; - personas = _arg['QR.personas']; types = { name: [], @@ -4878,7 +4706,6 @@ }, parseItem: function(item, types) { var boards, match, type, val, _ref, _ref1; - if (item[0] === '#') { return; } @@ -4907,7 +4734,6 @@ }, loadPersonas: function(type, arr) { var list, val, _i, _len; - list = $("#list-" + type, QR.nodes.el); for (_i = 0, _len = arr.length; _i < _len; _i++) { val = arr[_i]; @@ -4921,7 +4747,6 @@ }, getPassword: function() { var input, m; - if (!QR.persona.pwd) { QR.persona.pwd = (m = d.cookie.match(/4chan_pass=([^;]+)/)) ? decodeURIComponent(m[1]) : (input = $.id('postPassword')) ? input.value : $.id('delPassword').value; } @@ -4930,7 +4755,6 @@ get: function(cb) { return $.get('QR.persona', {}, function(_arg) { var persona; - persona = _arg['QR.persona']; return cb(persona); }); @@ -4938,7 +4762,6 @@ set: function(post) { return $.get('QR.persona', {}, function(_arg) { var persona; - persona = _arg['QR.persona']; persona = { name: post.name, @@ -4952,7 +4775,6 @@ cooldown: { init: function() { var board; - if (!Conf['Cooldown']) { return; } @@ -4994,7 +4816,6 @@ }, sync: function(cooldowns) { var id; - for (id in cooldowns) { QR.cooldown.cooldowns[id] = cooldowns[id]; } @@ -5002,7 +4823,6 @@ }, set: function(data) { var cooldown, delay, hasFile, isReply, isSage, post, req, start, type, upSpd; - if (!Conf['Cooldown']) { return; } @@ -5042,7 +4862,6 @@ }, count: function() { var cooldown, cooldowns, elapsed, hasFile, isReply, isSage, now, post, seconds, start, type, types, upSpd, upSpdAccuracy, update, _ref; - if (!Object.keys(QR.cooldown.cooldowns).length) { $["delete"]("" + g.BOARD + ".cooldown"); delete QR.cooldown.isCounting; @@ -5096,7 +4915,6 @@ }, quote: function(e) { var OP, caretPos, com, index, post, range, s, sel, selectionRoot, text, thread, _ref; - if (e != null) { e.preventDefault(); } @@ -5136,7 +4954,6 @@ }, characterCount: function() { var count, counter; - counter = QR.nodes.charCount; count = QR.nodes.com.textLength; counter.textContent = count; @@ -5145,7 +4962,6 @@ }, drag: function(e) { var toggle; - toggle = e.type === 'dragstart' ? $.off : $.on; toggle(d, 'dragover', QR.dragOver); return toggle(d, 'drop', QR.dropFile); @@ -5165,7 +4981,6 @@ }, paste: function(e) { var blob, files, item, _i, _len, _ref; - files = []; _ref = e.clipboardData.items; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -5193,7 +5008,6 @@ }, fileInput: function(files) { var file, length, max, post, _i, _len; - if (this instanceof Element) { files = __slice.call(this.files); QR.nodes.fileInput.value = null; @@ -5242,7 +5056,6 @@ function _Class(select) { var el, event, prev, _i, _len, _ref, _this = this; - el = $.el('a', { className: 'qr-preview', draggable: true, @@ -5296,7 +5109,6 @@ _Class.prototype.rm = function() { var index; - $.rm(this.nodes.el); index = QR.posts.indexOf(this); if (QR.posts.length === 1) { @@ -5314,7 +5126,6 @@ _Class.prototype.lock = function(lock) { var name, _i, _len, _ref; - if (lock == null) { lock = true; } @@ -5339,7 +5150,6 @@ _Class.prototype.select = function() { var rectEl, rectList; - if (QR.selected) { QR.selected.nodes.el.id = null; QR.selected.forceSave(); @@ -5356,7 +5166,6 @@ _Class.prototype.load = function() { var name, _i, _len, _ref; - _ref = ['thread', 'name', 'email', 'sub', 'com']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { name = _ref[_i]; @@ -5368,7 +5177,6 @@ _Class.prototype.save = function(input) { var value, _ref; - if (input.type === 'checkbox') { this.spoiler = input.checked; return; @@ -5387,7 +5195,6 @@ _Class.prototype.forceSave = function() { var name, _i, _len, _ref; - if (this !== QR.selected) { return; } @@ -5419,7 +5226,6 @@ _Class.prototype.setThumbnail = function(fileURL) { var img, reader, _this = this; - if (!window.URL) { if (!fileURL) { reader = new FileReader(); @@ -5435,7 +5241,6 @@ img = $.el('img'); img.onload = function() { var applyBlob, cv, data, height, i, l, s, ui8a, width, _i; - s = 90 * 2; if (_this.file.type === 'image/gif') { s *= 3; @@ -5515,11 +5320,9 @@ _Class.prototype.pasteText = function(file) { var reader, _this = this; - reader = new FileReader(); reader.onload = function(e) { var text; - text = e.target.result; if (_this.com) { _this.com += "\n" + text; @@ -5557,7 +5360,6 @@ _Class.prototype.drop = function() { var el, index, newIndex, oldIndex, post; - el = $('.drag', this.parentNode); $.rmClass(el, 'drag'); $.rmClass(this, 'over'); @@ -5592,7 +5394,6 @@ ready: function() { var imgContainer, input, observer, setLifetime, _this = this; - setLifetime = function(e) { return _this.lifetime = e.detail; }; @@ -5634,7 +5435,6 @@ }); $.get('captchas', [], function(_arg) { var captchas; - captchas = _arg.captchas; return _this.sync(captchas); }); @@ -5649,7 +5449,6 @@ }, getOne: function() { var captcha, challenge, response; - this.clear(); if (captcha = this.captchas.shift()) { challenge = captcha.challenge, response = captcha.response; @@ -5674,7 +5473,6 @@ }, save: function() { var response; - if (!(response = this.nodes.input.value.trim())) { return; } @@ -5689,7 +5487,6 @@ }, clear: function() { var captcha, i, now, _i, _len, _ref; - now = Date.now(); _ref = this.captchas; for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { @@ -5707,7 +5504,6 @@ }, load: function() { var challenge; - if (!this.nodes.challenge.firstChild) { return; } @@ -5720,7 +5516,6 @@ }, count: function() { var count; - count = this.captchas.length; this.nodes.input.placeholder = (function() { switch (count) { @@ -5753,7 +5548,6 @@ }, dialog: function() { var dialog, mimeTypes, name, nodes, thread, _i, _len, _ref; - dialog = UI.dialog('qr', 'top:0;right:0;', "
×
No selected file×+
"); QR.nodes = nodes = { el: dialog, @@ -5856,7 +5650,6 @@ preSubmitHooks: [], submit: function(e) { var callbacks, challenge, err, filetag, hook, opts, post, postData, response, textOnly, thread, threadID, _i, _len, _ref, _ref1; - if (e != null) { e.preventDefault(); } @@ -5969,7 +5762,6 @@ }, response: function() { var URL, ban, board, err, h1, isReply, m, post, postID, req, threadID, tmpDoc, _, _ref, _ref1; - req = QR.req; delete QR.req; post = QR.posts[0]; @@ -6072,7 +5864,6 @@ FappeTyme = { init: function() { var el, input; - if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { return; } @@ -6124,7 +5915,6 @@ }, node: function() { var thumb, _ref; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6149,7 +5939,6 @@ }, toggleAll: function() { var ID, file, func, post, _i, _len, _ref, _ref1; - $.event('CloseMenu'); if (ImageExpand.on = $.hasClass(ImageExpand.EAI, 'expand-all-shortcut')) { ImageExpand.EAI.className = 'contract-all-shortcut'; @@ -6183,7 +5972,6 @@ }, toggle: function(post) { var headRect, node, rect, root, thumb, top; - thumb = post.file.thumb; if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) { ImageExpand.expand(post); @@ -6228,7 +6016,6 @@ }, expand: function(post, src) { var img, thumb; - thumb = post.file.thumb; if (post.isHidden || post.file.isExpanded || $.hasClass(thumb, 'expanding')) { return; @@ -6256,7 +6043,6 @@ }, completeExpand: function(post) { var prev, thumb; - thumb = post.file.thumb; if (!$.hasClass(thumb, 'expanding')) { return; @@ -6270,7 +6056,6 @@ prev = post.nodes.root.getBoundingClientRect(); return $.queueTask(function() { var curr, root; - $.addClass(post.nodes.root, 'expanded-image'); $.rmClass(post.file.thumb, 'expanding'); if (!(prev.top + prev.height <= 0)) { @@ -6283,7 +6068,6 @@ }, error: function() { var URL, post, src, timeoutID; - post = Get.postFromNode(this); $.rm(this); delete post.file.fullImage; @@ -6309,7 +6093,6 @@ return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { onload: function() { var postObj, _i, _len, _ref; - if (this.status !== 200) { return; } @@ -6333,7 +6116,6 @@ menu: { init: function() { var conf, createSubEntry, el, key, subEntries, _ref; - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { return; } @@ -6357,7 +6139,6 @@ }, createSubEntry: function(type, config) { var input, label; - label = $.el('label', { innerHTML: " " + type }); @@ -6393,7 +6174,6 @@ }, node: function() { var _ref; - if (!((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6401,7 +6181,6 @@ }, mouseover: function(e) { var el, post; - post = Get.postFromNode(this); el = $.el('img', { id: 'ihover', @@ -6423,7 +6202,6 @@ error: function() { var URL, post, src, timeoutID, _this = this; - if (!doc.contains(this)) { return; } @@ -6448,7 +6226,6 @@ return $.ajax("//api.4chan.org/" + post.board + "/res/" + post.thread + ".json", { onload: function() { var postObj, _i, _len, _ref; - if (this.status !== 200) { return; } @@ -6474,7 +6251,6 @@ ImageLoader = { init: function() { var prefetch; - if (g.VIEW === 'catalog') { return; } @@ -6501,7 +6277,6 @@ }, node: function() { var URL, img, string, style, thumb, type, _ref, _ref1; - if (this.isClone || this.isHidden || this.thread.isHidden || !((_ref = this.file) != null ? _ref.isImage : void 0)) { return; } @@ -6523,7 +6298,6 @@ }, toggle: function() { var enabled, id, post, _ref; - enabled = Conf['prefetch'] = this.checked; if (enabled) { _ref = g.threads["" + g.BOARD.ID + "." + g.THREADID].posts; @@ -6547,7 +6321,6 @@ }, node: function() { var thumb, _ref; - if (this.isClone || !((_ref = this.file) != null ? _ref.isSpoiler : void 0)) { return; } @@ -6560,7 +6333,6 @@ ArchiveLink = { init: function() { var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { return; } @@ -6573,7 +6345,6 @@ order: 90, open: function(_arg) { var ID, board, thread; - ID = _arg.ID, thread = _arg.thread, board = _arg.board; return !!Redirect.to('thread', { postID: ID, @@ -6592,14 +6363,12 @@ }, createSubEntry: function(text, type) { var el, open; - el = $.el('a', { textContent: text, target: '_blank' }); open = type === 'post' ? function(_arg) { var ID, board, thread; - ID = _arg.ID, thread = _arg.thread, board = _arg.board; el.href = Redirect.to('thread', { postID: ID, @@ -6609,7 +6378,6 @@ return true; } : function(post) { var value; - value = Filter[type](post); if (!value) { return false; @@ -6632,7 +6400,6 @@ DeleteLink = { init: function() { var div, fileEl, fileEntry, postEl, postEntry; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { return; } @@ -6660,7 +6427,6 @@ el: fileEl, open: function(_arg) { var file; - file = _arg.file; if (!file || file.isDead) { return false; @@ -6676,7 +6442,6 @@ order: 40, open: function(post) { var node; - if (post.isDead || post.board.ID === 'q') { return false; } @@ -6691,7 +6456,6 @@ }, "delete": function() { var fileOnly, form, link, post; - post = DeleteLink.post; if (DeleteLink.cooldown.counting === post) { return; @@ -6720,7 +6484,6 @@ }, load: function(link, post, fileOnly, html) { var msg, s, tmpDoc; - tmpDoc = d.implementation.createHTMLDocument(''); tmpDoc.documentElement.innerHTML = html; if (tmpDoc.title === '4chan - Banned') { @@ -6743,7 +6506,6 @@ cooldown: { start: function(post, node) { var length, seconds, _ref; - if (!((_ref = QR.db) != null ? _ref.get({ boardID: post.board.ID, threadID: post.thread.ID, @@ -6777,7 +6539,6 @@ DownloadLink = { init: function() { var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { return; } @@ -6791,7 +6552,6 @@ order: 100, open: function(_arg) { var file; - file = _arg.file; if (!file) { return false; @@ -6817,7 +6577,6 @@ }, node: function() { var button; - button = Menu.makeButton(this); if (this.isClone) { $.replace($('.menu-button', this.nodes.info), button); @@ -6827,11 +6586,9 @@ }, makeButton: (function() { var a; - a = null; return function(post) { var clone; - a || (a = $.el('a', { className: 'menu-button fourchanx-link', innerHTML: '', @@ -6848,7 +6605,6 @@ })(), toggle: function(e) { var post; - post = this.dataset.clone ? Get.postFromNode(this) : g.posts[this.dataset.postid]; return Menu.menu.toggle(e, this, post); } @@ -6857,7 +6613,6 @@ ReportLink = { init: function() { var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { return; } @@ -6879,7 +6634,6 @@ }, report: function() { var id, post, set, url; - post = ReportLink.post; url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; id = Date.now(); @@ -6892,7 +6646,6 @@ init: function() { return $.ready(function() { var href; - Favicon.el = $('link[rel="shortcut icon"]', d.head); Favicon.el.type = 'image/x-icon'; href = Favicon.el.href; @@ -6965,7 +6718,6 @@ init: function() { var sc, _this = this; - if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { return; } @@ -6995,7 +6747,6 @@ }, node: function() { var ID, fileCount, post, postCount, _ref; - postCount = 0; fileCount = 0; _ref = this.posts; @@ -7013,7 +6764,6 @@ }, onUpdate: function(e) { var fileCount, postCount, _ref; - if (e.detail[404]) { return; } @@ -7022,7 +6772,6 @@ }, update: function(postCount, fileCount) { var fileCountEl, postCountEl, thread; - thread = ThreadStats.thread, postCountEl = ThreadStats.postCountEl, fileCountEl = ThreadStats.fileCountEl; postCountEl.textContent = postCount; fileCountEl.textContent = fileCount; @@ -7049,7 +6798,6 @@ }, onThreadsLoad: function() { var page, pages, thread, _i, _j, _len, _len1, _ref; - if (!Conf["Page Count in Stats"]) { return; } @@ -7077,7 +6825,6 @@ init: function() { var checked, conf, el, input, name, sc, settings, subEntries, _ref, _this = this; - if (g.VIEW !== 'thread' || !Conf['Thread Updater']) { return; } @@ -7228,7 +6975,6 @@ }, interval: function() { var val; - val = +this.value; if (val < 1) { val = 1; @@ -7238,7 +6984,6 @@ }, load: function() { var klass, req, text, _ref; - req = ThreadUpdater.req; switch (req.status) { case 200: @@ -7282,7 +7027,6 @@ }, getInterval: function() { var i, j; - i = ThreadUpdater.interval; j = Math.min(ThreadUpdater.outdateCount, 10); if (!d.hidden) { @@ -7292,14 +7036,12 @@ }, intervalShortcut: function() { var settings; - Settings.open('Advanced'); settings = $.id('fourchanx-settings'); return $('input[name=Interval]', settings).focus(); }, set: function(name, text, klass) { var el, node; - el = ThreadUpdater[name]; if (node = el.firstChild) { node.data = text; @@ -7312,7 +7054,6 @@ }, timeout: function() { var n; - ThreadUpdater.timeoutID = setTimeout(ThreadUpdater.timeout, 1000); if (!(n = --ThreadUpdater.seconds)) { return ThreadUpdater.update(); @@ -7325,7 +7066,6 @@ }, update: function() { var url; - if (!ThreadUpdater.online) { return; } @@ -7350,7 +7090,6 @@ }, updateThreadStatus: function(title, OP) { var icon, message, root, titleLC; - titleLC = title.toLowerCase(); if (ThreadUpdater.thread["is" + title] === !!OP[titleLC]) { return; @@ -7377,7 +7116,6 @@ }, parse: function(postObjects) { var ID, OP, count, deletedFiles, deletedPosts, files, index, key, node, num, post, postObject, posts, root, scroll, _i, _len, _ref; - OP = postObjects[0]; Build.spoilerRange[ThreadUpdater.thread.board] = OP.custom_spoiler; ThreadUpdater.updateThreadStatus('Sticky', OP); @@ -7463,7 +7201,6 @@ } $.queueTask(function() { var length, threadID; - threadID = ThreadUpdater.thread.ID; length = $$('.thread > .postContainer', ThreadUpdater.root).length; return Fourchan.parseThread(threadID, length - count, length); @@ -7484,7 +7221,6 @@ ThreadWatcher = { init: function() { var sc; - if (!Conf['Thread Watcher']) { return; } @@ -7518,7 +7254,6 @@ node: function() { var favicon, _this = this; - favicon = $.el('a', { className: 'watch-thread-link', href: 'javascript:;' @@ -7538,7 +7273,6 @@ }, refresh: function(watched) { var ID, board, div, favicon, id, link, nodes, props, thread, x, _ref, _ref1; - if (!watched) { $.get('WatchedThreads', {}, function(item) { return ThreadWatcher.refresh(item['WatchedThreads']); @@ -7587,13 +7321,11 @@ }, x: function() { var thread; - thread = this.nextElementSibling.pathname.split('/'); return ThreadWatcher.unwatch(thread[1], thread[3]); }, post: function(e) { var board, postID, threadID, _ref; - _ref = e.detail, board = _ref.board, postID = _ref.postID, threadID = _ref.threadID; if (postID === threadID) { if (Conf['Auto Watch']) { @@ -7614,7 +7346,6 @@ unwatch: function(board, threadID) { return $.get('WatchedThreads', {}, function(item) { var watched; - watched = item['WatchedThreads']; delete watched[board][threadID]; if (!Object.keys(watched[board]).length) { @@ -7627,7 +7358,6 @@ watch: function(thread) { return $.get('WatchedThreads', {}, function(item) { var watched, _name; - watched = item['WatchedThreads']; watched[_name = thread.board] || (watched[_name] = {}); watched[thread.board][thread] = { @@ -7673,7 +7403,6 @@ }, ready: function() { var ID, post, posts, _ref; - $.off(d, '4chanXInitFinished', Unread.ready); posts = []; _ref = Unread.thread.posts; @@ -7690,7 +7419,6 @@ }, scroll: function() { var checkPosition, hash, onload, post, posts, prevID, root; - if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { return; } @@ -7722,7 +7450,6 @@ } checkPosition = function(target) { var height, top, _ref; - _ref = target.getBoundingClientRect(), top = _ref.top, height = _ref.height; return top + height - doc.clientHeight > 0; }; @@ -7730,7 +7457,6 @@ }, sync: function() { var lastReadPost; - lastReadPost = Unread.db.get({ boardID: Unread.thread.board.ID, threadID: Unread.thread.ID, @@ -7747,7 +7473,6 @@ }, addPosts: function(posts) { var ID, data, post, _i, _len, _ref; - for (_i = 0, _len = posts.length; _i < _len; _i++) { post = posts[_i]; ID = post.ID; @@ -7775,7 +7500,6 @@ }, addPostQuotingYou: function(post) { var quotelink, _i, _len, _ref; - if (!QR.db) { return; } @@ -7796,7 +7520,6 @@ }, readSinglePost: function(post) { var i; - if ((i = Unread.posts.indexOf(post)) === -1) { return; } @@ -7812,7 +7535,6 @@ }, readArray: function(arr) { var i, post, _i, _len; - for (i = _i = 0, _len = arr.length; _i < _len; i = ++_i) { post = arr[i]; if (post.ID > Unread.lastReadPost) { @@ -7823,7 +7545,6 @@ }, read: $.debounce(50, function(e) { var ID, bottom, height, i, post, posts, read; - if (d.hidden || !Unread.posts.length) { return; } @@ -7857,7 +7578,6 @@ }), setLine: function(force) { var post, root; - if (!(d.hidden || force === true)) { return; } @@ -7872,7 +7592,6 @@ }, update: function(dontrepeat) { var count; - count = Unread.posts.length; if (Conf['Unread Count']) { d.title = "" + (Conf['Quoted Title'] && Unread.postsQuotingYou.length ? '(!) ' : '') + (count || !Conf['Hide Unread Count at (0)'] ? "(" + count + ") " : '') + (g.DEAD ? "/" + g.BOARD + "/ - 404" : "" + Unread.title); @@ -7896,7 +7615,6 @@ file: {}, init: function() { var archive, arr, boardID, data, id, name, type, _i, _len, _ref, _ref1, _ref2, _ref3; - _ref = Conf['selectedArchives']; for (boardID in _ref) { data = _ref[boardID]; @@ -7939,7 +7657,7 @@ 'http': false, 'https': true, 'software': 'foolfuuka', - 'boards': ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vg', 'vp', 'vr', 'wsg'], + 'boards': ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg'], 'files': ['a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg'] }, 'NSFW Foolz': { @@ -7981,6 +7699,14 @@ 'boards': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv'], 'files': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv'] }, + 'World Athletic Project': { + 'domain': 'fuuka.worldathleticproject.org', + 'http': true, + 'https': false, + 'software': 'foolfuuka', + 'boards': ['e', 'h', 'p', 's', 'u'], + 'files': ['e', 'h', 'p', 's', 'u'] + }, 'Install Gentoo': { 'domain': 'archive.installgentoo.net', 'http': false, @@ -8007,7 +7733,6 @@ }, to: function(dest, data) { var archive; - archive = (dest === 'search' ? Redirect.thread : Redirect[dest])[data.boardID]; if (!archive) { return ''; @@ -8016,7 +7741,6 @@ }, protocol: function(archive) { var protocol; - protocol = location.protocol; if (!archive[protocol.slice(0, -1)]) { protocol = protocol === 'https:' ? 'http:' : 'https:'; @@ -8025,7 +7749,6 @@ }, thread: function(archive, _arg) { var boardID, path, postID, threadID; - boardID = _arg.boardID, threadID = _arg.threadID, postID = _arg.postID; path = threadID ? "" + boardID + "/thread/" + threadID : "" + boardID + "/post/" + postID; if (archive.software === 'foolfuuka') { @@ -8038,7 +7761,6 @@ }, post: function(archive, _arg) { var boardID, postID, protocol; - boardID = _arg.boardID, postID = _arg.postID; protocol = Redirect.protocol(archive); if (['Foolz', 'NSFW Foolz'].contains(archive.name)) { @@ -8048,13 +7770,11 @@ }, file: function(archive, _arg) { var boardID, filename; - boardID = _arg.boardID, filename = _arg.filename; return "" + (Redirect.protocol(archive)) + archive.domain + "/" + boardID + "/full_image/" + filename; }, search: function(archive, _arg) { var boardID, path, type, value; - boardID = _arg.boardID, type = _arg.type, value = _arg.value; type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; value = encodeURIComponent(value); @@ -8073,7 +7793,6 @@ }, setup: function() { var btn, entry, psa; - $.off(d, '4chanXInitFinished', PSAHiding.setup); if (!(psa = $.id('globalMessage'))) { $.rmClass(doc, 'hide-announcement'); @@ -8102,7 +7821,6 @@ $.on(btn, 'click', PSAHiding.toggle); $.get('hiddenPSA', 0, function(_arg) { var hiddenPSA; - hiddenPSA = _arg.hiddenPSA; PSAHiding.sync(hiddenPSA); $.before(psa, btn); @@ -8112,7 +7830,6 @@ }, toggle: function(e) { var UTC; - if ($.hasClass(this, 'hide-announcement')) { UTC = +$.id('globalMessage').dataset.utc; $.set('hiddenPSA', UTC); @@ -8124,7 +7841,6 @@ }, sync: function(UTC) { var hr, psa; - psa = $.id('globalMessage'); psa.hidden = PSAHiding.btn.hidden = UTC && UTC >= +psa.dataset.utc ? true : false; if ((hr = psa.nextElementSibling) && hr.nodeName === 'HR') { @@ -8136,7 +7852,6 @@ CatalogLinks = { init: function() { var el, input; - if (!Conf['Catalog Links']) { return; } @@ -8160,14 +7875,12 @@ }, toggle: function() { var useCatalog; - $.event('CloseMenu'); $.set('Header catalog links', useCatalog = this.checked); return CatalogLinks.set(useCatalog); }, set: function(useCatalog) { var a, board, path, _i, _len, _ref; - path = useCatalog ? 'catalog' : ''; _ref = $$("#board-list a[href*=\"boards.4chan.org\"]:not(.catalog),\n#boardNavDesktopFoot a[href*=\"boards.4chan.org\"]"); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -8201,7 +7914,6 @@ }, node: function(post) { var str, uid; - if (!(uid = $('.hand', this.nodes.uniqueID))) { return; } @@ -8213,7 +7925,6 @@ ids: {}, compute: function(str) { var hash, rgb; - hash = this.hash(str); rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF]; rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125; @@ -8222,13 +7933,11 @@ }, apply: function() { var rgb; - rgb = IDColor.ids[this] || IDColor.compute(this); return ("background-color: rgb(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "); color: ") + (rgb[3] ? "black; border-radius: 3px; padding: 0px 2px;" : "white; border-radius: 3px; padding: 0px 2px;"); }, hash: function(str) { var i, j, msg; - msg = 0; i = 0; j = str.length; @@ -8267,7 +7976,6 @@ Emoji = { init: function() { var css, icon, name, pos, _ref; - if (!Conf['Emoji']) { return; } @@ -8337,7 +8045,6 @@ }, node: function() { var a; - if (a = $('.abbr > a:not([onclick])', this.nodes.comment)) { return $.on(a, 'click', ExpandComment.cb); } @@ -8345,14 +8052,12 @@ callbacks: [], cb: function(e) { var post; - e.preventDefault(); post = Get.postFromNode(this); return ExpandComment.expand(post); }, expand: function(post) { var a; - if (post.nodes.longComment && !post.nodes.longComment.parentNode) { $.replace(post.nodes.shortComment, post.nodes.longComment); post.nodes.comment = post.nodes.longComment; @@ -8368,7 +8073,6 @@ }, contract: function(post) { var a; - if (!post.nodes.shortComment) { return; } @@ -8379,7 +8083,6 @@ }, parse: function(req, a, post) { var callback, clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - status = req.status; if (![200, 304].contains(status)) { a.textContent = "Error " + req.statusText + " (" + status + ")"; @@ -8436,7 +8139,6 @@ }, node: function() { var a, span; - if (!(span = $('.summary', this.OP.nodes.root.parentNode))) { return; } @@ -8450,13 +8152,11 @@ }, cbToggle: function() { var op; - op = Get.postFromRoot(this.previousElementSibling); return ExpandThread.toggle(op.thread); }, toggle: function(thread) { var a, inlined, num, post, replies, reply, threadRoot, _i, _j, _k, _len, _len1, _len2, _ref, _ref1; - threadRoot = thread.OP.nodes.root.parentNode; a = $('.summary', threadRoot); switch (thread.isExpanded) { @@ -8525,7 +8225,6 @@ }, parse: function(req, thread, a) { var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len; - if (a.textContent[0] === '+') { return; } @@ -8583,7 +8282,6 @@ }, createFunc: function(format) { var code; - code = format.replace(/%(.)/g, function(s, c) { if (c in FileInfo.formatters) { return "' + FileInfo.formatters." + c + ".call(post) + '"; @@ -8595,7 +8293,6 @@ }, convertUnit: function(size, unit) { var i; - if (unit === 'B') { return "" + (size.toFixed()) + " Bytes"; } @@ -8626,7 +8323,6 @@ }, n: function() { var fullname, shortname; - fullname = this.file.name; shortname = Build.shortFilename(this.file.name, this.isReply); if (fullname === shortname) { @@ -8670,7 +8366,6 @@ Fourchan = { init: function() { var board; - if (g.VIEW === 'catalog') { return; } @@ -8692,7 +8387,6 @@ }, code: function() { var pre, _i, _len, _ref; - if (this.isClone) { return; } @@ -8722,13 +8416,11 @@ Keybinds = { init: function() { var init; - if (g.VIEW === 'catalog' || !Conf['Keybinds']) { return; } init = function() { var node, _i, _len, _ref; - $.off(d, '4chanXInitFinished', init); $.on(d, 'keydown', Keybinds.keydown); _ref = $$('[accesskey]'); @@ -8741,7 +8433,6 @@ }, keydown: function(e) { var form, key, notification, notifications, op, target, thread, threadRoot, _i, _len; - if (!(key = Keybinds.keyCode(e))) { return; } @@ -8916,7 +8607,6 @@ }, keyCode: function(e) { var kc, key; - key = (function() { switch (kc = e.keyCode) { case 8: @@ -8972,7 +8662,6 @@ }, tags: function(tag, ta) { var range, selEnd, selStart, value; - value = ta.value; selStart = ta.selectionStart; selEnd = ta.selectionEnd; @@ -8983,13 +8672,11 @@ }, sage: function() { var isSage; - isSage = /sage/i.test(QR.nodes.email.value); return QR.nodes.email.value = isSage ? "" : "sage"; }, img: function(thread, all) { var post; - if (all) { return ImageExpand.cb.toggleAll(); } else { @@ -8999,7 +8686,6 @@ }, open: function(thread, tab) { var url; - if (g.VIEW !== 'index') { return; } @@ -9012,7 +8698,6 @@ }, hl: function(delta, thread) { var axe, headRect, next, postEl, rect, replies, reply, root, topMargin, _i, _len; - if (!delta) { if (postEl = $('.reply.highlight', thread)) { $.rmClass(postEl, 'highlight'); @@ -9072,7 +8757,6 @@ Nav = { init: function() { var append, next, prev, span; - switch (g.VIEW) { case 'index': if (!Conf['Index Navigation']) { @@ -9123,7 +8807,6 @@ }, getThread: function(full) { var headRect, i, rect, thread, threads, topMargin, _i, _len; - if (Conf['Bottom header'] || !Conf['Fixed Header']) { topMargin = 0; } else { @@ -9149,7 +8832,6 @@ }, scroll: function(delta) { var i, rect, thread, threads, top, topMargin, _ref, _ref1; - _ref = Nav.getThread(true), threads = _ref[0], thread = _ref[1], i = _ref[2], rect = _ref[3], topMargin = _ref[4]; top = rect.top - topMargin; if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) { @@ -9175,7 +8857,6 @@ }, node: function() { var dateEl; - if (this.isClone) { return; } @@ -9185,7 +8866,6 @@ }, relative: function(diff, now, date) { var days, months, number, rounded, unit, years; - unit = (number = diff / $.DAY) >= 1 ? (years = now.getYear() - date.getYear(), months = now.getMonth() - date.getMonth(), days = now.getDate() - date.getDate(), years > 1 ? (number = years - (months < 0 || months === 0 && days < 0), 'year') : years === 1 && (months > 0 || months === 0 && days >= 0) ? (number = years, 'year') : (months = (months + 12) % 12) > 1 ? (number = months - (days < 0), 'month') : months === 1 && days >= 0 ? (number = months, 'month') : 'day') : (number = diff / $.HOUR) >= 1 ? 'hour' : (number = diff / $.MINUTE) >= 1 ? 'minute' : (number = Math.max(0, diff) / $.SECOND, 'second'); rounded = Math.round(number); if (rounded !== 1) { @@ -9196,7 +8876,6 @@ stale: [], flush: function() { var now, update, _i, _len, _ref; - if (d.hidden) { return; } @@ -9212,16 +8891,13 @@ }, setUpdate: function(post) { var markStale, setOwnTimeout, update; - setOwnTimeout = function(diff) { var delay; - delay = diff < $.MINUTE ? $.SECOND - (diff + $.SECOND / 2) % $.SECOND : diff < $.HOUR ? $.MINUTE - (diff + $.MINUTE / 2) % $.MINUTE : diff < $.DAY ? $.HOUR - (diff + $.HOUR / 2) % $.HOUR : $.DAY - (diff + $.DAY / 2) % $.DAY; return setTimeout(markStale, delay); }; update = function(now) { var date, diff, relative, singlePost, _i, _len, _ref; - date = post.info.date; diff = now - date; relative = RelativeDates.relative(diff, now, date); @@ -9262,7 +8938,6 @@ }, node: function(post) { var spoiler, spoilers, _i, _len; - spoilers = $$('s', this.nodes.comment); for (_i = 0, _len = spoilers.length; _i < _len; _i++) { spoiler = spoilers[_i]; @@ -9282,7 +8957,6 @@ }, ready: function() { var field; - field = $.id('recaptcha_response_field'); $.on(field, 'keydown', function(e) { if (e.keyCode === 8 && !field.value) { @@ -9291,7 +8965,6 @@ }); return $.on($('form'), 'submit', function(e) { var response; - e.preventDefault(); response = field.value.trim(); if (!/\s/.test(response)) { @@ -9305,7 +8978,6 @@ Sauce = { init: function() { var err, link, links, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Sauce']) { return; } @@ -9337,7 +9009,6 @@ }, createSauceLink: function(link) { var m, text; - link = link.replace(/%(T?URL|MD5|board)/ig, function(parameter) { switch (parameter) { case '%TURL': @@ -9358,7 +9029,6 @@ }, node: function() { var link, nodes, _i, _len, _ref; - if (this.isClone || !this.file) { return; } @@ -9391,7 +9061,6 @@ }, createFunc: function(format) { var code; - code = format.replace(/%([A-Za-z])/g, function(s, c) { if (c in Time.formatters) { return "' + Time.formatters." + c + ".call(date) + '"; @@ -9476,7 +9145,6 @@ Settings = { init: function() { var link, settings; - link = $.el('a', { className: 'settings-link', textContent: 'Settings', @@ -9486,7 +9154,6 @@ Header.addShortcut(link); $.get('previousversion', null, function(item) { var changelog, el, previous; - if (previous = item['previousversion']) { if (previous === g.VERSION) { return; @@ -9524,7 +9191,6 @@ }, open: function(openSection) { var dialog, html, link, links, overlay, section, sectionToOpen, _i, _len, _ref; - $.off(d, '4chanXInitFinished', Settings.open); if (Settings.dialog) { return; @@ -9577,7 +9243,6 @@ sections: [], addSection: function(title, open) { var hyphenatedTitle, _ref; - if (typeof title !== 'string') { _ref = title.detail, title = _ref.title, open = _ref.open; } @@ -9590,7 +9255,6 @@ }, openSection: function() { var section, selected; - if (selected = $('.tab-selected', Settings.dialog)) { $.rmClass(selected, 'tab-selected'); } @@ -9604,7 +9268,6 @@ }, main: function(section) { var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref; - items = {}; inputs = {}; _ref = Config.main; @@ -9629,7 +9292,6 @@ } $.get(items, function(items) { var val; - for (key in items) { val = items[key]; inputs[key].checked = val; @@ -9644,7 +9306,6 @@ boards: {} }, function(item) { var ID, board, thread, _ref1; - _ref1 = item.hiddenThreads.boards; for (ID in _ref1) { board = _ref1[ID]; @@ -9659,7 +9320,6 @@ boards: {} }, function(item) { var ID, board, post, thread, _ref1; - _ref1 = item.hiddenPosts.boards; for (ID in _ref1) { board = _ref1[ID]; @@ -9679,7 +9339,6 @@ boards: {} }, function(item) { var boardID; - for (boardID in item.hiddenThreads.boards) { localStorage.removeItem("4chan-hide-t-" + boardID); } @@ -9690,7 +9349,6 @@ }, "export": function(now, data) { var a, db, _i, _len; - if (typeof now !== 'number') { now = Date.now(); data = { @@ -9725,7 +9383,6 @@ }, onImport: function() { var file, output, reader; - if (!(file = this.files[0])) { return; } @@ -9737,7 +9394,6 @@ reader = new FileReader(); reader.onload = function(e) { var data, err; - try { data = JSON.parse(e.target.result); Settings.loadSettings(data); @@ -9754,7 +9410,6 @@ }, loadSettings: function(data) { var key, val, version, _ref; - version = data.version.split('.'); if (version[0] === '2') { data = Settings.convertSettings(data, { @@ -9844,7 +9499,6 @@ }, convertSettings: function(data, map) { var newKey, prevKey; - for (prevKey in map) { newKey = map[prevKey]; if (newKey) { @@ -9856,7 +9510,6 @@ }, filter: function(section) { var select; - section.innerHTML = "
"; select = $('select', section); $.on(select, 'change', Settings.selectFilter); @@ -9864,7 +9517,6 @@ }, selectFilter: function() { var div, name, ta; - div = this.nextElementSibling; if ((name = this.value) !== 'guide') { $.rmAll(div); @@ -9884,7 +9536,6 @@ }, sauce: function(section) { var ta; - section.innerHTML = "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
    These parameters will be replaced by their corresponding values:\n
  • %TURL: Thumbnail URL.
  • %URL: Full image URL.
  • %MD5: MD5 hash.
  • %board: Current board.
"; ta = $('textarea', section); $.get('sauces', Conf['sauces'], function(item) { @@ -9894,7 +9545,6 @@ }, advanced: function(section) { var archive, boardID, boardOptions, boardSelect, boards, data, event, input, inputs, item, items, name, row, rows, ta, table, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4; - section.innerHTML = "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Disabled selections indicate that only one archive is available for that board and redirection type.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Status/Twitter link (status, @).
Board link: g
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:\"Install Gentoo\"
Index-only link: g-index
Catalog-only link: g-catalog
External link: external-text:\"Google\",\"http://www.google.com\"
Combinations are possible: g-index-text:\"Technology Index\"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:\"Piracy\"]
\n will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
\n if you are on /g/.\n
Time Formatting is disabled.
:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (Unix timestamp)
Original file name: %n (truncated), %N (untruncated), %t (Unix timestamp)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Quick Reply Personas is disabled.

\n One item per line.
\n Items will be added in the relevant input's auto-completion list.
\n Password items will always be used, since there is no password input.
\n Lines starting with a # will be ignored.\n

    You can use these settings with each item, separate them with semicolons:\n
  • Possible items are: name, email, subject and password.
  • Wrap values of items with quotes, like this: email:\"sage\".
  • Force values as defaults with the always keyword, for example: email:\"sage\";always.
  • Select specific boards for an item, separated with commas, for example: email:\"sage\";boards:jp;always.
Unread Favicon is disabled.
Emoji is disabled.
\n Sage Icon:
\n Position:
Thread Updater is disabled.
\n Interval:
"; items = {}; inputs = {}; @@ -9914,7 +9564,6 @@ $.on(ta, 'change', $.cb.value); $.get(items, function(items) { var key, val; - for (key in items) { val = items[key]; if (['emojiPos'].contains(key)) { @@ -9985,7 +9634,6 @@ }); $.get('selectedArchives', Conf['selectedArchives'], function(_arg) { var option, selectedArchives, type; - selectedArchives = _arg.selectedArchives; for (boardID in selectedArchives) { data = selectedArchives[boardID]; @@ -10000,7 +9648,6 @@ }, addArchiveCell: function(boardID, data, type) { var archive, i, length, options, select, td; - length = data[type].length; td = $.el('td', { className: 'archive-cell' @@ -10030,10 +9677,8 @@ }, saveSelectedArchive: function() { var _this = this; - return $.get('selectedArchives', Conf['selectedArchives'], function(_arg) { var selectedArchives, _name; - selectedArchives = _arg.selectedArchives; (selectedArchives[_name = _this.dataset.boardid] || (selectedArchives[_name] = {}))[_this.dataset.type] = _this.value; return $.set('selectedArchives', selectedArchives); @@ -10044,7 +9689,6 @@ }, time: function() { var funk; - funk = Time.createFunc(this.value); return this.nextElementSibling.textContent = funk(Time, new Date()); }, @@ -10053,7 +9697,6 @@ }, fileInfo: function() { var data, funk; - data = { isReply: true, file: { @@ -10092,7 +9735,6 @@ }, keybinds: function(section) { var arr, input, inputs, items, key, tbody, tr, _ref; - section.innerHTML = "
Keybinds are disabled.
Allowed keys: a-z, 0-9, Ctrl, Shift, Alt, Meta, Enter, Esc, Up, Down, Right, Left.
Press Backspace to disable a keybind.
ActionsKeybinds
"; tbody = $('tbody', section); items = {}; @@ -10113,7 +9755,6 @@ } return $.get(items, function(items) { var val; - for (key in items) { val = items[key]; inputs[key].value = val; @@ -10122,7 +9763,6 @@ }, keybind: function(e) { var key; - if (e.keyCode === 9) { return; } @@ -10139,10 +9779,8 @@ Main = { init: function(items) { var db, flatten, _i, _len; - flatten = function(parent, obj) { var key, val; - if (obj instanceof Array) { Conf[parent] = obj[0]; } else if (typeof obj === 'object') { @@ -10166,13 +9804,11 @@ $.on(d, '4chanMainInit', Main.initStyle); return $.asap((function() { var _ref; - return d.head && $('link[rel="shortcut icon"]', d.head) || ((_ref = d.readyState) === 'interactive' || _ref === 'complete'); }), Main.initStyle); }, initFeatures: function(items) { var init, pathname, _ref; - Conf = items; pathname = location.pathname.split('/'); g.BOARD = new Board(pathname[1]); @@ -10201,7 +9837,6 @@ case 'images.4chan.org': $.ready(function() { var URL; - if (Conf['404 Redirect'] && d.title === '4chan - 404 Not Found') { Redirect.init(); pathname = location.pathname.split('/'); @@ -10218,7 +9853,6 @@ } init = function(features) { var err, module, name; - for (name in features) { module = features[name]; try { @@ -10294,7 +9928,6 @@ }, initStyle: function() { var mainStyleSheet, observer, setStyle, style, styleSheets, _ref; - $.off(d, '4chanMainInit', Main.initStyle); if (!Main.isThisPageLegit() || $.hasClass(doc, 'fourchan-x')) { return; @@ -10316,7 +9949,6 @@ styleSheets = $$('link[rel="alternate stylesheet"]', d.head); setStyle = function() { var styleSheet, _i, _len; - $.rmClass(doc, style); for (_i = 0, _len = styleSheets.length; _i < _len; _i++) { styleSheet = styleSheets[_i]; @@ -10343,7 +9975,6 @@ }, initReady: function() { var board, boardChild, err, errors, href, passLink, posts, styleSelector, thread, threadChild, threads, _i, _j, _len, _len1, _ref, _ref1; - if (d.title === '4chan - 404 Not Found') { if (Conf['404 Redirect'] && g.VIEW === 'thread') { href = Redirect.to('thread', { @@ -10418,7 +10049,6 @@ }, callbackNodes: function(klass, nodes) { var callback, err, errors, i, len, node, _i, _len, _ref; - len = nodes.length; _ref = klass.prototype.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -10446,11 +10076,9 @@ }, callbackNodesDB: function(klass, nodes, cb) { var errors, func, i, len, node, queue, softTask; - queue = []; softTask = function() { var args, func, task; - task = queue.shift(); func = task[0]; args = Array.prototype.slice.call(task, 1); @@ -10469,7 +10097,6 @@ errors = null; func = function(node, i) { var callback, err, _i, _len, _ref; - _ref = klass.prototype.callbacks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { callback = _ref[_i]; @@ -10503,7 +10130,6 @@ }, addCallback: function(e) { var Klass, obj; - obj = e.detail; if (typeof obj.callback.name !== 'string') { throw new Error("Invalid callback name: " + obj.callback.name); @@ -10523,7 +10149,6 @@ }, handleErrors: function(errors) { var div, error, logs, _i, _len; - if (!(errors instanceof Array)) { error = errors; } else if (errors.length === 1) { @@ -10538,7 +10163,6 @@ }); $.on(div.lastElementChild, 'click', function() { var _ref; - return _ref = this.textContent === 'show' ? ['hide', false] : ['show', true], this.textContent = _ref[0], logs.hidden = _ref[1], _ref; }); logs = $.el('div', { @@ -10552,7 +10176,6 @@ }, parseError: function(data) { var error, message; - Main.logError(data); message = $.el('div', { textContent: data.message @@ -10569,7 +10192,6 @@ }, isThisPageLegit: function() { var _ref; - if (!('thisPageIsLegit' in Main)) { Main.thisPageIsLegit = location.hostname === 'boards.4chan.org' && !$('link[href*="favicon-status.ico"]', d.head) && ((_ref = d.title) !== '4chan - Temporarily Offline' && _ref !== '4chan - Error'); } diff --git a/latest.js b/latest.js index 415409ac2..d937b0090 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'1.2.21'},'*') +postMessage({version:'1.2.22'},'*') diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 0718d533d..905e8f6e0 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -29,7 +29,7 @@ Redirect = 'http': false 'https': true 'software': 'foolfuuka' - 'boards': ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'vg', 'vp', 'vr', 'wsg'] + 'boards': ['a', 'co', 'gd', 'jp', 'm', 'q', 'sp', 'tg', 'tv', 'v', 'vg', 'vp', 'vr', 'wsg'] 'files': ['a', 'gd', 'jp', 'm', 'q', 'tg', 'vg', 'vp', 'vr', 'wsg'] 'NSFW Foolz': @@ -71,6 +71,14 @@ Redirect = 'boards': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv'] 'files': ['adv', 'asp', 'cm', 'i', 'lgbt', 'n', 'o', 'p', 's4s', 't', 'trv'] + 'World Athletic Project': + 'domain': 'fuuka.worldathleticproject.org' + 'http': true + 'https': false + 'software': 'foolfuuka' + 'boards': ['e', 'h', 'p', 's', 'u'] + 'files': ['e', 'h', 'p', 's', 'u'] + 'Install Gentoo': 'domain': 'archive.installgentoo.net' 'http': false From dc22609671717d7f4e8b4f6d26e73d2194b5fc68 Mon Sep 17 00:00:00 2001 From: seaweedchan Date: Tue, 23 Jul 2013 01:56:50 -0700 Subject: [PATCH 09/12] Update grunt-bump dependency This is necessary for the bump-only change. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a85b65c3b..4ac2e7865 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ }, "devDependencies": { "grunt": "~0.4.1", - "grunt-bump": "~0.0.2", + "grunt-bump": "~0.0.11", "grunt-concurrent": "~0.2.0", "grunt-contrib-clean": "~0.4.1", "grunt-contrib-coffee": "~0.7.0", From aba70b9f15215f55ae78c0bdd6059d00dc3f000d Mon Sep 17 00:00:00 2001 From: Matt Wilmink Date: Tue, 23 Jul 2013 22:46:20 -0400 Subject: [PATCH 10/12] Fix #118 --- src/Posting/QuickReply.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Posting/QuickReply.coffee b/src/Posting/QuickReply.coffee index 1de316360..92860eb7c 100644 --- a/src/Posting/QuickReply.coffee +++ b/src/Posting/QuickReply.coffee @@ -1085,7 +1085,7 @@ QR = QR.error $.el 'span', innerHTML: """ 4chan X encountered an error while posting. Please try again. - [?/a>] + [?] """ opts = cred: true From 2a23975646af93f38ff899a0c78575ece9464b64 Mon Sep 17 00:00:00 2001 From: seaweedchan Date: Tue, 23 Jul 2013 23:23:59 -0700 Subject: [PATCH 11/12] Release 4chan X v1.2.23. --- CHANGELOG.md | 8 +++++++- LICENSE | 2 +- builds/4chan-X.js | 8 ++++---- builds/4chan-X.meta.js | 2 +- builds/4chan-X.user.js | 8 ++++---- builds/crx/manifest.json | 2 +- builds/crx/script.js | 6 +++--- latest.js | 2 +- package.json | 2 +- 9 files changed, 23 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0890d93c1..abebca48c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,13 @@ +### v1.2.23 +*2013-07-23* + +**matt4682**: +- Small fix for new error message. + ### v1.2.22 *2013-07-23* -**seaweedchan** +**seaweedchan**: - Update archives. ### v1.2.21 diff --git a/LICENSE b/LICENSE index 93a8c2b94..9ac886a43 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.2.22 - 2013-07-23 +* 4chan X - Version 1.2.23 - 2013-07-23 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.js b/builds/4chan-X.js index ee1d6894e..dde3f45d5 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.2.22 +// @version 1.2.23 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.22 - 2013-07-23 +* 4chan X - Version 1.2.23 - 2013-07-23 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -323,7 +323,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.22', + VERSION: '1.2.23', NAMESPACE: '4chan X.', boards: {}, threads: {}, @@ -5742,7 +5742,7 @@ QR.cooldown.auto = false; QR.status(); return QR.error($.el('span', { - innerHTML: "4chan X encountered an error while posting. Please try again. \n[?/a>]" + innerHTML: "4chan X encountered an error while posting. Please try again. \n[?]" })); } }; diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index 92e2699f5..c16ec78c0 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.2.22 +// @version 1.2.23 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 25c55b39d..8a9cbd6ea 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.2.22 +// @version 1.2.23 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.22 - 2013-07-23 +* 4chan X - Version 1.2.23 - 2013-07-23 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -320,7 +320,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.22', + VERSION: '1.2.23', NAMESPACE: '4chan X.', boards: {}, threads: {}, @@ -5753,7 +5753,7 @@ QR.cooldown.auto = false; QR.status(); return QR.error($.el('span', { - innerHTML: "4chan X encountered an error while posting. Please try again. \n[?/a>]" + innerHTML: "4chan X encountered an error while posting. Please try again. \n[?]" })); } }; diff --git a/builds/crx/manifest.json b/builds/crx/manifest.json index 9cd176c4e..576e9e151 100644 --- a/builds/crx/manifest.json +++ b/builds/crx/manifest.json @@ -1,6 +1,6 @@ { "name": "4chan X", - "version": "1.2.22", + "version": "1.2.23", "manifest_version": 2, "description": "Cross-browser userscript for maximum lurking on 4chan.", "icons": { diff --git a/builds/crx/script.js b/builds/crx/script.js index ec9b3c52c..bc64470fa 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.22 - 2013-07-23 +* 4chan X - Version 1.2.23 - 2013-07-23 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -300,7 +300,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.22', + VERSION: '1.2.23', NAMESPACE: '4chan X.', boards: {}, threads: {}, @@ -5735,7 +5735,7 @@ QR.cooldown.auto = false; QR.status(); return QR.error($.el('span', { - innerHTML: "4chan X encountered an error while posting. Please try again. \n[?/a>]" + innerHTML: "4chan X encountered an error while posting. Please try again. \n[?]" })); } }; diff --git a/latest.js b/latest.js index d937b0090..ba6158f28 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'1.2.22'},'*') +postMessage({version:'1.2.23'},'*') diff --git a/package.json b/package.json index 4ac2e7865..57e2c8e33 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-X", - "version": "1.2.21", + "version": "1.2.23", "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", From 979694a97324ac90df03778aff17e843a74e191a Mon Sep 17 00:00:00 2001 From: seaweedchan Date: Wed, 24 Jul 2013 02:12:15 -0700 Subject: [PATCH 12/12] Release 4chan X v1.2.24. --- CHANGELOG.md | 6 ++++++ LICENSE | 2 +- builds/4chan-X.js | 14 +++++++++++--- builds/4chan-X.meta.js | 2 +- builds/4chan-X.user.js | 14 +++++++++++--- builds/crx/manifest.json | 2 +- builds/crx/script.js | 12 ++++++++++-- latest.js | 2 +- package.json | 2 +- src/Archive/Redirect.coffee | 8 ++++++++ 10 files changed, 51 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index abebca48c..679962fa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### v1.2.24 +*2013-07-24* + +**seaweedchan**: +- Update archives (warosu is back up, and with it, the option to use it). + ### v1.2.23 *2013-07-23* diff --git a/LICENSE b/LICENSE index 9ac886a43..8758af562 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.2.23 - 2013-07-23 +* 4chan X - Version 1.2.24 - 2013-07-24 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.js b/builds/4chan-X.js index dde3f45d5..7fe4d2e99 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.2.23 +// @version 1.2.24 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.23 - 2013-07-23 +* 4chan X - Version 1.2.24 - 2013-07-24 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -323,7 +323,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.23', + VERSION: '1.2.24', NAMESPACE: '4chan X.', boards: {}, threads: {}, @@ -7733,6 +7733,14 @@ 'boards': ['diy', 'g', 'sci'], 'files': [] }, + 'warosu': { + 'domain': 'fuuka.warosu.org', + 'http': true, + 'https': true, + 'software': 'fuuka', + 'boards': ['3', 'cgl', 'ck', 'fa', 'ic', 'jp', 'lit', 'q', 'tg', 'vr'], + 'files': ['3', 'cgl', 'ck', 'fa', 'ic', 'jp', 'lit', 'q', 'tg', 'vr'] + }, 'Rebecca Black Tech': { 'domain': 'rbt.asia', 'http': true, diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index c16ec78c0..089dc6421 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.2.23 +// @version 1.2.24 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 8a9cbd6ea..62356663d 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.2.23 +// @version 1.2.24 // @namespace 4chan-X // @description Cross-browser userscript for maximum lurking on 4chan. // @license MIT; https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -19,7 +19,7 @@ // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // ==/UserScript== /* -* 4chan X - Version 1.2.23 - 2013-07-23 +* 4chan X - Version 1.2.24 - 2013-07-24 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -320,7 +320,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.23', + VERSION: '1.2.24', NAMESPACE: '4chan X.', boards: {}, threads: {}, @@ -7728,6 +7728,14 @@ 'boards': ['diy', 'g', 'sci'], 'files': [] }, + 'warosu': { + 'domain': 'fuuka.warosu.org', + 'http': true, + 'https': true, + 'software': 'fuuka', + 'boards': ['3', 'cgl', 'ck', 'fa', 'ic', 'jp', 'lit', 'q', 'tg', 'vr'], + 'files': ['3', 'cgl', 'ck', 'fa', 'ic', 'jp', 'lit', 'q', 'tg', 'vr'] + }, 'Rebecca Black Tech': { 'domain': 'rbt.asia', 'http': true, diff --git a/builds/crx/manifest.json b/builds/crx/manifest.json index 576e9e151..bb3e2252f 100644 --- a/builds/crx/manifest.json +++ b/builds/crx/manifest.json @@ -1,6 +1,6 @@ { "name": "4chan X", - "version": "1.2.23", + "version": "1.2.24", "manifest_version": 2, "description": "Cross-browser userscript for maximum lurking on 4chan.", "icons": { diff --git a/builds/crx/script.js b/builds/crx/script.js index bc64470fa..8244e17f3 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.2.23 - 2013-07-23 +* 4chan X - Version 1.2.24 - 2013-07-24 * * Licensed under the MIT license. * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE @@ -300,7 +300,7 @@ doc = d.documentElement; g = { - VERSION: '1.2.23', + VERSION: '1.2.24', NAMESPACE: '4chan X.', boards: {}, threads: {}, @@ -7715,6 +7715,14 @@ 'boards': ['diy', 'g', 'sci'], 'files': [] }, + 'warosu': { + 'domain': 'fuuka.warosu.org', + 'http': true, + 'https': true, + 'software': 'fuuka', + 'boards': ['3', 'cgl', 'ck', 'fa', 'ic', 'jp', 'lit', 'q', 'tg', 'vr'], + 'files': ['3', 'cgl', 'ck', 'fa', 'ic', 'jp', 'lit', 'q', 'tg', 'vr'] + }, 'Rebecca Black Tech': { 'domain': 'rbt.asia', 'http': true, diff --git a/latest.js b/latest.js index ba6158f28..f6f20c5f6 100644 --- a/latest.js +++ b/latest.js @@ -1 +1 @@ -postMessage({version:'1.2.23'},'*') +postMessage({version:'1.2.24'},'*') diff --git a/package.json b/package.json index 57e2c8e33..8d2059af2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-X", - "version": "1.2.23", + "version": "1.2.24", "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index 905e8f6e0..13b13a6e9 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -87,6 +87,14 @@ Redirect = 'boards': ['diy', 'g', 'sci'] 'files': [] + 'warosu': + 'domain': 'fuuka.warosu.org' + 'http': true + 'https': true + 'software': 'fuuka' + 'boards': ['3', 'cgl', 'ck', 'fa', 'ic', 'jp', 'lit', 'q', 'tg', 'vr'] + 'files': ['3', 'cgl', 'ck', 'fa', 'ic', 'jp', 'lit', 'q', 'tg', 'vr'] + 'Rebecca Black Tech': 'domain': 'rbt.asia' 'http': true