refactor qr.cb.message
This commit is contained in:
parent
ee7b8c1bd6
commit
5a173043e4
@ -1103,28 +1103,28 @@
|
||||
},
|
||||
message: function(e) {
|
||||
var data, dialog, duration;
|
||||
Recaptcha.reload();
|
||||
$('iframe[name=iframe]').src = 'about:blank';
|
||||
data = e.data;
|
||||
dialog = $('#qr');
|
||||
if (data) {
|
||||
$('input[name=recaptcha_response_field]', dialog).value = '';
|
||||
$('#error').textContent = data;
|
||||
qr.autohide.unset();
|
||||
} else {
|
||||
if (dialog) {
|
||||
if (g.REPLY && $.config('Persistent QR')) {
|
||||
qr.refresh(dialog);
|
||||
} else {
|
||||
$.rm(dialog);
|
||||
}
|
||||
}
|
||||
if ($.config('Cooldown')) {
|
||||
duration = qr.sage ? 60 : 30;
|
||||
$.setValue(g.BOARD + '/cooldown', Date.now() + duration * 1000);
|
||||
cooldown.start();
|
||||
return;
|
||||
}
|
||||
if (dialog) {
|
||||
if (g.REPLY && $.config('Persistent QR')) {
|
||||
qr.refresh(dialog);
|
||||
} else {
|
||||
$.rm(dialog);
|
||||
}
|
||||
}
|
||||
Recaptcha.reload();
|
||||
return $('iframe[name=iframe]').src = 'about:blank';
|
||||
if ($.config('Cooldown')) {
|
||||
duration = qr.sage ? 60 : 30;
|
||||
$.setValue(g.BOARD + '/cooldown', Date.now() + duration * 1000);
|
||||
return cooldown.start();
|
||||
}
|
||||
},
|
||||
node: function(root) {
|
||||
var quote;
|
||||
|
||||
@ -854,25 +854,26 @@ qr =
|
||||
$.removeClass dialog, 'auto'
|
||||
|
||||
message: (e) ->
|
||||
Recaptcha.reload()
|
||||
$('iframe[name=iframe]').src = 'about:blank'
|
||||
|
||||
{data} = e
|
||||
dialog = $ '#qr'
|
||||
if data # error message
|
||||
$('input[name=recaptcha_response_field]', dialog).value = ''
|
||||
$('#error').textContent = data
|
||||
qr.autohide.unset()
|
||||
else # success
|
||||
if dialog
|
||||
if g.REPLY and $.config 'Persistent QR'
|
||||
qr.refresh dialog
|
||||
else
|
||||
$.rm dialog
|
||||
if $.config 'Cooldown'
|
||||
duration = if qr.sage then 60 else 30
|
||||
$.setValue g.BOARD+'/cooldown', Date.now() + duration * 1000
|
||||
cooldown.start()
|
||||
return
|
||||
|
||||
Recaptcha.reload()
|
||||
$('iframe[name=iframe]').src = 'about:blank'
|
||||
if dialog
|
||||
if g.REPLY and $.config 'Persistent QR'
|
||||
qr.refresh dialog
|
||||
else
|
||||
$.rm dialog
|
||||
if $.config 'Cooldown'
|
||||
duration = if qr.sage then 60 else 30
|
||||
$.setValue g.BOARD+'/cooldown', Date.now() + duration * 1000
|
||||
cooldown.start()
|
||||
|
||||
node: (root) ->
|
||||
quote = $ 'a.quotejs:not(:first-child)', root
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user