nodeInserted

This commit is contained in:
James Campos 2011-04-17 08:56:05 -07:00
parent abcecc3ec1
commit 8e6d9484f2
2 changed files with 25 additions and 25 deletions

View File

@ -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);

View File

@ -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)