This commit is contained in:
James Campos 2011-09-02 20:19:19 -07:00
parent b29ea64bc3
commit 8b8778f3ee
2 changed files with 12 additions and 2 deletions

View File

@ -1367,13 +1367,18 @@
} }
} }
}, },
reset: function() {
return $('textarea', QR.el).value = '';
},
receive: function(e) { receive: function(e) {
var data; var data;
data = e.data; data = e.data;
if (data) { if (data) {
return $.extend($('a.error', QR.el), JSON.parse(data)); return $.extend($('a.error', QR.el), JSON.parse(data));
} else { } else {
if (!conf['Persistent QR']) { if (conf['Persistent QR']) {
QR.reset();
} else {
QR.close(); QR.close();
} }
if (conf['Cooldown']) { if (conf['Cooldown']) {

View File

@ -1072,12 +1072,17 @@ QR =
textContent: 'Submit' textContent: 'Submit'
disabled: false disabled: false
QR.autoPost() if $('#auto', QR.el).checked QR.autoPost() if $('#auto', QR.el).checked
reset: ->
$('textarea', QR.el).value = ''
receive: (e) -> receive: (e) ->
{data} = e {data} = e
if data if data
$.extend $('a.error', QR.el), JSON.parse data $.extend $('a.error', QR.el), JSON.parse data
else else
QR.close() unless conf['Persistent QR'] if conf['Persistent QR']
QR.reset()
else
QR.close()
if conf['Cooldown'] if conf['Cooldown']
cooldown = Date.now() + 30*SECOND cooldown = Date.now() + 30*SECOND
$.set "cooldown/#{g.BOARD}", cooldown $.set "cooldown/#{g.BOARD}", cooldown