diff --git a/4chan_x.js b/4chan_x.js index 25395feba..d20a665dc 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1962,7 +1962,7 @@ }, report: function(target) { var input; - input = $.x('preceding-sibling::input[1]', target); + input = $('input', target.parentNode); input.click(); $('input[value="Report"]').click(); return input.click(); @@ -2294,7 +2294,7 @@ src: a.href }); if (a.parentNode.className !== 'op') { - filesize = $.x('preceding::span[@class="filesize"][1]', a); + filesize = $('span.filesize', a.parentNode); _ref2 = filesize.textContent.match(/(\d+)x/), _ = _ref2[0], max = _ref2[1]; img.setAttribute('style', "max-width: -moz-calc(" + max + "px);"); } diff --git a/script.coffee b/script.coffee index 82bc749ca..26b70e8cb 100644 --- a/script.coffee +++ b/script.coffee @@ -1540,7 +1540,7 @@ reportButton = report: (e) -> reportButton.report @ report: (target) -> - input = $.x('preceding-sibling::input[1]', target) + input = $ 'input', target.parentNode input.click() $('input[value="Report"]').click() input.click() @@ -1749,7 +1749,7 @@ imgExpand = img = $.el 'img', src: a.href unless a.parentNode.className is 'op' - filesize = $.x 'preceding::span[@class="filesize"][1]', a + filesize = $ 'span.filesize', a.parentNode [_, max] = filesize.textContent.match /(\d+)x/ img.setAttribute 'style', "max-width: -moz-calc(#{max}px);" a.appendChild img