less qr.cb

This commit is contained in:
James Campos 2011-08-06 09:44:42 -07:00
parent 066a3d8ba5
commit d330cbe8c9
2 changed files with 74 additions and 74 deletions

View File

@ -1230,13 +1230,13 @@
qr = {
init: function() {
var iframe;
g.callbacks.push(qr.cb.node);
g.callbacks.push(qr.node);
iframe = $.el('iframe', {
name: 'iframe',
hidden: true
});
$.append(d.body, iframe);
$.bind(window, 'message', qr.cb.message);
$.bind(window, 'message', qr.message);
$('#recaptcha_response_field').id = '';
return qr.captcha = [];
},
@ -1250,14 +1250,6 @@
return (_ref = $('#autohide:checked', qr.el)) != null ? _ref.click() : void 0;
}
},
cb: {
autohide: function(e) {
if (this.checked) {
return $.addClass(qr.el, 'auto');
} else {
return $.removeClass(qr.el, 'auto');
}
},
message: function(e) {
var data, duration, file, oldFile;
Recaptcha.reload();
@ -1296,6 +1288,14 @@
quote = $('a.quotejs:not(:first-child)', root);
return $.bind(quote, 'click', qr.cb.quote);
},
cb: {
autohide: function(e) {
if (this.checked) {
return $.addClass(qr.el, 'auto');
} else {
return $.removeClass(qr.el, 'auto');
}
},
quote: function(e) {
e.preventDefault();
return qr.quote(this);

View File

@ -967,12 +967,12 @@ cooldown =
qr =
init: ->
g.callbacks.push qr.cb.node
g.callbacks.push qr.node
iframe = $.el 'iframe',
name: 'iframe'
hidden: true
$.append d.body, iframe
$.bind window, 'message', qr.cb.message
$.bind window, 'message', qr.message
#hack - nuke id so it doesn't grab focus when reloading
$('#recaptcha_response_field').id = ''
@ -984,13 +984,6 @@ qr =
unset: ->
$('#autohide:checked', qr.el)?.click()
cb:
autohide: (e) ->
if @checked
$.addClass qr.el, 'auto'
else
$.removeClass qr.el, 'auto'
message: (e) ->
Recaptcha.reload()
$('iframe[name=iframe]').src = 'about:blank'
@ -1023,6 +1016,13 @@ qr =
quote = $ 'a.quotejs:not(:first-child)', root
$.bind quote, 'click', qr.cb.quote
cb:
autohide: (e) ->
if @checked
$.addClass qr.el, 'auto'
else
$.removeClass qr.el, 'auto'
quote: (e) ->
e.preventDefault()
qr.quote @