From 8b465172c71067398aca6f68683ed8c8a07606cb Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 17 May 2011 16:00:00 +0200 Subject: [PATCH] Better placement of inlined backquotes --- 4chan_x.js | 10 ++-------- script.coffee | 9 ++------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/4chan_x.js b/4chan_x.js index dcf9e0b16..305876b8e 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1738,11 +1738,7 @@ } root = $.x('ancestor::td[1]', this); if (td = $("#i" + id, root)) { - $.rm($.x('ancestor::table[1]', td)); - if (this.className === 'backlink') { - $.show($.x('ancestor::table[1]', d.getElementById(id))); - } - return; + return $.rm(td); } inline = $.el('table', { className: 'inline', @@ -1765,9 +1761,7 @@ } } if (this.className === 'backlink') { - root = $('table, blockquote', root); - $.before(root, inline); - return $.hide($.x('ancestor::table[1]', el)); + return $.after($('td > br:first-of-type, td > a:last-of-type', this.parentNode), inline); } else { return $.after(this.parentNode, inline); } diff --git a/script.coffee b/script.coffee index a78075abd..226ed6027 100644 --- a/script.coffee +++ b/script.coffee @@ -1389,10 +1389,7 @@ quoteInline = return unless id = @hash[1..] root = $.x 'ancestor::td[1]', this if td = $ "#i#{id}", root - $.rm $.x 'ancestor::table[1]', td - if @className is 'backlink' - $.show $.x 'ancestor::table[1]', d.getElementById id - return + return $.rm td inline = $.el 'table', className: 'inline' innerHTML: "" @@ -1411,9 +1408,7 @@ quoteInline = #FIXME need an array of callbacks g.requests[threadID] = $.get @href, (-> quoteInline.parse this, id, threadID, inline) if @className is 'backlink' - root = $ 'table, blockquote', root - $.before root, inline - $.hide $.x 'ancestor::table[1]', el + $.after $('td > br:first-of-type, td > a:last-of-type', @parentNode), inline else $.after @parentNode, inline parse: (req, id, threadID, inline) ->