From c45807c9b9aea71c2c38004a48a8e3a2d3ed9317 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 20 Mar 2014 09:42:48 -0700 Subject: [PATCH] Small backlink reflow --- builds/4chan-X.user.js | 9 ++++----- builds/crx/script.js | 9 ++++----- src/Quotelinks/QuoteBacklink.coffee | 7 +++---- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 06a5640e1..465ec9d82 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -5272,7 +5272,7 @@ } }, secondNode: function() { - var backlink, container, post, quoteID, _i, _j, _len, _len1, _ref, _ref1; + var backlink, container, map, post, quoteID, _i, _j, _len, _len1, _ref; if (!(this.isReply || Conf['OP Backlinks'])) { return; } @@ -5288,10 +5288,9 @@ this.nodes.backlinkContainer = container = $.el('span', { className: 'backlink-container' }); - if (this.fullID in QuoteBacklink.map) { - _ref1 = QuoteBacklink.map[this.fullID]; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - quoteID = _ref1[_j]; + if (map = QuoteBacklink.map[this.fullID]) { + for (_j = 0, _len1 = map.length; _j < _len1; _j++) { + quoteID = map[_j]; if (post = g.posts[quoteID]) { $.add(container, QuoteBacklink.buildBacklink(this, post)); } diff --git a/builds/crx/script.js b/builds/crx/script.js index 1a6782edf..3ff171db4 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -5324,7 +5324,7 @@ } }, secondNode: function() { - var backlink, container, post, quoteID, _i, _j, _len, _len1, _ref, _ref1; + var backlink, container, map, post, quoteID, _i, _j, _len, _len1, _ref; if (!(this.isReply || Conf['OP Backlinks'])) { return; } @@ -5340,10 +5340,9 @@ this.nodes.backlinkContainer = container = $.el('span', { className: 'backlink-container' }); - if (this.fullID in QuoteBacklink.map) { - _ref1 = QuoteBacklink.map[this.fullID]; - for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { - quoteID = _ref1[_j]; + if (map = QuoteBacklink.map[this.fullID]) { + for (_j = 0, _len1 = map.length; _j < _len1; _j++) { + quoteID = map[_j]; if (post = g.posts[quoteID]) { $.add(container, QuoteBacklink.buildBacklink(this, post)); } diff --git a/src/Quotelinks/QuoteBacklink.coffee b/src/Quotelinks/QuoteBacklink.coffee index bb9d66367..51e97ee58 100755 --- a/src/Quotelinks/QuoteBacklink.coffee +++ b/src/Quotelinks/QuoteBacklink.coffee @@ -47,10 +47,9 @@ QuoteBacklink = return @nodes.backlinkContainer = container = $.el 'span', className: 'backlink-container' - if @fullID of QuoteBacklink.map - for quoteID in QuoteBacklink.map[@fullID] - if post = g.posts[quoteID] # Post hasn't been collected since. - $.add container, QuoteBacklink.buildBacklink @, post + if map = QuoteBacklink.map[@fullID] + for quoteID in map when post = g.posts[quoteID] # Post hasn't been collected since. + $.add container, QuoteBacklink.buildBacklink @, post $.add @nodes.info, container buildBacklink: (quoted, quoter) ->