eval only if not op

This commit is contained in:
James Campos 2011-04-24 15:32:56 -07:00
parent b46577756e
commit 1b14915c43
2 changed files with 6 additions and 4 deletions

View File

@ -1171,15 +1171,16 @@
$.bind(recaptcha, 'keydown', Recaptcha.listener); $.bind(recaptcha, 'keydown', Recaptcha.listener);
return; return;
} }
$.globalEval(qr.eval.messageIframe);
c = $('b').lastChild; c = $('b').lastChild;
if (c.nodeType === 8) { if (c.nodeType === 8) {
_ref = c.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref[0], thread = _ref[1], id = _ref[2]; _ref = c.textContent.match(/thread:(\d+),no:(\d+)/), _ = _ref[0], thread = _ref[1], id = _ref[2];
if (thread === '0') { if (thread === '0') {
_ref2 = $('meta', d).content.match(/4chan.org\/(\w+)\//), _ = _ref2[0], board = _ref2[1]; _ref2 = $('meta', d).content.match(/4chan.org\/(\w+)\//), _ = _ref2[0], board = _ref2[1];
return window.location = "http://boards.4chan.org/" + board + "/res/" + id + "#watch"; window.location = "http://boards.4chan.org/" + board + "/res/" + id + "#watch";
return;
} }
} }
return $.globalEval(qr.eval.messageIframe);
} }
}; };
threadHiding = { threadHiding = {

View File

@ -901,14 +901,15 @@ qr =
$.bind recaptcha, 'keydown', Recaptcha.listener $.bind recaptcha, 'keydown', Recaptcha.listener
return return
$.globalEval qr.eval.messageIframe
c = $('b').lastChild c = $('b').lastChild
if c.nodeType is 8 #comment node if c.nodeType is 8 #comment node
[_, thread, id] = c.textContent.match(/thread:(\d+),no:(\d+)/) [_, thread, id] = c.textContent.match(/thread:(\d+),no:(\d+)/)
if thread is '0' if thread is '0'
[_, board] = $('meta', d).content.match(/4chan.org\/(\w+)\//) [_, board] = $('meta', d).content.match(/4chan.org\/(\w+)\//)
window.location = "http://boards.4chan.org/#{board}/res/#{id}#watch" window.location = "http://boards.4chan.org/#{board}/res/#{id}#watch"
return
$.globalEval qr.eval.messageIframe
threadHiding = threadHiding =
init: -> init: ->