From b58e72d153d9f76750bbdcbb8fac019de6692160 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 11 Oct 2011 00:34:42 +0200 Subject: [PATCH 1/2] Fix, again; let it retract cross quotes. --- 4chan_x.user.js | 6 ++++-- script.coffee | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 1f4abe1d4..3dbbd9c71 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2432,8 +2432,10 @@ _ref = $$('input', table); for (_i = 0, _len = _ref.length; _i < _len; _i++) { inlined = _ref[_i]; - if (!(hidden = $.id(inlined.name)).classList.contains('op')) { - $.x('ancestor::table[1]', hidden).hidden = false; + if (hidden = $.id(inlined.name)) { + if (!hidden.classList.contains('op')) { + $.x('ancestor::table[1]', hidden).hidden = false; + } } } return $.rm(table); diff --git a/script.coffee b/script.coffee index e2b717301..3944ab484 100644 --- a/script.coffee +++ b/script.coffee @@ -1816,8 +1816,9 @@ quoteInline = #select the corresponding table or loading td table = $.x "following::*[@id='i#{id}']", q for inlined in $$ 'input', table - unless (hidden = $.id inlined.name).classList.contains 'op' - $.x('ancestor::table[1]', hidden).hidden = false + if hidden = $.id inlined.name + unless hidden.classList.contains 'op' + $.x('ancestor::table[1]', hidden).hidden = false $.rm table parse: (req, pathname, id, threadID, inline) -> From 7fabaa0659cbfaa51b75422c940cd030d645ef82 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 11 Oct 2011 00:57:58 +0200 Subject: [PATCH 2/2] Fix inlining of OP backlinks, numerical values are okay for xpath selectors. --- 4chan_x.user.js | 2 +- script.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 3dbbd9c71..e2477bcc2 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2394,7 +2394,7 @@ if (this.classList.contains('inlined')) { quoteInline.rm(this, id); } else { - if ($.x('ancestor::td[@id]', this).id === id) { + if ($.x("ancestor::*[@id='" + id + "']", this)) { return; } quoteInline.add(this, id); diff --git a/script.coffee b/script.coffee index 3944ab484..cb894658b 100644 --- a/script.coffee +++ b/script.coffee @@ -1789,7 +1789,7 @@ quoteInline = if @classList.contains 'inlined' quoteInline.rm @, id else - return if $.x('ancestor::td[@id]', @).id is id + return if $.x("ancestor::*[@id='#{id}']", @) quoteInline.add @, id @classList.toggle 'inlined'