diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 4d617dc6f..da3d1bf88 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -71,9 +71,6 @@ module.exports = (grunt) -> dest: 'builds/crx/' expand: true flatten: true - nex: - src: 'builds/<%= pkg.name %>.zip' - dest: 'builds/<%= pkg.name %>.nex' coffee: script: @@ -174,7 +171,6 @@ module.exports = (grunt) -> 'shell:push' 'build-crx' 'compress:crx' - 'copy:nex' ] grunt.registerTask 'patch', [ 'bump' diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 0378f4f4e..9f95c99b1 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -4215,10 +4215,11 @@ _ref = this.nodes.quotelinks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { quotelink = _ref[_i]; - if (QR.db.get(Get.postDataFromLink(quotelink))) { - $.add(quotelink, $.tn('\u00A0(You)')); - $.addClass(this.nodes.root, 'quotesYou'); + if (!(QR.db.get(Get.postDataFromLink(quotelink)))) { + continue; } + $.add(quotelink, $.tn('\u00A0(You)')); + $.addClass(this.nodes.root, 'quotesYou'); } }, cb: { @@ -4297,13 +4298,17 @@ var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; if (deadlink.parentNode.className === 'prettyprint') { - $.replace(deadlink, __slice.call(deadlink.childNodes)); + Quotify.fixDeadlink(deadlink); return; } quote = deadlink.textContent; if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) { return; } + if (postID[0] === '0') { + Quotify.fixDeadlink(deadlink); + return; + } boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; quoteID = "" + boardID + "." + postID; if (post = g.posts[quoteID]) { @@ -4359,6 +4364,9 @@ if ($.hasClass(a, 'quotelink')) { return this.nodes.quotelinks.push(a); } + }, + fixDeadlink: function(deadlink) { + return $.replace(deadlink, __slice.call(deadlink.childNodes)); } }; @@ -8536,7 +8544,7 @@ return; } roll = $('b', this.nodes.comment).firstChild; - return roll.data = "Rolled " + dicestats[1] + "d" + dicestats[2] + " and got " + (roll.data.slice(7)); + return roll.data = "Rolled " + dicestats[1] + "d" + dicestats[2] + ": " + (roll.data.slice(7)); } }; diff --git a/builds/crx/script.js b/builds/crx/script.js index 03cb0407c..00e3f50ad 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4220,10 +4220,11 @@ _ref = this.nodes.quotelinks; for (_i = 0, _len = _ref.length; _i < _len; _i++) { quotelink = _ref[_i]; - if (QR.db.get(Get.postDataFromLink(quotelink))) { - $.add(quotelink, $.tn('\u00A0(You)')); - $.addClass(this.nodes.root, 'quotesYou'); + if (!(QR.db.get(Get.postDataFromLink(quotelink)))) { + continue; } + $.add(quotelink, $.tn('\u00A0(You)')); + $.addClass(this.nodes.root, 'quotesYou'); } }, cb: { @@ -4302,13 +4303,17 @@ var a, boardID, m, post, postID, quote, quoteID, redirect, _ref; if (deadlink.parentNode.className === 'prettyprint') { - $.replace(deadlink, __slice.call(deadlink.childNodes)); + Quotify.fixDeadlink(deadlink); return; } quote = deadlink.textContent; if (!(postID = (_ref = quote.match(/\d+$/)) != null ? _ref[0] : void 0)) { return; } + if (postID[0] === '0') { + Quotify.fixDeadlink(deadlink); + return; + } boardID = (m = quote.match(/^>>>\/([a-z\d]+)/)) ? m[1] : this.board.ID; quoteID = "" + boardID + "." + postID; if (post = g.posts[quoteID]) { @@ -4364,6 +4369,9 @@ if ($.hasClass(a, 'quotelink')) { return this.nodes.quotelinks.push(a); } + }, + fixDeadlink: function(deadlink) { + return $.replace(deadlink, __slice.call(deadlink.childNodes)); } }; @@ -8522,7 +8530,7 @@ return; } roll = $('b', this.nodes.comment).firstChild; - return roll.data = "Rolled " + dicestats[1] + "d" + dicestats[2] + " and got " + (roll.data.slice(7)); + return roll.data = "Rolled " + dicestats[1] + "d" + dicestats[2] + ": " + (roll.data.slice(7)); } }; diff --git a/src/Miscellaneous/Dice.coffee b/src/Miscellaneous/Dice.coffee index 93bdb06cd..7b7a3c386 100644 --- a/src/Miscellaneous/Dice.coffee +++ b/src/Miscellaneous/Dice.coffee @@ -8,4 +8,4 @@ Dice = return if @isClone or not dicestats = @info.email?.match /dice[+\s](\d+)d(\d+)/ # Use the text node directly, as the has two
. roll = $('b', @nodes.comment).firstChild - roll.data = "Rolled #{dicestats[1]}d#{dicestats[2]} and got #{roll.data.slice 7}" + roll.data = "Rolled #{dicestats[1]}d#{dicestats[2]}: #{roll.data.slice 7}" diff --git a/src/Quotelinks/QuoteYou.coffee b/src/Quotelinks/QuoteYou.coffee index 949ac8c84..b5b9e4a60 100644 --- a/src/Quotelinks/QuoteYou.coffee +++ b/src/Quotelinks/QuoteYou.coffee @@ -25,8 +25,7 @@ QuoteYou = # Stop there if there's no quotes in that post. return unless @quotes.length - for quotelink in @nodes.quotelinks - if QR.db.get Get.postDataFromLink quotelink + for quotelink in @nodes.quotelinks when QR.db.get Get.postDataFromLink quotelink $.add quotelink, $.tn '\u00A0(You)' $.addClass @nodes.root, 'quotesYou' return @@ -60,4 +59,4 @@ QuoteYou = window.location = "##{post.id}" Header.scrollToPost post $.addClass $('.post', post), 'highlight' - return true \ No newline at end of file + return true diff --git a/src/Quotelinks/Quotify.coffee b/src/Quotelinks/Quotify.coffee index 2b20e4dcc..1aba82122 100644 --- a/src/Quotelinks/Quotify.coffee +++ b/src/Quotelinks/Quotify.coffee @@ -24,11 +24,15 @@ Quotify = # This won't be necessary once 4chan # stops quotifying inside code tags: # https://github.com/4chan/4chan-JS/issues/77 - $.replace deadlink, [deadlink.childNodes...] + Quotify.fixDeadlink deadlink return quote = deadlink.textContent return unless postID = quote.match(/\d+$/)?[0] + if postID[0] is '0' + # Fix quotelinks that start with a `0`. + Quotify.fixDeadlink deadlink + return boardID = if m = quote.match /^>>>\/([a-z\d]+)/ m[1] else @@ -75,3 +79,6 @@ Quotify = $.replace deadlink, a if $.hasClass a, 'quotelink' @nodes.quotelinks.push a + + fixDeadlink: (deadlink) -> + $.replace deadlink, [deadlink.childNodes...]