From 2e3c70caa004e52a3ea0d2add3fbe21865d8412f Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 23 Jan 2016 15:15:36 -0800 Subject: [PATCH] Fix error when window.Report is undefined; migrate to $.global. --- src/Miscellaneous/Fourchan.coffee | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 1748fde4d..c4f28e541 100644 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -55,16 +55,11 @@ Fourchan = # Disable 4chan's ID highlighting (replaced by IDHighlight) and reported post hiding. Main.ready -> - $.globalEval ''' - (function() { - window.clickable_ids = false; - var nodes = document.querySelectorAll('.posteruid, .capcode'); - for (var i = 0; i < nodes.length; i++) { - nodes[i].removeEventListener("click", window.idClick, false); - } - window.removeEventListener("message", Report.onMessage, false); - })(); - ''' + $.global -> + window.clickable_ids = false + for node in document.querySelectorAll '.posteruid, .capcode' + node.removeEventListener 'click', window.idClick, false + window.removeEventListener 'message', window.Report?.onMessage, false code: -> return if @isClone