diff --git a/4chan_x.user.js b/4chan_x.user.js index b0f635309..a37314a92 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2316,10 +2316,10 @@ quoteBacklink.funk = Function('id', "return'" + format + "'"); return g.callbacks.push(function(root) { var container, el, id, link, qid, quote, quotes, _i, _len, _ref, _results; - if (/inline/.test(root.className)) { + if (root.classList.contains('inline')) { return; } - id = root.id || $('td[id]', root).id; + id = $('input', root).name; quotes = {}; _ref = $$('.quotelink', root); for (_i = 0, _len = _ref.length; _i < _len; _i++) { @@ -2354,7 +2354,7 @@ container = $.el('span', { className: 'container' }); - root = $('.reportbutton', el) || $('span[id^=no]', el); + root = $('.reportbutton', el) || $('span[id]', el); $.after(root, container); } _results.push($.add(container, $.tn(' '), link)); @@ -2516,8 +2516,8 @@ if (conf['Quote Highlighting']) { $.addClass(el, 'qphl'); } - if (/backlink/.test(this.className)) { - replyID = $.x('ancestor::*[@id][1]', this).id.match(/\d+/)[0]; + if (this.classList.contains('backlink')) { + replyID = $.x('preceding::input', this).name; _ref = $$('.quotelink', qp); _results = []; for (_i = 0, _len = _ref.length; _i < _len; _i++) { diff --git a/script.coffee b/script.coffee index 35154d53f..816dddc51 100644 --- a/script.coffee +++ b/script.coffee @@ -1739,9 +1739,9 @@ quoteBacklink = format = conf['backlink'].replace /%id/, "' + id + '" quoteBacklink.funk = Function 'id', "return'#{format}'" g.callbacks.push (root) -> - return if /inline/.test root.className + return if root.classList.contains 'inline' # op or reply - id = root.id or $('td[id]', root).id + id = $('input', root).name quotes = {} for quote in $$ '.quotelink', root #don't process >>>/b/ @@ -1764,7 +1764,7 @@ quoteBacklink = $.bind link, 'click', quoteInline.toggle unless (container = $ '.container', el) and container.parentNode is el container = $.el 'span', className: 'container' - root = $('.reportbutton', el) or $('span[id^=no]', el) + root = $('.reportbutton', el) or $('span[id]', el) $.after root, container $.add container, $.tn(' '), link @@ -1866,8 +1866,8 @@ quotePreview = if el = $.id id qp.innerHTML = el.innerHTML $.addClass el, 'qphl' if conf['Quote Highlighting'] - if /backlink/.test @className - replyID = $.x('ancestor::*[@id][1]', @).id.match(/\d+/)[0] + if @classList.contains 'backlink' + replyID = $.x('preceding::input', @).name for quote in $$ '.quotelink', qp if quote.hash[1..] is replyID quote.className = 'forwardlink'