From 0ae9bf281305fecbb25df0973ff69687cc3d0329 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sat, 15 Sep 2012 04:57:07 +0200 Subject: [PATCH] Some more accuracies. --- 4chan_x.user.js | 10 ++++++---- script.coffee | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 6d495470f..5d35d1afd 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -749,15 +749,15 @@ } } this.isReply = $.hasClass(post, 'reply'); + this.clones = []; + g.posts["" + board + "." + this] = thread.posts[this] = board.posts[this] = this; if (that.isArchived) { this.kill(); } - this.clones = []; - g.posts["" + board + "." + this] = thread.posts[this] = board.posts[this] = this; } Post.prototype.kill = function(img) { - var ID, num, post, quote, quotelink, quotelinks, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3; + var ID, board, num, post, postID, quote, quotelink, quotelinks, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2, _ref3, _ref4; if (this.file && !this.file.isDead) { this.file.isDead = true; } @@ -796,8 +796,10 @@ if ($.hasClass(quotelink, 'deadlink')) { continue; } - if (Get.postDataFromLink(quotelink).postID === this.ID) { + _ref4 = Get.postDataFromLink(quotelink), board = _ref4.board, postID = _ref4.postID; + if (board === this.board.ID(postID === this.ID)) { $.add(quotelink, $.tn('\u00A0(Dead)')); + $.addClass(quotelinks, 'deadlink'); } } }; diff --git a/script.coffee b/script.coffee index 53942ea63..cf5bef617 100644 --- a/script.coffee +++ b/script.coffee @@ -598,9 +598,9 @@ class Post @file.dimensions = @file.text.textContent.match(/\d+x\d+/)[0] @isReply = $.hasClass post, 'reply' - @kill() if that.isArchived @clones = [] g.posts["#{board}.#{@}"] = thread.posts[@] = board.posts[@] = @ + @kill() if that.isArchived kill: (img) -> if @file and !@file.isDead @@ -637,8 +637,10 @@ class Post quotelinks.push.apply quotelinks, Array::slice.call post.nodes.backlinks for quotelink in quotelinks continue if $.hasClass quotelink, 'deadlink' - if Get.postDataFromLink(quotelink).postID is @ID + {board, postID} = Get.postDataFromLink quotelink + if board is @board.ID postID is @ID $.add quotelink, $.tn '\u00A0(Dead)' + $.addClass quotelinks, 'deadlink' return addClone: (context) -> new Clone @, context