Fix error when window.Report is undefined; migrate to $.global.

This commit is contained in:
ccd0 2016-01-23 15:15:36 -08:00
parent fc12dfc00e
commit 2e3c70caa0

View File

@ -55,16 +55,11 @@ Fourchan =
# Disable 4chan's ID highlighting (replaced by IDHighlight) and reported post hiding. # Disable 4chan's ID highlighting (replaced by IDHighlight) and reported post hiding.
Main.ready -> Main.ready ->
$.globalEval ''' $.global ->
(function() { window.clickable_ids = false
window.clickable_ids = false; for node in document.querySelectorAll '.posteruid, .capcode'
var nodes = document.querySelectorAll('.posteruid, .capcode'); node.removeEventListener 'click', window.idClick, false
for (var i = 0; i < nodes.length; i++) { window.removeEventListener 'message', window.Report?.onMessage, false
nodes[i].removeEventListener("click", window.idClick, false);
}
window.removeEventListener("message", Report.onMessage, false);
})();
'''
code: -> code: ->
return if @isClone return if @isClone