diff --git a/4chan_x.js b/4chan_x.js index 37674f8da..cfbc0db6b 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -1870,6 +1870,22 @@ return window.location = 'javascript:Recaptcha.reload()'; } }; + nodeInserted = function(e) { + var callback, dialog, target, _i, _len, _ref, _results; + target = e.target; + if (target.nodeName === 'TABLE') { + _ref = g.callbacks; + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + callback = _ref[_i]; + _results.push(callback(target)); + } + return _results; + } else if (target.id === 'recaptcha_challenge_field' && (dialog = $('#qr'))) { + $('#recaptcha_image img', dialog).src = "http://www.google.com/recaptcha/api/image?c=" + target.value; + return $('#recaptcha_challenge_field', dialog).value = target.value; + } + }; imageClick = function(e) { if (e.shiftKey || e.altKey || e.ctrlKey) { return; @@ -1962,22 +1978,6 @@ thumb.className = ''; return $.remove(thumb.nextSibling); }; - nodeInserted = function(e) { - var callback, dialog, target, _i, _len, _ref, _results; - target = e.target; - if (target.nodeName === 'TABLE') { - _ref = g.callbacks; - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - callback = _ref[_i]; - _results.push(callback(target)); - } - return _results; - } else if (target.id === 'recaptcha_challenge_field' && (dialog = $('#qr'))) { - $('#recaptcha_image img', dialog).src = "http://www.google.com/recaptcha/api/image?c=" + target.value; - return $('#recaptcha_challenge_field', dialog).value = target.value; - } - }; autoWatch = function() { var autoText; autoText = $('textarea', this).value.slice(0, 25); diff --git a/script.coffee b/script.coffee index 1b0c7029e..fb1e8172e 100644 --- a/script.coffee +++ b/script.coffee @@ -1424,6 +1424,15 @@ recaptcha = reload: -> window.location = 'javascript:Recaptcha.reload()' +nodeInserted = (e) -> + {target} = e + if target.nodeName is 'TABLE' + for callback in g.callbacks + callback target + else if target.id is 'recaptcha_challenge_field' and dialog = $ '#qr' + $('#recaptcha_image img', dialog).src = "http://www.google.com/recaptcha/api/image?c=" + target.value + $('#recaptcha_challenge_field', dialog).value = target.value + # TODO rewrite these ************************************************************************** imageClick = (e) -> @@ -1502,15 +1511,6 @@ imageThumb = (thumb) -> thumb.className = '' $.remove thumb.nextSibling -nodeInserted = (e) -> - target = e.target - if target.nodeName is 'TABLE' - for callback in g.callbacks - callback target - else if target.id is 'recaptcha_challenge_field' and dialog = $ '#qr' - $('#recaptcha_image img', dialog).src = "http://www.google.com/recaptcha/api/image?c=" + target.value - $('#recaptcha_challenge_field', dialog).value = target.value - autoWatch = -> #TODO look for subject autoText = $('textarea', this).value.slice(0, 25)