2017-01-19 12:33:11 +01:00
|
|
|
# Timer for information page
|
|
|
|
|
|
|
|
i = 30
|
|
|
|
_go = 1
|
|
|
|
|
|
|
|
stop = () ->
|
|
|
|
_go = 0
|
|
|
|
$('#timer').html("...");
|
|
|
|
|
|
|
|
go = () ->
|
|
|
|
$("#form").submit() if _go
|
|
|
|
|
|
|
|
timer = () ->
|
|
|
|
h = $('#timer').html()
|
|
|
|
i-- if i>0
|
|
|
|
h = h.replace /\d+/, i
|
|
|
|
$('#timer').html(h)
|
|
|
|
window.setTimeout timer, 1000
|
|
|
|
|
|
|
|
$(document).ready ->
|
|
|
|
if window.datas['activeTimer']
|
2017-03-16 21:19:06 +01:00
|
|
|
window.setTimeout go, 30000
|
2017-01-19 12:33:11 +01:00
|
|
|
window.setTimeout timer, 1000
|
|
|
|
else
|
|
|
|
stop
|
2017-01-19 22:48:07 +01:00
|
|
|
$("#wait").on 'click', () ->
|
|
|
|
stop()
|