diff --git a/4chan_x.user.js b/4chan_x.user.js index 54c681f56..7ab20c8e7 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3402,7 +3402,7 @@ }, node: function(post) { var a; - if (!(a = $('.reportbutton', post.el))) { + if (!(a = $('.report_button', post.el))) { a = ReportButton.a.cloneNode(true); $.add($('.postInfo', post.el), a); } @@ -4121,17 +4121,17 @@ } }, preParse: function(node) { - var el, fileInfo, img, klass, post; + var el, fileInfo, img, post, rootClass; + rootClass = node.className; el = $('.post', node); - klass = el.className; post = { root: node, el: el, - "class": klass, + "class": el.className, id: el.id.slice(1), threadId: g.THREAD_ID || $.x('ancestor::div[@class="thread"]', node).id.slice(1), - isInlined: /\binline\b/.test(klass), - isCrosspost: /\bcrosspost\b/.test(klass), + isInlined: /\binline\b/.test(rootClass), + isCrosspost: /\bcrosspost\b/.test(rootClass), quotes: el.getElementsByClassName('quotelink'), backlinks: el.getElementsByClassName('backlink'), fileInfo: false, diff --git a/script.coffee b/script.coffee index 683201d54..4882f0af5 100644 --- a/script.coffee +++ b/script.coffee @@ -2625,7 +2625,7 @@ ReportButton = href: 'javascript:;' Main.callbacks.push @node node: (post) -> - unless a = $ '.reportbutton', post.el + unless a = $ '.report_button', post.el a = ReportButton.a.cloneNode true $.add $('.postInfo', post.el), a $.on a, 'click', ReportButton.report @@ -3157,16 +3157,16 @@ Main = window.location = "https://raw.github.com/mayhemydg/4chan-x/#{version}/4chan_x.user.js" preParse: (node) -> - el = $ '.post', node - klass = el.className - post = + rootClass = node.className + el = $ '.post', node + post = root: node el: el - class: klass + class: el.className id: el.id[1..] threadId: g.THREAD_ID or $.x('ancestor::div[@class="thread"]', node).id[1..] - isInlined: /\binline\b/.test klass - isCrosspost: /\bcrosspost\b/.test klass + isInlined: /\binline\b/.test rootClass + isCrosspost: /\bcrosspost\b/.test rootClass quotes: el.getElementsByClassName 'quotelink' backlinks: el.getElementsByClassName 'backlink' fileInfo: false