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

View File

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