diff --git a/CHANGELOG.md b/CHANGELOG.md index 2942002f1..a6b21be92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor ### v1.11.30 +**v1.11.30.1** *(2016-04-04)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.30.1/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.30.1/builds/4chan-X-noupdate.crx "Chromium version")] +- Scrolling to a post hidden by `Reply Pruning` unhides the posts. This includes `Scroll to Last Read Post`. +- Opening a thread by the link to the OP turns unhides the posts hidden by `Reply Pruning`. +- The `Show Last ___` checkbox to hide or show the posts hidden by `Reply Pruning` is no longer persistent. If `Reply Pruning` is enabled, it will be turned on when the thread is opened unless there is a reason for it to be turned off (quote threading, linking to a hidden post or the OP). + **v1.11.30.0** *(2016-04-03)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.30.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.30.0/builds/4chan-X-noupdate.crx "Chromium version")] - Based on v1.11.29.6. - 4chan X now remembers the state of the `Threading` checkbox added to the header menu by the `Quote Threading` feature. This allows you to have threading off by default, yet turn it on when you want it without reloading the page. By default `Quote Threading` will now be on with the `Threading` checkbox off. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 801379785..ee50bd0c3 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 27ea74493..e62b3c179 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.11.30.0 +// @version 1.11.30.1 // @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 7d2e86142..5346f7c35 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.11.30.0 +// @version 1.11.30.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -430,10 +430,7 @@ customCooldown: 0, customCooldownEnabled: true, 'Thread Quotes': false, - replyPruning: { - 'Prune Replies': true, - 'Max Replies': 1000 - }, + 'Max Replies': 1000, 'Autohiding Scrollbar': false }; @@ -446,7 +443,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.30.0', + VERSION: '1.11.30.1', NAMESPACE: '4chan X.', boards: {} }; @@ -3159,10 +3156,13 @@ history.replaceState({}, ''); } } - if ((hash = location.hash.slice(1)) && (el = $.id(hash))) { - return $.queueTask(function() { - return Header.scrollTo(el); - }); + if ((hash = location.hash.slice(1))) { + ReplyPruning.showIfHidden(hash); + if ((el = $.id(hash))) { + return $.queueTask(function() { + return Header.scrollTo(el); + }); + } } }, scrollTo: function(root, down, needed) { @@ -13251,10 +13251,7 @@ if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) { return; } - if (Conf['Quote Threading'] && Conf['Thread Quotes'] && Conf['Prune Replies']) { - Conf['Prune Replies'] = false; - $.set('Prune Replies', false); - } + this.active = !(Conf['Quote Threading'] && Conf['Thread Quotes']); this.container = $.frag(); this.summary = $.el('span', { hidden: true, @@ -13267,7 +13264,7 @@ return $.event('change', null, _this.inputs.enabled); }; })(this)); - label = UI.checkbox('Prune Replies', 'Show Last'); + label = UI.checkbox('Prune Replies', 'Show Last', this.active); el = $.el('span', { title: 'Maximum number of replies to show.' }, { @@ -13301,9 +13298,17 @@ other.checked = false; $.event('change', null, other); } - return $.cb.checked.call(this); + return ReplyPruning.active = this.checked; + }, + showIfHidden: function(id) { + var ref; + if ((ref = ReplyPruning.container) != null ? ref.getElementById(id) : void 0) { + ReplyPruning.inputs.enabled.checked = false; + return $.event('change', null, ReplyPruning.inputs.enabled); + } }, node: function() { + var ref; ReplyPruning.thread = this; this.posts.forEach(function(post) { if (post.isReply) { @@ -13313,6 +13318,9 @@ } } }); + if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (0 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) { + ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false; + } $.after(this.OP.nodes.root, ReplyPruning.summary); $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update); $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update); @@ -13336,7 +13344,7 @@ }, update: function() { var frag, hidden2, post, posts; - hidden2 = Conf['Prune Replies'] ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0; + hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0; posts = ReplyPruning.thread.posts; if (ReplyPruning.hidden < hidden2) { while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) { @@ -13364,7 +13372,7 @@ $.after(ReplyPruning.summary, frag); $.event('PostsInserted'); } - ReplyPruning.summary.textContent = Conf['Prune Replies'] ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); + ReplyPruning.summary.textContent = ReplyPruning.active ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); return ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"]; } }; @@ -14772,12 +14780,12 @@ return $.on(d, 'ThreadUpdate', Unread.onUpdate); }, ready: function() { - Unread.setLine(true); - Unread.read(); - Unread.update(); if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) { Unread.scroll(); } + Unread.setLine(true); + Unread.read(); + Unread.update(); $.on(d, 'scroll visibilitychange', Unread.read); if (Conf['Unread Line']) { return $.on(d, 'visibilitychange', Unread.setLine); @@ -14791,10 +14799,11 @@ } }, scroll: function() { - var hash, position, root; + var hash, position, ref, root; if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { return; } + ReplyPruning.showIfHidden((ref = Unread.position) != null ? ref.data.nodes.root.id : void 0); position = Unread.positionPrev(); while (position) { root = position.data.nodes.root; @@ -14981,7 +14990,7 @@ return; } if (Unread.hr.hidden || d.hidden || (force === true)) { - if (Unread.linePosition = Unread.positionPrev()) { + if ((Unread.linePosition = Unread.positionPrev())) { $.after(Unread.linePosition.data.nodes.root, Unread.hr); } else { $.rm(Unread.hr); diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index b4c1ea82c..e4560eb00 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 5990e81de..a79493511 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.11.30.0 +// @version 1.11.30.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -430,10 +430,7 @@ customCooldown: 0, customCooldownEnabled: true, 'Thread Quotes': false, - replyPruning: { - 'Prune Replies': true, - 'Max Replies': 1000 - }, + 'Max Replies': 1000, 'Autohiding Scrollbar': false }; @@ -446,7 +443,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.30.0', + VERSION: '1.11.30.1', NAMESPACE: '4chan X.', boards: {} }; @@ -3159,10 +3156,13 @@ history.replaceState({}, ''); } } - if ((hash = location.hash.slice(1)) && (el = $.id(hash))) { - return $.queueTask(function() { - return Header.scrollTo(el); - }); + if ((hash = location.hash.slice(1))) { + ReplyPruning.showIfHidden(hash); + if ((el = $.id(hash))) { + return $.queueTask(function() { + return Header.scrollTo(el); + }); + } } }, scrollTo: function(root, down, needed) { @@ -13251,10 +13251,7 @@ if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) { return; } - if (Conf['Quote Threading'] && Conf['Thread Quotes'] && Conf['Prune Replies']) { - Conf['Prune Replies'] = false; - $.set('Prune Replies', false); - } + this.active = !(Conf['Quote Threading'] && Conf['Thread Quotes']); this.container = $.frag(); this.summary = $.el('span', { hidden: true, @@ -13267,7 +13264,7 @@ return $.event('change', null, _this.inputs.enabled); }; })(this)); - label = UI.checkbox('Prune Replies', 'Show Last'); + label = UI.checkbox('Prune Replies', 'Show Last', this.active); el = $.el('span', { title: 'Maximum number of replies to show.' }, { @@ -13301,9 +13298,17 @@ other.checked = false; $.event('change', null, other); } - return $.cb.checked.call(this); + return ReplyPruning.active = this.checked; + }, + showIfHidden: function(id) { + var ref; + if ((ref = ReplyPruning.container) != null ? ref.getElementById(id) : void 0) { + ReplyPruning.inputs.enabled.checked = false; + return $.event('change', null, ReplyPruning.inputs.enabled); + } }, node: function() { + var ref; ReplyPruning.thread = this; this.posts.forEach(function(post) { if (post.isReply) { @@ -13313,6 +13318,9 @@ } } }); + if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (0 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) { + ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false; + } $.after(this.OP.nodes.root, ReplyPruning.summary); $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update); $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update); @@ -13336,7 +13344,7 @@ }, update: function() { var frag, hidden2, post, posts; - hidden2 = Conf['Prune Replies'] ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0; + hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0; posts = ReplyPruning.thread.posts; if (ReplyPruning.hidden < hidden2) { while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) { @@ -13364,7 +13372,7 @@ $.after(ReplyPruning.summary, frag); $.event('PostsInserted'); } - ReplyPruning.summary.textContent = Conf['Prune Replies'] ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); + ReplyPruning.summary.textContent = ReplyPruning.active ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); return ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"]; } }; @@ -14772,12 +14780,12 @@ return $.on(d, 'ThreadUpdate', Unread.onUpdate); }, ready: function() { - Unread.setLine(true); - Unread.read(); - Unread.update(); if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) { Unread.scroll(); } + Unread.setLine(true); + Unread.read(); + Unread.update(); $.on(d, 'scroll visibilitychange', Unread.read); if (Conf['Unread Line']) { return $.on(d, 'visibilitychange', Unread.setLine); @@ -14791,10 +14799,11 @@ } }, scroll: function() { - var hash, position, root; + var hash, position, ref, root; if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { return; } + ReplyPruning.showIfHidden((ref = Unread.position) != null ? ref.data.nodes.root.id : void 0); position = Unread.positionPrev(); while (position) { root = position.data.nodes.root; @@ -14981,7 +14990,7 @@ return; } if (Unread.hr.hidden || d.hidden || (force === true)) { - if (Unread.linePosition = Unread.positionPrev()) { + if ((Unread.linePosition = Unread.positionPrev())) { $.after(Unread.linePosition.data.nodes.root, Unread.hr); } else { $.rm(Unread.hr); diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 80936f268..9e89d8436 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 3298bf66a..7f7826dbe 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.11.30.0 +// @version 1.11.30.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 20e5ef8f9..2a1e8da29 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.11.30.0 +// @version 1.11.30.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -430,10 +430,7 @@ customCooldown: 0, customCooldownEnabled: true, 'Thread Quotes': false, - replyPruning: { - 'Prune Replies': true, - 'Max Replies': 1000 - }, + 'Max Replies': 1000, 'Autohiding Scrollbar': false }; @@ -446,7 +443,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.30.0', + VERSION: '1.11.30.1', NAMESPACE: '4chan X.', boards: {} }; @@ -3159,10 +3156,13 @@ history.replaceState({}, ''); } } - if ((hash = location.hash.slice(1)) && (el = $.id(hash))) { - return $.queueTask(function() { - return Header.scrollTo(el); - }); + if ((hash = location.hash.slice(1))) { + ReplyPruning.showIfHidden(hash); + if ((el = $.id(hash))) { + return $.queueTask(function() { + return Header.scrollTo(el); + }); + } } }, scrollTo: function(root, down, needed) { @@ -13251,10 +13251,7 @@ if (!(g.VIEW === 'thread' && Conf['Reply Pruning'])) { return; } - if (Conf['Quote Threading'] && Conf['Thread Quotes'] && Conf['Prune Replies']) { - Conf['Prune Replies'] = false; - $.set('Prune Replies', false); - } + this.active = !(Conf['Quote Threading'] && Conf['Thread Quotes']); this.container = $.frag(); this.summary = $.el('span', { hidden: true, @@ -13267,7 +13264,7 @@ return $.event('change', null, _this.inputs.enabled); }; })(this)); - label = UI.checkbox('Prune Replies', 'Show Last'); + label = UI.checkbox('Prune Replies', 'Show Last', this.active); el = $.el('span', { title: 'Maximum number of replies to show.' }, { @@ -13301,9 +13298,17 @@ other.checked = false; $.event('change', null, other); } - return $.cb.checked.call(this); + return ReplyPruning.active = this.checked; + }, + showIfHidden: function(id) { + var ref; + if ((ref = ReplyPruning.container) != null ? ref.getElementById(id) : void 0) { + ReplyPruning.inputs.enabled.checked = false; + return $.event('change', null, ReplyPruning.inputs.enabled); + } }, node: function() { + var ref; ReplyPruning.thread = this; this.posts.forEach(function(post) { if (post.isReply) { @@ -13313,6 +13318,9 @@ } } }); + if (ReplyPruning.active && /^#p\d+$/.test(location.hash) && (0 <= (ref = this.posts.keys.indexOf(location.hash.slice(2))) && ref < 1 + Math.max(ReplyPruning.total - +Conf["Max Replies"], 0))) { + ReplyPruning.active = ReplyPruning.inputs.enabled.checked = false; + } $.after(this.OP.nodes.root, ReplyPruning.summary); $.on(ReplyPruning.inputs.enabled, 'change', ReplyPruning.update); $.on(ReplyPruning.inputs.replies, 'change', ReplyPruning.update); @@ -13336,7 +13344,7 @@ }, update: function() { var frag, hidden2, post, posts; - hidden2 = Conf['Prune Replies'] ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0; + hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0; posts = ReplyPruning.thread.posts; if (ReplyPruning.hidden < hidden2) { while (ReplyPruning.hidden < hidden2 && ReplyPruning.position < posts.keys.length) { @@ -13364,7 +13372,7 @@ $.after(ReplyPruning.summary, frag); $.event('PostsInserted'); } - ReplyPruning.summary.textContent = Conf['Prune Replies'] ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); + ReplyPruning.summary.textContent = ReplyPruning.active ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles); return ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"]; } }; @@ -14772,12 +14780,12 @@ return $.on(d, 'ThreadUpdate', Unread.onUpdate); }, ready: function() { - Unread.setLine(true); - Unread.read(); - Unread.update(); if (Conf['Remember Last Read Post'] && Conf['Scroll to Last Read Post']) { Unread.scroll(); } + Unread.setLine(true); + Unread.read(); + Unread.update(); $.on(d, 'scroll visibilitychange', Unread.read); if (Conf['Unread Line']) { return $.on(d, 'visibilitychange', Unread.setLine); @@ -14791,10 +14799,11 @@ } }, scroll: function() { - var hash, position, root; + var hash, position, ref, root; if ((hash = location.hash.match(/\d+/)) && hash[0] in Unread.thread.posts) { return; } + ReplyPruning.showIfHidden((ref = Unread.position) != null ? ref.data.nodes.root.id : void 0); position = Unread.positionPrev(); while (position) { root = position.data.nodes.root; @@ -14981,7 +14990,7 @@ return; } if (Unread.hr.hidden || d.hidden || (force === true)) { - if (Unread.linePosition = Unread.positionPrev()) { + if ((Unread.linePosition = Unread.positionPrev())) { $.after(Unread.linePosition.data.nodes.root, Unread.hr); } else { $.rm(Unread.hr); diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index f0c83c43d..2f86ebd0c 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 65ae94500..c0c3c22f1 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 4b549933e..bbeb9934f 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index 95ebf7cc2..0ebbce1ce 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.11.30.0", - "date": "2016-04-04T00:26:46.773Z" + "version": "1.11.30.1", + "date": "2016-04-04T07:32:48.540Z" }