diff --git a/CHANGELOG.md b/CHANGELOG.md index ba43bfd0c..fbfa85c51 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor 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.10.11 + +**v1.10.11.0** *(2015-04-24)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.11.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.11.0/builds/4chan-X-noupdate.crx "Chromium version")] +- Based on v1.10.10.2. +- Fix whitespace being stripped from the comment before filtering. This makes it possible to filter whitespace spam. + ### v1.10.10 **v1.10.10.2** *(2015-04-21)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.10.2/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.10.2/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 5505e9b86..2f52e6fd3 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 71eaa6718..dafa763b7 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.10.10.2 +// @version 1.10.11.0 // @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 4b202186e..a45110120 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.10.10.2 +// @version 1.10.11.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -399,7 +399,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.10.2', + VERSION: '1.10.11.0', NAMESPACE: '4chan X.', boards: {} }; @@ -1296,28 +1296,33 @@ } Post.prototype.parseComment = function() { - var bq, k, len1, node, ref, spoilers; + var abbr, bq, commentDisplay, k, len1, len2, node, q, ref, spoilers; this.nodes.comment.normalize(); bq = this.nodes.comment.cloneNode(true); - ref = $$('.abbr, .exif, b, marquee', bq); + ref = $$('.abbr + br, .exif, b, .fortune', bq); for (k = 0, len1 = ref.length; k < len1; k++) { node = ref[k]; $.rm(node); } + if (abbr = $('.abbr', bq)) { + $.rm(abbr); + } this.info.comment = this.nodesToText(bq); - spoilers = $$('s', bq); - return this.info.commentSpoilered = (function() { - var len2, q; + if (abbr) { + this.info.comment = this.info.comment.replace(/\n\n$/, ''); + } + commentDisplay = this.info.comment; + if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) { + spoilers = $$('s', bq); if (spoilers.length) { for (q = 0, len2 = spoilers.length; q < len2; q++) { node = spoilers[q]; $.replace(node, $.tn('[spoiler]')); } - return this.nodesToText(bq); - } else { - return this.info.comment; + commentDisplay = this.nodesToText(bq); } - }).call(this); + } + return this.info.commentDisplay = commentDisplay.trim().replace(/\s+$/gm, ''); }; Post.prototype.nodesToText = function(bq) { @@ -1328,7 +1333,7 @@ while (node = nodes.snapshotItem(i++)) { text += node.data || '\n'; } - return text.trim().replace(/\s+$/gm, ''); + return text; }; Post.prototype.parseQuotes = function() { @@ -4303,7 +4308,7 @@ threadExcerpt: function(thread) { var OP, excerpt, ref; OP = thread.OP; - excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.info.nameBlock); + excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.commentDisplay.replace(/\n+/g, ' // ') || OP.info.nameBlock); if (excerpt.length > 73) { return excerpt.slice(0, 70) + "..."; } @@ -13342,7 +13347,7 @@ return; } notif = new Notification(post.info.nameBlock + " replied to you", { - body: post.info[Conf['Remove Spoilers'] || Conf['Reveal Spoilers'] ? 'comment' : 'commentSpoilered'], + body: post.info.commentDisplay, icon: Favicon.logo }); notif.onclick = function() { diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 5e0298d9f..555a71f3d 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 1f97fce50..e2587d1eb 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.10.10.2 +// @version 1.10.11.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -398,7 +398,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.10.2', + VERSION: '1.10.11.0', NAMESPACE: '4chan X.', boards: {} }; @@ -1295,28 +1295,33 @@ } Post.prototype.parseComment = function() { - var bq, k, len1, node, ref, spoilers; + var abbr, bq, commentDisplay, k, len1, len2, node, q, ref, spoilers; this.nodes.comment.normalize(); bq = this.nodes.comment.cloneNode(true); - ref = $$('.abbr, .exif, b, marquee', bq); + ref = $$('.abbr + br, .exif, b, .fortune', bq); for (k = 0, len1 = ref.length; k < len1; k++) { node = ref[k]; $.rm(node); } + if (abbr = $('.abbr', bq)) { + $.rm(abbr); + } this.info.comment = this.nodesToText(bq); - spoilers = $$('s', bq); - return this.info.commentSpoilered = (function() { - var len2, q; + if (abbr) { + this.info.comment = this.info.comment.replace(/\n\n$/, ''); + } + commentDisplay = this.info.comment; + if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) { + spoilers = $$('s', bq); if (spoilers.length) { for (q = 0, len2 = spoilers.length; q < len2; q++) { node = spoilers[q]; $.replace(node, $.tn('[spoiler]')); } - return this.nodesToText(bq); - } else { - return this.info.comment; + commentDisplay = this.nodesToText(bq); } - }).call(this); + } + return this.info.commentDisplay = commentDisplay.trim().replace(/\s+$/gm, ''); }; Post.prototype.nodesToText = function(bq) { @@ -1327,7 +1332,7 @@ while (node = nodes.snapshotItem(i++)) { text += node.data || '\n'; } - return text.trim().replace(/\s+$/gm, ''); + return text; }; Post.prototype.parseQuotes = function() { @@ -4302,7 +4307,7 @@ threadExcerpt: function(thread) { var OP, excerpt, ref; OP = thread.OP; - excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.info.nameBlock); + excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.commentDisplay.replace(/\n+/g, ' // ') || OP.info.nameBlock); if (excerpt.length > 73) { return excerpt.slice(0, 70) + "..."; } @@ -13341,7 +13346,7 @@ return; } notif = new Notification(post.info.nameBlock + " replied to you", { - body: post.info[Conf['Remove Spoilers'] || Conf['Reveal Spoilers'] ? 'comment' : 'commentSpoilered'], + body: post.info.commentDisplay, icon: Favicon.logo }); notif.onclick = function() { diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 93823df37..da86a1c38 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 f02d3603c..6fb9d8cfc 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.10.10.2 +// @version 1.10.11.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index d6caeca4a..96d196ca3 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.10.10.2 +// @version 1.10.11.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -399,7 +399,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.10.2', + VERSION: '1.10.11.0', NAMESPACE: '4chan X.', boards: {} }; @@ -1296,28 +1296,33 @@ } Post.prototype.parseComment = function() { - var bq, k, len1, node, ref, spoilers; + var abbr, bq, commentDisplay, k, len1, len2, node, q, ref, spoilers; this.nodes.comment.normalize(); bq = this.nodes.comment.cloneNode(true); - ref = $$('.abbr, .exif, b, marquee', bq); + ref = $$('.abbr + br, .exif, b, .fortune', bq); for (k = 0, len1 = ref.length; k < len1; k++) { node = ref[k]; $.rm(node); } + if (abbr = $('.abbr', bq)) { + $.rm(abbr); + } this.info.comment = this.nodesToText(bq); - spoilers = $$('s', bq); - return this.info.commentSpoilered = (function() { - var len2, q; + if (abbr) { + this.info.comment = this.info.comment.replace(/\n\n$/, ''); + } + commentDisplay = this.info.comment; + if (!(Conf['Remove Spoilers'] || Conf['Reveal Spoilers'])) { + spoilers = $$('s', bq); if (spoilers.length) { for (q = 0, len2 = spoilers.length; q < len2; q++) { node = spoilers[q]; $.replace(node, $.tn('[spoiler]')); } - return this.nodesToText(bq); - } else { - return this.info.comment; + commentDisplay = this.nodesToText(bq); } - }).call(this); + } + return this.info.commentDisplay = commentDisplay.trim().replace(/\s+$/gm, ''); }; Post.prototype.nodesToText = function(bq) { @@ -1328,7 +1333,7 @@ while (node = nodes.snapshotItem(i++)) { text += node.data || '\n'; } - return text.trim().replace(/\s+$/gm, ''); + return text; }; Post.prototype.parseQuotes = function() { @@ -4303,7 +4308,7 @@ threadExcerpt: function(thread) { var OP, excerpt, ref; OP = thread.OP; - excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.info.nameBlock); + excerpt = ("/" + thread.board + "/ - ") + (((ref = OP.info.subject) != null ? ref.trim() : void 0) || OP.info.commentDisplay.replace(/\n+/g, ' // ') || OP.info.nameBlock); if (excerpt.length > 73) { return excerpt.slice(0, 70) + "..."; } @@ -13342,7 +13347,7 @@ return; } notif = new Notification(post.info.nameBlock + " replied to you", { - body: post.info[Conf['Remove Spoilers'] || Conf['Reveal Spoilers'] ? 'comment' : 'commentSpoilered'], + body: post.info.commentDisplay, icon: Favicon.logo }); notif.onclick = function() { diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index bffbfbc11..b61498de6 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 0e0010c56..394584967 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 7364d0dcb..d952a2126 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index 29353e975..8c8dc1cd3 100755 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", - "version": "1.10.10.2", - "date": "2015-04-21T07:37:58.778Z", + "version": "1.10.11.0", + "date": "2015-04-24T08:11:43.462Z", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/",