diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e756e9a6..96f0f0040 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ The attributions below are for work that has been incorporated into the script a The links to individual versions below are to copies of the script with the update URL removed. If you want automatic updates, install the script from the links on the [main page](https://github.com/ccd0/4chan-x). +### v1.9.19.3 +*2015-01-04* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.19.3/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.19.3/builds/4chan-X-noupdate.crx "Chromium version")] + +**ccd0** +- Merge v1.9.18.9: Support new archived threads list page. + ### v1.9.19.2 *2015-01-04* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.19.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.9.19.2/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/LICENSE b/LICENSE index f371691f6..6f25e57ec 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.9.19.2 +* 4chan X - Version 1.9.19.3 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index c7cd9d30f..b57876737 100644 Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js index 7cbfe18b2..efa4ad4de 100644 --- a/builds/4chan-X-beta.meta.js +++ b/builds/4chan-X-beta.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @version 1.9.19.2 +// @version 1.9.19.3 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js index 32aab6b5e..4c89857aa 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X beta -// @version 1.9.19.2 +// @version 1.9.19.3 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -25,7 +25,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.9.19.2 +* 4chan X - Version 1.9.19.3 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -395,7 +395,7 @@ doc = d.documentElement; g = { - VERSION: '1.9.19.2', + VERSION: '1.9.19.3', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -2671,10 +2671,13 @@ className: 'navLinks' }); $.extend(this.navLinks, { - innerHTML: "Return Catalog Bottom ×" + innerHTML: "Return Catalog Archive Bottom ×" }); $('.returnlink a', this.navLinks).href = CatalogLinks.index(); $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); + if (g.BOARD.ID === 'b') { + $('.archlistlink', this.navLinks).hidden = true; + } this.searchInput = $('#index-search', this.navLinks); this.setupSearch(); this.hideLabel = $('#hidden-label', this.navLinks); @@ -4834,9 +4837,13 @@ Anonymize = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Anonymize']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread' && _ref !== 'archive') || !Conf['Anonymize']) { return; } + if (g.VIEW === 'archive') { + return this.archive(); + } return Post.callbacks.push({ name: 'Anonymize', cb: this.node @@ -4859,14 +4866,31 @@ $.replace(email, name); return delete this.nodes.email; } + }, + archive: function() { + return $.ready(function() { + var name, trip, _i, _j, _len, _len1, _ref, _ref1, _results; + _ref = $$('.name'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + name = _ref[_i]; + name.textContent = 'Anonymous'; + } + _ref1 = $$('.postertrip'); + _results = []; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + trip = _ref1[_j]; + _results.push($.rm(trip)); + } + return _results; + }); } }; Filter = { filters: {}, init: function() { - var boards, err, filter, hl, key, line, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; - if (g.VIEW === 'catalog' || !Conf['Filter']) { + var boards, err, filter, hl, key, line, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Filter']) { return; } if (!Conf['Filtered Backlinks']) { @@ -4874,9 +4898,9 @@ } for (key in Config.filter) { this.filters[key] = []; - _ref = Conf[key].split('\n'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - line = _ref[_i]; + _ref1 = Conf[key].split('\n'); + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + line = _ref1[_i]; if (line[0] === '#') { continue; } @@ -4884,8 +4908,8 @@ continue; } filter = line.replace(regexp[0], ''); - boards = ((_ref1 = filter.match(/boards:([^;]+)/)) != null ? _ref1[1].toLowerCase() : void 0) || 'global'; - if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) { + boards = ((_ref2 = filter.match(/boards:([^;]+)/)) != null ? _ref2[1].toLowerCase() : void 0) || 'global'; + if (boards !== 'global' && (_ref3 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref3) < 0)) { continue; } if (key === 'uniqueID' || key === 'MD5') { @@ -4899,10 +4923,10 @@ continue; } } - op = ((_ref3 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref3[1] : void 0) || 'yes'; + op = ((_ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref4[1] : void 0) || 'yes'; stub = (function() { - var _ref4; - switch ((_ref4 = filter.match(/stub:(yes|no)/)) != null ? _ref4[1] : void 0) { + var _ref5; + switch ((_ref5 = filter.match(/stub:(yes|no)/)) != null ? _ref5[1] : void 0) { case 'yes': return true; case 'no': @@ -4912,8 +4936,8 @@ } })(); if (hl = /highlight/.test(filter)) { - hl = ((_ref4 = filter.match(/highlight:(\w+)/)) != null ? _ref4[1] : void 0) || 'filter-highlight'; - top = ((_ref5 = filter.match(/top:(yes|no)/)) != null ? _ref5[1] : void 0) || 'yes'; + hl = ((_ref5 = filter.match(/highlight:(\w+)/)) != null ? _ref5[1] : void 0) || 'filter-highlight'; + top = ((_ref6 = filter.match(/top:(yes|no)/)) != null ? _ref6[1] : void 0) || 'yes'; top = top === 'yes'; } this.filters[key].push(this.createFilter(regexp, op, stub, hl, top)); @@ -5059,8 +5083,8 @@ }, menu: { init: function() { - var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) { + var div, entry, type, _i, _len, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Filter']) { return; } div = $.el('div', { @@ -5075,9 +5099,9 @@ }, subEntries: [] }; - _ref = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1])); } return Menu.menu.addEntry(entry); @@ -5134,7 +5158,8 @@ PostHiding = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) { return; } if (Conf['Reply Hiding Buttons']) { @@ -5170,8 +5195,8 @@ }, menu: { init: function() { - var apply, div, hideStubLink, makeStub, replies, thisPost; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) { + var apply, div, hideStubLink, makeStub, replies, thisPost, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; } div = $.el('div', { @@ -5430,7 +5455,8 @@ Recursive = { recursives: {}, init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } return Post.callbacks.push({ @@ -5493,7 +5519,8 @@ ThreadHiding = { init: function() { - if (g.VIEW === 'thread' || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) { return; } this.db = new DataBoard('hiddenThreads'); @@ -5765,7 +5792,8 @@ QuoteBacklink = { containers: {}, init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Backlinks']) { return; } Post.callbacks.push({ @@ -5850,7 +5878,8 @@ QuoteCT = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark Cross-thread Quotes']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) { return; } if (Conf['Comment Expansion']) { @@ -5887,7 +5916,8 @@ QuoteInline = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Inlining']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Inlining']) { return; } this.process = Conf['Quote Hash Navigation'] ? function(link, clone) { @@ -6006,7 +6036,8 @@ QuoteOP = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark OP Quotes']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark OP Quotes']) { return; } if (Conf['Comment Expansion']) { @@ -6049,7 +6080,8 @@ QuotePreview = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Previewing']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Previewing']) { return; } if (Conf['Comment Expansion']) { @@ -6132,7 +6164,8 @@ QuoteStrikeThrough = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link']) && !Conf['Filter']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link']) && !Conf['Filter']) { return; } return Post.callbacks.push({ @@ -6336,7 +6369,8 @@ QuoteYou = { init: function() { - if (!(g.VIEW !== 'catalog' && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) { + var _ref; + if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) { return; } if (Conf['Highlight Own Posts']) { @@ -6425,7 +6459,8 @@ Quotify = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Resurrect Quotes'] && g.BOARD.ID !== 'pol') { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Resurrect Quotes'] && g.BOARD.ID !== 'pol') { return; } if (Conf['Comment Expansion']) { @@ -8759,8 +8794,8 @@ FappeTyme = { init: function() { - var el, lc, type, _i, _len, _ref; - if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || g.VIEW === 'catalog' || g.BOARD === 'f') { + var el, lc, type, _i, _len, _ref, _ref1; + if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || g.BOARD === 'f') { return; } this.nodes = {}; @@ -8768,9 +8803,9 @@ fappe: false, werk: Conf['werk'] }; - _ref = ["Fappe", "Werk"]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = ["Fappe", "Werk"]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; if (!Conf["" + type + " Tyme"]) { continue; } @@ -8831,8 +8866,8 @@ Gallery = { init: function() { - var el; - if (g.VIEW === 'catalog' || g.BOARD === 'f' || !Conf['Gallery']) { + var el, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || g.BOARD === 'f' || !Conf['Gallery']) { return; } this.delay = Conf['Slide Delay']; @@ -9219,8 +9254,8 @@ }, menu: { init: function() { - var el; - if (g.VIEW === 'catalog' || !Conf['Gallery']) { + var el, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Gallery']) { return; } el = $.el('span', { @@ -9379,7 +9414,8 @@ ImageExpand = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Image Expansion']) { return; } this.EAI = $.el('a', { @@ -9742,8 +9778,8 @@ }, menu: { init: function() { - var conf, createSubEntry, el, name, subEntries, _ref; - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + var conf, createSubEntry, el, name, subEntries, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Image Expansion']) { return; } el = $.el('span', { @@ -9752,9 +9788,9 @@ }); createSubEntry = ImageExpand.menu.createSubEntry; subEntries = []; - _ref = Config.imageExpansion; - for (name in _ref) { - conf = _ref[name]; + _ref1 = Config.imageExpansion; + for (name in _ref1) { + conf = _ref1[name]; subEntries.push(createSubEntry(name, conf[1])); } return Header.menu.addEntry({ @@ -9782,7 +9818,8 @@ ImageHover = { init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } if (Conf['Image Hover']) { @@ -9898,8 +9935,8 @@ ImageLoader = { init: function() { - var prefetch; - if (g.VIEW === 'catalog') { + var prefetch, _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) { @@ -9914,14 +9951,14 @@ }); if (Conf['Replace WEBM']) { $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', function() { - var qpClone, _ref; - qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0; + var qpClone, _ref1; + qpClone = (_ref1 = $.id('qp')) != null ? _ref1.firstElementChild : void 0; return g.posts.forEach(function(post) { - var thumb, _i, _len, _ref1, _ref2; - _ref1 = [post].concat(__slice.call(post.clones)); - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - post = _ref1[_i]; - if (!((_ref2 = post.file) != null ? _ref2.videoThumb : void 0)) { + var thumb, _i, _len, _ref2, _ref3; + _ref2 = [post].concat(__slice.call(post.clones)); + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + post = _ref2[_i]; + if (!((_ref3 = post.file) != null ? _ref3.videoThumb : void 0)) { continue; } thumb = post.file.thumb; @@ -10035,7 +10072,8 @@ RevealSpoilers = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reveal Spoiler Thumbnails']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reveal Spoiler Thumbnails']) { return; } return Post.callbacks.push({ @@ -10056,14 +10094,14 @@ Sauce = { init: function() { - var err, link, links, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Sauce']) { + var err, link, links, _i, _len, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Sauce']) { return; } links = []; - _ref = Conf['sauces'].split('\n'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; + _ref1 = Conf['sauces'].split('\n'); + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + link = _ref1[_i]; try { if (link[0] !== '#') { links.push(link.trim()); @@ -10804,7 +10842,8 @@ Linkify = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Linkify']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Linkify']) { return; } if (Conf['Comment Expansion']) { @@ -10944,8 +10983,8 @@ ArchiveLink = { init: function() { - var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { + var div, entry, type, _i, _len, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Archive Link']) { return; } div = $.el('div', { @@ -10965,9 +11004,9 @@ }, subEntries: [] }; - _ref = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; entry.subEntries.push(this.createSubEntry(type[0], type[1])); } return Menu.menu.addEntry(entry); @@ -11010,8 +11049,8 @@ DeleteLink = { init: function() { - var div, fileEl, fileEntry, postEl, postEntry; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { + var div, fileEl, fileEntry, postEl, postEntry, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Delete Link']) { return; } div = $.el('div', { @@ -11148,8 +11187,8 @@ DownloadLink = { init: function() { - var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { + var a, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Download Link']) { return; } a = $.el('a', { @@ -11191,7 +11230,8 @@ Menu = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Menu']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu']) { return; } this.button = $.el('a', { @@ -11232,8 +11272,8 @@ ReportLink = { init: function() { - var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { + var a, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Report Link']) { return; } a = $.el('a', { @@ -13284,6 +13324,7 @@ selector = (function() { switch (g.VIEW) { case 'thread': + case 'archive': return '.navLinks.desktop > a'; case 'catalog': return '.navLinks > :first-child > a'; @@ -13689,7 +13730,8 @@ FileInfo = { init: function() { - if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['File Info Formatting']) { return; } return Post.callbacks.push({ @@ -13807,7 +13849,8 @@ Fourchan = { init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } if (g.BOARD.ID === 'g') { @@ -13867,7 +13910,8 @@ IDColor = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Color User IDs']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Color User IDs']) { return; } this.ids = {}; @@ -13915,7 +13959,8 @@ IDHighlight = { init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } return Post.callbacks.push({ @@ -13975,7 +14020,7 @@ return Conf[hotkey] = key; }, keydown: function(e) { - var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2; + var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; if (!(key = Keybinds.keyCode(e))) { return; } @@ -13985,7 +14030,7 @@ return; } } - if (!(g.VIEW === 'catalog' || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) { + if (!(((_ref1 = g.VIEW) !== 'index' && _ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) { threadRoot = Nav.getThread(); if (op = $('.op', threadRoot)) { thread = Get.postFromNode(op).thread; @@ -14108,19 +14153,19 @@ Keybinds.img(threadRoot, true); break; case Conf['Open Gallery']: - if (g.VIEW === 'catalog') { + if ((_ref2 = g.VIEW) !== 'index' && _ref2 !== 'thread') { return; } Gallery.cb.toggle(); break; case Conf['fappeTyme']: - if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { + if (!Conf['Fappe Tyme'] || ((_ref3 = g.VIEW) !== 'index' && _ref3 !== 'thread') || g.BOARD === 'f') { return; } FappeTyme.toggle('fappe'); break; case Conf['werkTyme']: - if (!Conf['Werk Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { + if (!Conf['Werk Tyme'] || ((_ref4 = g.VIEW) !== 'index' && _ref4 !== 'thread') || g.BOARD === 'f') { return; } FappeTyme.toggle('werk'); @@ -14140,7 +14185,7 @@ return; } if (Conf['JSON Navigation']) { - if ((_ref1 = Conf['Index Mode']) !== 'paged' && _ref1 !== 'infinite') { + if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') { return; } $('.next button', Index.pagelist).click(); @@ -14155,7 +14200,7 @@ return; } if (Conf['JSON Navigation']) { - if ((_ref2 = Conf['Index Mode']) !== 'paged' && _ref2 !== 'infinite') { + if ((_ref6 = Conf['Index Mode']) !== 'paged' && _ref6 !== 'infinite') { return; } $('.prev button', Index.pagelist).click(); @@ -14504,7 +14549,8 @@ RelativeDates = { INTERVAL: $.MINUTE / 2, init: function() { - if (g.VIEW !== 'catalog' && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') { + var _ref; + if (((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') { this.flush(); $.on(d, 'visibilitychange ThreadUpdate', this.flush); } @@ -14610,14 +14656,22 @@ name: 'Reveal Spoilers', cb: this.node }); - return CatalogThread.callbacks.push({ + CatalogThread.callbacks.push({ name: 'Reveal Spoilers', cb: this.node }); + if (g.VIEW === 'archive') { + return $.ready(function() { + return RemoveSpoilers.unspoiler($.id('arc-list')); + }); + } }, node: function(post) { + return RemoveSpoilers.unspoiler(this.nodes.comment); + }, + unspoiler: function(el) { var span, spoiler, spoilers, _i, _len; - spoilers = $$('s', this.nodes.comment); + spoilers = $$('s', el); for (_i = 0, _len = spoilers.length; _i < _len; _i++) { spoiler = spoilers[_i]; span = $.el('span', { @@ -14631,7 +14685,8 @@ Time = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Time Formatting']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Time Formatting']) { return; } return Post.callbacks.push({ @@ -15423,6 +15478,8 @@ return 'thread'; case 'catalog': return 'catalog'; + case 'archive': + return 'archive'; default: return 'index'; } diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 0b989559a..e63fc21ce 100644 Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js index f717d0e59..b00de0d13 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.9.19.2 +// @version 1.9.19.3 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.9.19.2 +* 4chan X - Version 1.9.19.3 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -394,7 +394,7 @@ doc = d.documentElement; g = { - VERSION: '1.9.19.2', + VERSION: '1.9.19.3', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -2670,10 +2670,13 @@ className: 'navLinks' }); $.extend(this.navLinks, { - innerHTML: "Return Catalog Bottom ×" + innerHTML: "Return Catalog Archive Bottom ×" }); $('.returnlink a', this.navLinks).href = CatalogLinks.index(); $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); + if (g.BOARD.ID === 'b') { + $('.archlistlink', this.navLinks).hidden = true; + } this.searchInput = $('#index-search', this.navLinks); this.setupSearch(); this.hideLabel = $('#hidden-label', this.navLinks); @@ -4833,9 +4836,13 @@ Anonymize = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Anonymize']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread' && _ref !== 'archive') || !Conf['Anonymize']) { return; } + if (g.VIEW === 'archive') { + return this.archive(); + } return Post.callbacks.push({ name: 'Anonymize', cb: this.node @@ -4858,14 +4865,31 @@ $.replace(email, name); return delete this.nodes.email; } + }, + archive: function() { + return $.ready(function() { + var name, trip, _i, _j, _len, _len1, _ref, _ref1, _results; + _ref = $$('.name'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + name = _ref[_i]; + name.textContent = 'Anonymous'; + } + _ref1 = $$('.postertrip'); + _results = []; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + trip = _ref1[_j]; + _results.push($.rm(trip)); + } + return _results; + }); } }; Filter = { filters: {}, init: function() { - var boards, err, filter, hl, key, line, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; - if (g.VIEW === 'catalog' || !Conf['Filter']) { + var boards, err, filter, hl, key, line, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Filter']) { return; } if (!Conf['Filtered Backlinks']) { @@ -4873,9 +4897,9 @@ } for (key in Config.filter) { this.filters[key] = []; - _ref = Conf[key].split('\n'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - line = _ref[_i]; + _ref1 = Conf[key].split('\n'); + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + line = _ref1[_i]; if (line[0] === '#') { continue; } @@ -4883,8 +4907,8 @@ continue; } filter = line.replace(regexp[0], ''); - boards = ((_ref1 = filter.match(/boards:([^;]+)/)) != null ? _ref1[1].toLowerCase() : void 0) || 'global'; - if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) { + boards = ((_ref2 = filter.match(/boards:([^;]+)/)) != null ? _ref2[1].toLowerCase() : void 0) || 'global'; + if (boards !== 'global' && (_ref3 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref3) < 0)) { continue; } if (key === 'uniqueID' || key === 'MD5') { @@ -4898,10 +4922,10 @@ continue; } } - op = ((_ref3 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref3[1] : void 0) || 'yes'; + op = ((_ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref4[1] : void 0) || 'yes'; stub = (function() { - var _ref4; - switch ((_ref4 = filter.match(/stub:(yes|no)/)) != null ? _ref4[1] : void 0) { + var _ref5; + switch ((_ref5 = filter.match(/stub:(yes|no)/)) != null ? _ref5[1] : void 0) { case 'yes': return true; case 'no': @@ -4911,8 +4935,8 @@ } })(); if (hl = /highlight/.test(filter)) { - hl = ((_ref4 = filter.match(/highlight:(\w+)/)) != null ? _ref4[1] : void 0) || 'filter-highlight'; - top = ((_ref5 = filter.match(/top:(yes|no)/)) != null ? _ref5[1] : void 0) || 'yes'; + hl = ((_ref5 = filter.match(/highlight:(\w+)/)) != null ? _ref5[1] : void 0) || 'filter-highlight'; + top = ((_ref6 = filter.match(/top:(yes|no)/)) != null ? _ref6[1] : void 0) || 'yes'; top = top === 'yes'; } this.filters[key].push(this.createFilter(regexp, op, stub, hl, top)); @@ -5058,8 +5082,8 @@ }, menu: { init: function() { - var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) { + var div, entry, type, _i, _len, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Filter']) { return; } div = $.el('div', { @@ -5074,9 +5098,9 @@ }, subEntries: [] }; - _ref = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1])); } return Menu.menu.addEntry(entry); @@ -5133,7 +5157,8 @@ PostHiding = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) { return; } if (Conf['Reply Hiding Buttons']) { @@ -5169,8 +5194,8 @@ }, menu: { init: function() { - var apply, div, hideStubLink, makeStub, replies, thisPost; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) { + var apply, div, hideStubLink, makeStub, replies, thisPost, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; } div = $.el('div', { @@ -5429,7 +5454,8 @@ Recursive = { recursives: {}, init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } return Post.callbacks.push({ @@ -5492,7 +5518,8 @@ ThreadHiding = { init: function() { - if (g.VIEW === 'thread' || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) { return; } this.db = new DataBoard('hiddenThreads'); @@ -5764,7 +5791,8 @@ QuoteBacklink = { containers: {}, init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Backlinks']) { return; } Post.callbacks.push({ @@ -5849,7 +5877,8 @@ QuoteCT = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark Cross-thread Quotes']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) { return; } if (Conf['Comment Expansion']) { @@ -5886,7 +5915,8 @@ QuoteInline = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Inlining']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Inlining']) { return; } this.process = Conf['Quote Hash Navigation'] ? function(link, clone) { @@ -6005,7 +6035,8 @@ QuoteOP = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark OP Quotes']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark OP Quotes']) { return; } if (Conf['Comment Expansion']) { @@ -6048,7 +6079,8 @@ QuotePreview = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Previewing']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Previewing']) { return; } if (Conf['Comment Expansion']) { @@ -6131,7 +6163,8 @@ QuoteStrikeThrough = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link']) && !Conf['Filter']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link']) && !Conf['Filter']) { return; } return Post.callbacks.push({ @@ -6335,7 +6368,8 @@ QuoteYou = { init: function() { - if (!(g.VIEW !== 'catalog' && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) { + var _ref; + if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) { return; } if (Conf['Highlight Own Posts']) { @@ -6424,7 +6458,8 @@ Quotify = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Resurrect Quotes'] && g.BOARD.ID !== 'pol') { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Resurrect Quotes'] && g.BOARD.ID !== 'pol') { return; } if (Conf['Comment Expansion']) { @@ -8758,8 +8793,8 @@ FappeTyme = { init: function() { - var el, lc, type, _i, _len, _ref; - if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || g.VIEW === 'catalog' || g.BOARD === 'f') { + var el, lc, type, _i, _len, _ref, _ref1; + if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || g.BOARD === 'f') { return; } this.nodes = {}; @@ -8767,9 +8802,9 @@ fappe: false, werk: Conf['werk'] }; - _ref = ["Fappe", "Werk"]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = ["Fappe", "Werk"]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; if (!Conf["" + type + " Tyme"]) { continue; } @@ -8830,8 +8865,8 @@ Gallery = { init: function() { - var el; - if (g.VIEW === 'catalog' || g.BOARD === 'f' || !Conf['Gallery']) { + var el, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || g.BOARD === 'f' || !Conf['Gallery']) { return; } this.delay = Conf['Slide Delay']; @@ -9218,8 +9253,8 @@ }, menu: { init: function() { - var el; - if (g.VIEW === 'catalog' || !Conf['Gallery']) { + var el, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Gallery']) { return; } el = $.el('span', { @@ -9378,7 +9413,8 @@ ImageExpand = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Image Expansion']) { return; } this.EAI = $.el('a', { @@ -9741,8 +9777,8 @@ }, menu: { init: function() { - var conf, createSubEntry, el, name, subEntries, _ref; - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + var conf, createSubEntry, el, name, subEntries, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Image Expansion']) { return; } el = $.el('span', { @@ -9751,9 +9787,9 @@ }); createSubEntry = ImageExpand.menu.createSubEntry; subEntries = []; - _ref = Config.imageExpansion; - for (name in _ref) { - conf = _ref[name]; + _ref1 = Config.imageExpansion; + for (name in _ref1) { + conf = _ref1[name]; subEntries.push(createSubEntry(name, conf[1])); } return Header.menu.addEntry({ @@ -9781,7 +9817,8 @@ ImageHover = { init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } if (Conf['Image Hover']) { @@ -9897,8 +9934,8 @@ ImageLoader = { init: function() { - var prefetch; - if (g.VIEW === 'catalog') { + var prefetch, _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) { @@ -9913,14 +9950,14 @@ }); if (Conf['Replace WEBM']) { $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', function() { - var qpClone, _ref; - qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0; + var qpClone, _ref1; + qpClone = (_ref1 = $.id('qp')) != null ? _ref1.firstElementChild : void 0; return g.posts.forEach(function(post) { - var thumb, _i, _len, _ref1, _ref2; - _ref1 = [post].concat(__slice.call(post.clones)); - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - post = _ref1[_i]; - if (!((_ref2 = post.file) != null ? _ref2.videoThumb : void 0)) { + var thumb, _i, _len, _ref2, _ref3; + _ref2 = [post].concat(__slice.call(post.clones)); + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + post = _ref2[_i]; + if (!((_ref3 = post.file) != null ? _ref3.videoThumb : void 0)) { continue; } thumb = post.file.thumb; @@ -10034,7 +10071,8 @@ RevealSpoilers = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reveal Spoiler Thumbnails']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reveal Spoiler Thumbnails']) { return; } return Post.callbacks.push({ @@ -10055,14 +10093,14 @@ Sauce = { init: function() { - var err, link, links, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Sauce']) { + var err, link, links, _i, _len, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Sauce']) { return; } links = []; - _ref = Conf['sauces'].split('\n'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; + _ref1 = Conf['sauces'].split('\n'); + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + link = _ref1[_i]; try { if (link[0] !== '#') { links.push(link.trim()); @@ -10803,7 +10841,8 @@ Linkify = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Linkify']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Linkify']) { return; } if (Conf['Comment Expansion']) { @@ -10943,8 +10982,8 @@ ArchiveLink = { init: function() { - var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { + var div, entry, type, _i, _len, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Archive Link']) { return; } div = $.el('div', { @@ -10964,9 +11003,9 @@ }, subEntries: [] }; - _ref = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; entry.subEntries.push(this.createSubEntry(type[0], type[1])); } return Menu.menu.addEntry(entry); @@ -11009,8 +11048,8 @@ DeleteLink = { init: function() { - var div, fileEl, fileEntry, postEl, postEntry; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { + var div, fileEl, fileEntry, postEl, postEntry, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Delete Link']) { return; } div = $.el('div', { @@ -11147,8 +11186,8 @@ DownloadLink = { init: function() { - var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { + var a, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Download Link']) { return; } a = $.el('a', { @@ -11190,7 +11229,8 @@ Menu = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Menu']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu']) { return; } this.button = $.el('a', { @@ -11231,8 +11271,8 @@ ReportLink = { init: function() { - var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { + var a, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Report Link']) { return; } a = $.el('a', { @@ -13283,6 +13323,7 @@ selector = (function() { switch (g.VIEW) { case 'thread': + case 'archive': return '.navLinks.desktop > a'; case 'catalog': return '.navLinks > :first-child > a'; @@ -13688,7 +13729,8 @@ FileInfo = { init: function() { - if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['File Info Formatting']) { return; } return Post.callbacks.push({ @@ -13806,7 +13848,8 @@ Fourchan = { init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } if (g.BOARD.ID === 'g') { @@ -13866,7 +13909,8 @@ IDColor = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Color User IDs']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Color User IDs']) { return; } this.ids = {}; @@ -13914,7 +13958,8 @@ IDHighlight = { init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } return Post.callbacks.push({ @@ -13974,7 +14019,7 @@ return Conf[hotkey] = key; }, keydown: function(e) { - var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2; + var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; if (!(key = Keybinds.keyCode(e))) { return; } @@ -13984,7 +14029,7 @@ return; } } - if (!(g.VIEW === 'catalog' || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) { + if (!(((_ref1 = g.VIEW) !== 'index' && _ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) { threadRoot = Nav.getThread(); if (op = $('.op', threadRoot)) { thread = Get.postFromNode(op).thread; @@ -14107,19 +14152,19 @@ Keybinds.img(threadRoot, true); break; case Conf['Open Gallery']: - if (g.VIEW === 'catalog') { + if ((_ref2 = g.VIEW) !== 'index' && _ref2 !== 'thread') { return; } Gallery.cb.toggle(); break; case Conf['fappeTyme']: - if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { + if (!Conf['Fappe Tyme'] || ((_ref3 = g.VIEW) !== 'index' && _ref3 !== 'thread') || g.BOARD === 'f') { return; } FappeTyme.toggle('fappe'); break; case Conf['werkTyme']: - if (!Conf['Werk Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { + if (!Conf['Werk Tyme'] || ((_ref4 = g.VIEW) !== 'index' && _ref4 !== 'thread') || g.BOARD === 'f') { return; } FappeTyme.toggle('werk'); @@ -14139,7 +14184,7 @@ return; } if (Conf['JSON Navigation']) { - if ((_ref1 = Conf['Index Mode']) !== 'paged' && _ref1 !== 'infinite') { + if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') { return; } $('.next button', Index.pagelist).click(); @@ -14154,7 +14199,7 @@ return; } if (Conf['JSON Navigation']) { - if ((_ref2 = Conf['Index Mode']) !== 'paged' && _ref2 !== 'infinite') { + if ((_ref6 = Conf['Index Mode']) !== 'paged' && _ref6 !== 'infinite') { return; } $('.prev button', Index.pagelist).click(); @@ -14503,7 +14548,8 @@ RelativeDates = { INTERVAL: $.MINUTE / 2, init: function() { - if (g.VIEW !== 'catalog' && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') { + var _ref; + if (((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') { this.flush(); $.on(d, 'visibilitychange ThreadUpdate', this.flush); } @@ -14609,14 +14655,22 @@ name: 'Reveal Spoilers', cb: this.node }); - return CatalogThread.callbacks.push({ + CatalogThread.callbacks.push({ name: 'Reveal Spoilers', cb: this.node }); + if (g.VIEW === 'archive') { + return $.ready(function() { + return RemoveSpoilers.unspoiler($.id('arc-list')); + }); + } }, node: function(post) { + return RemoveSpoilers.unspoiler(this.nodes.comment); + }, + unspoiler: function(el) { var span, spoiler, spoilers, _i, _len; - spoilers = $$('s', this.nodes.comment); + spoilers = $$('s', el); for (_i = 0, _len = spoilers.length; _i < _len; _i++) { spoiler = spoilers[_i]; span = $.el('span', { @@ -14630,7 +14684,8 @@ Time = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Time Formatting']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Time Formatting']) { return; } return Post.callbacks.push({ @@ -15422,6 +15477,8 @@ return 'thread'; case 'catalog': return 'catalog'; + case 'archive': + return 'archive'; default: return 'index'; } diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 8f07324bb..9693b92b5 100644 Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index c699070ad..07f5c9ca5 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.9.19.2 +// @version 1.9.19.3 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 814a6a8a1..e745e1a58 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.9.19.2 +// @version 1.9.19.3 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -25,7 +25,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.9.19.2 +* 4chan X - Version 1.9.19.3 * * Licensed under the MIT license. * https://github.com/ccd0/4chan-x/blob/master/LICENSE @@ -395,7 +395,7 @@ doc = d.documentElement; g = { - VERSION: '1.9.19.2', + VERSION: '1.9.19.3', NAMESPACE: '4chan X.', NAME: '4chan X', FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions', @@ -2671,10 +2671,13 @@ className: 'navLinks' }); $.extend(this.navLinks, { - innerHTML: "Return Catalog Bottom ×" + innerHTML: "Return Catalog Archive Bottom ×" }); $('.returnlink a', this.navLinks).href = CatalogLinks.index(); $('.cataloglink a', this.navLinks).href = CatalogLinks.catalog(); + if (g.BOARD.ID === 'b') { + $('.archlistlink', this.navLinks).hidden = true; + } this.searchInput = $('#index-search', this.navLinks); this.setupSearch(); this.hideLabel = $('#hidden-label', this.navLinks); @@ -4834,9 +4837,13 @@ Anonymize = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Anonymize']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread' && _ref !== 'archive') || !Conf['Anonymize']) { return; } + if (g.VIEW === 'archive') { + return this.archive(); + } return Post.callbacks.push({ name: 'Anonymize', cb: this.node @@ -4859,14 +4866,31 @@ $.replace(email, name); return delete this.nodes.email; } + }, + archive: function() { + return $.ready(function() { + var name, trip, _i, _j, _len, _len1, _ref, _ref1, _results; + _ref = $$('.name'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + name = _ref[_i]; + name.textContent = 'Anonymous'; + } + _ref1 = $$('.postertrip'); + _results = []; + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + trip = _ref1[_j]; + _results.push($.rm(trip)); + } + return _results; + }); } }; Filter = { filters: {}, init: function() { - var boards, err, filter, hl, key, line, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5; - if (g.VIEW === 'catalog' || !Conf['Filter']) { + var boards, err, filter, hl, key, line, op, regexp, stub, top, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Filter']) { return; } if (!Conf['Filtered Backlinks']) { @@ -4874,9 +4898,9 @@ } for (key in Config.filter) { this.filters[key] = []; - _ref = Conf[key].split('\n'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - line = _ref[_i]; + _ref1 = Conf[key].split('\n'); + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + line = _ref1[_i]; if (line[0] === '#') { continue; } @@ -4884,8 +4908,8 @@ continue; } filter = line.replace(regexp[0], ''); - boards = ((_ref1 = filter.match(/boards:([^;]+)/)) != null ? _ref1[1].toLowerCase() : void 0) || 'global'; - if (boards !== 'global' && (_ref2 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref2) < 0)) { + boards = ((_ref2 = filter.match(/boards:([^;]+)/)) != null ? _ref2[1].toLowerCase() : void 0) || 'global'; + if (boards !== 'global' && (_ref3 = g.BOARD.ID, __indexOf.call(boards.split(','), _ref3) < 0)) { continue; } if (key === 'uniqueID' || key === 'MD5') { @@ -4899,10 +4923,10 @@ continue; } } - op = ((_ref3 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref3[1] : void 0) || 'yes'; + op = ((_ref4 = filter.match(/[^t]op:(yes|no|only)/)) != null ? _ref4[1] : void 0) || 'yes'; stub = (function() { - var _ref4; - switch ((_ref4 = filter.match(/stub:(yes|no)/)) != null ? _ref4[1] : void 0) { + var _ref5; + switch ((_ref5 = filter.match(/stub:(yes|no)/)) != null ? _ref5[1] : void 0) { case 'yes': return true; case 'no': @@ -4912,8 +4936,8 @@ } })(); if (hl = /highlight/.test(filter)) { - hl = ((_ref4 = filter.match(/highlight:(\w+)/)) != null ? _ref4[1] : void 0) || 'filter-highlight'; - top = ((_ref5 = filter.match(/top:(yes|no)/)) != null ? _ref5[1] : void 0) || 'yes'; + hl = ((_ref5 = filter.match(/highlight:(\w+)/)) != null ? _ref5[1] : void 0) || 'filter-highlight'; + top = ((_ref6 = filter.match(/top:(yes|no)/)) != null ? _ref6[1] : void 0) || 'yes'; top = top === 'yes'; } this.filters[key].push(this.createFilter(regexp, op, stub, hl, top)); @@ -5059,8 +5083,8 @@ }, menu: { init: function() { - var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Filter']) { + var div, entry, type, _i, _len, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Filter']) { return; } div = $.el('div', { @@ -5075,9 +5099,9 @@ }, subEntries: [] }; - _ref = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = [['Name', 'name'], ['Unique ID', 'uniqueID'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Comment', 'comment'], ['Flag', 'flag'], ['Filename', 'filename'], ['Image dimensions', 'dimensions'], ['Filesize', 'filesize'], ['Image MD5', 'MD5']]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; entry.subEntries.push(Filter.menu.createSubEntry(type[0], type[1])); } return Menu.menu.addEntry(entry); @@ -5134,7 +5158,8 @@ PostHiding = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link'])) { return; } if (Conf['Reply Hiding Buttons']) { @@ -5170,8 +5195,8 @@ }, menu: { init: function() { - var apply, div, hideStubLink, makeStub, replies, thisPost; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Reply Hiding Link']) { + var apply, div, hideStubLink, makeStub, replies, thisPost, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Reply Hiding Link']) { return; } div = $.el('div', { @@ -5430,7 +5455,8 @@ Recursive = { recursives: {}, init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } return Post.callbacks.push({ @@ -5493,7 +5519,8 @@ ThreadHiding = { init: function() { - if (g.VIEW === 'thread' || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'catalog') || !Conf['Thread Hiding Buttons'] && !(Conf['Menu'] && Conf['Thread Hiding Link']) && !Conf['JSON Navigation']) { return; } this.db = new DataBoard('hiddenThreads'); @@ -5765,7 +5792,8 @@ QuoteBacklink = { containers: {}, init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Backlinks']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Backlinks']) { return; } Post.callbacks.push({ @@ -5850,7 +5878,8 @@ QuoteCT = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark Cross-thread Quotes']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark Cross-thread Quotes']) { return; } if (Conf['Comment Expansion']) { @@ -5887,7 +5916,8 @@ QuoteInline = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Inlining']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Inlining']) { return; } this.process = Conf['Quote Hash Navigation'] ? function(link, clone) { @@ -6006,7 +6036,8 @@ QuoteOP = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Mark OP Quotes']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Mark OP Quotes']) { return; } if (Conf['Comment Expansion']) { @@ -6049,7 +6080,8 @@ QuotePreview = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Quote Previewing']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Quote Previewing']) { return; } if (Conf['Comment Expansion']) { @@ -6132,7 +6164,8 @@ QuoteStrikeThrough = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link']) && !Conf['Filter']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reply Hiding Buttons'] && !(Conf['Menu'] && Conf['Reply Hiding Link']) && !Conf['Filter']) { return; } return Post.callbacks.push({ @@ -6336,7 +6369,8 @@ QuoteYou = { init: function() { - if (!(g.VIEW !== 'catalog' && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) { + var _ref; + if (!(((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Mark Quotes of You'] && Conf['Quick Reply'])) { return; } if (Conf['Highlight Own Posts']) { @@ -6425,7 +6459,8 @@ Quotify = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Resurrect Quotes'] && g.BOARD.ID !== 'pol') { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Resurrect Quotes'] && g.BOARD.ID !== 'pol') { return; } if (Conf['Comment Expansion']) { @@ -8759,8 +8794,8 @@ FappeTyme = { init: function() { - var el, lc, type, _i, _len, _ref; - if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || g.VIEW === 'catalog' || g.BOARD === 'f') { + var el, lc, type, _i, _len, _ref, _ref1; + if (!(Conf['Fappe Tyme'] || Conf['Werk Tyme']) || ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || g.BOARD === 'f') { return; } this.nodes = {}; @@ -8768,9 +8803,9 @@ fappe: false, werk: Conf['werk'] }; - _ref = ["Fappe", "Werk"]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = ["Fappe", "Werk"]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; if (!Conf["" + type + " Tyme"]) { continue; } @@ -8831,8 +8866,8 @@ Gallery = { init: function() { - var el; - if (g.VIEW === 'catalog' || g.BOARD === 'f' || !Conf['Gallery']) { + var el, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || g.BOARD === 'f' || !Conf['Gallery']) { return; } this.delay = Conf['Slide Delay']; @@ -9219,8 +9254,8 @@ }, menu: { init: function() { - var el; - if (g.VIEW === 'catalog' || !Conf['Gallery']) { + var el, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Gallery']) { return; } el = $.el('span', { @@ -9379,7 +9414,8 @@ ImageExpand = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Image Expansion']) { return; } this.EAI = $.el('a', { @@ -9742,8 +9778,8 @@ }, menu: { init: function() { - var conf, createSubEntry, el, name, subEntries, _ref; - if (g.VIEW === 'catalog' || !Conf['Image Expansion']) { + var conf, createSubEntry, el, name, subEntries, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Image Expansion']) { return; } el = $.el('span', { @@ -9752,9 +9788,9 @@ }); createSubEntry = ImageExpand.menu.createSubEntry; subEntries = []; - _ref = Config.imageExpansion; - for (name in _ref) { - conf = _ref[name]; + _ref1 = Config.imageExpansion; + for (name in _ref1) { + conf = _ref1[name]; subEntries.push(createSubEntry(name, conf[1])); } return Header.menu.addEntry({ @@ -9782,7 +9818,8 @@ ImageHover = { init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } if (Conf['Image Hover']) { @@ -9898,8 +9935,8 @@ ImageLoader = { init: function() { - var prefetch; - if (g.VIEW === 'catalog') { + var prefetch, _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } if (!(Conf['Image Prefetching'] || Conf['Replace JPG'] || Conf['Replace PNG'] || Conf['Replace GIF'] || Conf['Replace WEBM'])) { @@ -9914,14 +9951,14 @@ }); if (Conf['Replace WEBM']) { $.on(d, 'scroll visibilitychange 4chanXInitFinished PostsInserted', function() { - var qpClone, _ref; - qpClone = (_ref = $.id('qp')) != null ? _ref.firstElementChild : void 0; + var qpClone, _ref1; + qpClone = (_ref1 = $.id('qp')) != null ? _ref1.firstElementChild : void 0; return g.posts.forEach(function(post) { - var thumb, _i, _len, _ref1, _ref2; - _ref1 = [post].concat(__slice.call(post.clones)); - for (_i = 0, _len = _ref1.length; _i < _len; _i++) { - post = _ref1[_i]; - if (!((_ref2 = post.file) != null ? _ref2.videoThumb : void 0)) { + var thumb, _i, _len, _ref2, _ref3; + _ref2 = [post].concat(__slice.call(post.clones)); + for (_i = 0, _len = _ref2.length; _i < _len; _i++) { + post = _ref2[_i]; + if (!((_ref3 = post.file) != null ? _ref3.videoThumb : void 0)) { continue; } thumb = post.file.thumb; @@ -10035,7 +10072,8 @@ RevealSpoilers = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Reveal Spoiler Thumbnails']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Reveal Spoiler Thumbnails']) { return; } return Post.callbacks.push({ @@ -10056,14 +10094,14 @@ Sauce = { init: function() { - var err, link, links, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Sauce']) { + var err, link, links, _i, _len, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Sauce']) { return; } links = []; - _ref = Conf['sauces'].split('\n'); - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - link = _ref[_i]; + _ref1 = Conf['sauces'].split('\n'); + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + link = _ref1[_i]; try { if (link[0] !== '#') { links.push(link.trim()); @@ -10804,7 +10842,8 @@ Linkify = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Linkify']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Linkify']) { return; } if (Conf['Comment Expansion']) { @@ -10944,8 +10983,8 @@ ArchiveLink = { init: function() { - var div, entry, type, _i, _len, _ref; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Archive Link']) { + var div, entry, type, _i, _len, _ref, _ref1; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Archive Link']) { return; } div = $.el('div', { @@ -10965,9 +11004,9 @@ }, subEntries: [] }; - _ref = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - type = _ref[_i]; + _ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; + for (_i = 0, _len = _ref1.length; _i < _len; _i++) { + type = _ref1[_i]; entry.subEntries.push(this.createSubEntry(type[0], type[1])); } return Menu.menu.addEntry(entry); @@ -11010,8 +11049,8 @@ DeleteLink = { init: function() { - var div, fileEl, fileEntry, postEl, postEntry; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Delete Link']) { + var div, fileEl, fileEntry, postEl, postEntry, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Delete Link']) { return; } div = $.el('div', { @@ -11148,8 +11187,8 @@ DownloadLink = { init: function() { - var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Download Link']) { + var a, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Download Link']) { return; } a = $.el('a', { @@ -11191,7 +11230,8 @@ Menu = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Menu']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu']) { return; } this.button = $.el('a', { @@ -11232,8 +11272,8 @@ ReportLink = { init: function() { - var a; - if (g.VIEW === 'catalog' || !Conf['Menu'] || !Conf['Report Link']) { + var a, _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Menu'] || !Conf['Report Link']) { return; } a = $.el('a', { @@ -13284,6 +13324,7 @@ selector = (function() { switch (g.VIEW) { case 'thread': + case 'archive': return '.navLinks.desktop > a'; case 'catalog': return '.navLinks > :first-child > a'; @@ -13689,7 +13730,8 @@ FileInfo = { init: function() { - if (g.VIEW === 'catalog' || !Conf['File Info Formatting']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['File Info Formatting']) { return; } return Post.callbacks.push({ @@ -13807,7 +13849,8 @@ Fourchan = { init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } if (g.BOARD.ID === 'g') { @@ -13867,7 +13910,8 @@ IDColor = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Color User IDs']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Color User IDs']) { return; } this.ids = {}; @@ -13915,7 +13959,8 @@ IDHighlight = { init: function() { - if (g.VIEW === 'catalog') { + var _ref; + if ((_ref = g.VIEW) !== 'index' && _ref !== 'thread') { return; } return Post.callbacks.push({ @@ -13975,7 +14020,7 @@ return Conf[hotkey] = key; }, keydown: function(e) { - var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2; + var form, key, notification, notifications, op, searchInput, target, thread, threadRoot, _i, _len, _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6; if (!(key = Keybinds.keyCode(e))) { return; } @@ -13985,7 +14030,7 @@ return; } } - if (!(g.VIEW === 'catalog' || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) { + if (!(((_ref1 = g.VIEW) !== 'index' && _ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) { threadRoot = Nav.getThread(); if (op = $('.op', threadRoot)) { thread = Get.postFromNode(op).thread; @@ -14108,19 +14153,19 @@ Keybinds.img(threadRoot, true); break; case Conf['Open Gallery']: - if (g.VIEW === 'catalog') { + if ((_ref2 = g.VIEW) !== 'index' && _ref2 !== 'thread') { return; } Gallery.cb.toggle(); break; case Conf['fappeTyme']: - if (!Conf['Fappe Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { + if (!Conf['Fappe Tyme'] || ((_ref3 = g.VIEW) !== 'index' && _ref3 !== 'thread') || g.BOARD === 'f') { return; } FappeTyme.toggle('fappe'); break; case Conf['werkTyme']: - if (!Conf['Werk Tyme'] || g.VIEW === 'catalog' || g.BOARD === 'f') { + if (!Conf['Werk Tyme'] || ((_ref4 = g.VIEW) !== 'index' && _ref4 !== 'thread') || g.BOARD === 'f') { return; } FappeTyme.toggle('werk'); @@ -14140,7 +14185,7 @@ return; } if (Conf['JSON Navigation']) { - if ((_ref1 = Conf['Index Mode']) !== 'paged' && _ref1 !== 'infinite') { + if ((_ref5 = Conf['Index Mode']) !== 'paged' && _ref5 !== 'infinite') { return; } $('.next button', Index.pagelist).click(); @@ -14155,7 +14200,7 @@ return; } if (Conf['JSON Navigation']) { - if ((_ref2 = Conf['Index Mode']) !== 'paged' && _ref2 !== 'infinite') { + if ((_ref6 = Conf['Index Mode']) !== 'paged' && _ref6 !== 'infinite') { return; } $('.prev button', Index.pagelist).click(); @@ -14504,7 +14549,8 @@ RelativeDates = { INTERVAL: $.MINUTE / 2, init: function() { - if (g.VIEW !== 'catalog' && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') { + var _ref; + if (((_ref = g.VIEW) === 'index' || _ref === 'thread') && Conf['Relative Post Dates'] && !Conf['Relative Date Title'] || g.VIEW === 'index' && Conf['JSON Navigation'] && g.BOARD.ID !== 'f') { this.flush(); $.on(d, 'visibilitychange ThreadUpdate', this.flush); } @@ -14610,14 +14656,22 @@ name: 'Reveal Spoilers', cb: this.node }); - return CatalogThread.callbacks.push({ + CatalogThread.callbacks.push({ name: 'Reveal Spoilers', cb: this.node }); + if (g.VIEW === 'archive') { + return $.ready(function() { + return RemoveSpoilers.unspoiler($.id('arc-list')); + }); + } }, node: function(post) { + return RemoveSpoilers.unspoiler(this.nodes.comment); + }, + unspoiler: function(el) { var span, spoiler, spoilers, _i, _len; - spoilers = $$('s', this.nodes.comment); + spoilers = $$('s', el); for (_i = 0, _len = spoilers.length; _i < _len; _i++) { spoiler = spoilers[_i]; span = $.el('span', { @@ -14631,7 +14685,8 @@ Time = { init: function() { - if (g.VIEW === 'catalog' || !Conf['Time Formatting']) { + var _ref; + if (((_ref = g.VIEW) !== 'index' && _ref !== 'thread') || !Conf['Time Formatting']) { return; } return Post.callbacks.push({ @@ -15423,6 +15478,8 @@ return 'thread'; case 'catalog': return 'catalog'; + case 'archive': + return 'archive'; default: return 'index'; } diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index f4ae01a02..f5765fdcc 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index fb9d6ce66..cc8b0c6e9 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.xml b/builds/updates.xml index 3a312feb8..6e97db495 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index 0a7604ab0..d279ff9de 100755 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", - "version": "1.9.19.2", + "version": "1.9.19.3", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/",