lemonldap-ng/lemonldap-ng-portal/site/coffee/info.coffee

30 lines
476 B
CoffeeScript
Raw Normal View History

2017-01-19 12:33:11 +01:00
# Timer for information page
i = 30
_go = 1
stop = () ->
_go = 0
2018-06-06 22:21:56 +02:00
$('#divToHide').hide();
2020-01-15 20:49:14 +01:00
$('#wait').hide();
2017-01-19 12:33:11 +01:00
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
2020-01-15 20:49:14 +01:00
#$(document).ready ->
$(window).on 'load', () ->
2017-01-19 12:33:11 +01:00
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()