Commit f1104cc0 authored by Xavier Guimard's avatar Xavier Guimard

Disable auto-confirm if timer isn't defined

parent 01b55fde
# Timer for confirmation page
i = 5
timerIsEnabled = 0
go = () ->
$("#form").submit()
$("#form").submit() if timerIsEnabled
timer = () ->
h = $('#timer').html()
i-- if i>0
h = h.replace /\d+/, i
$('#timer').html h
setTimeout timer, 1000
if h
timerIsEnabled = 1
i-- if i>0
h = h.replace /\d+/, i
$('#timer').html h
setTimeout timer, 1000
$(document).ready ->
setTimeout go, 30000
......
// Generated by CoffeeScript 1.10.0
(function() {
var go, i, timer;
var go, i, timer, timerIsEnabled;
i = 5;
timerIsEnabled = 0;
go = function() {
return $("#form").submit();
if (timerIsEnabled) {
return $("#form").submit();
}
};
timer = function() {
var h;
h = $('#timer').html();
if (i > 0) {
i--;
if (h) {
timerIsEnabled = 1;
if (i > 0) {
i--;
}
h = h.replace(/\d+/, i);
$('#timer').html(h);
return setTimeout(timer, 1000);
}
h = h.replace(/\d+/, i);
$('#timer').html(h);
return setTimeout(timer, 1000);
};
$(document).ready(function() {
......
(function(){var b,a,c;a=5;b=function(){return $("#form").submit()};c=function(){var d;d=$("#timer").html();if(a>0){a--}d=d.replace(/\d+/,a);$("#timer").html(d);return setTimeout(c,1000)};$(document).ready(function(){setTimeout(b,30000);setTimeout(c,1000);$(".idploop").on("click",function(){return $("#idp").val($(this).attr("val"))});return $("#refuse").on("click",function(){return $("#confirm").attr("value",$(this).attr("val"))})})}).call(this);
\ No newline at end of file
(function(){var c,a,d,b;a=5;b=0;c=function(){if(b){return $("#form").submit()}};d=function(){var e;e=$("#timer").html();if(e){b=1;if(a>0){a--}e=e.replace(/\d+/,a);$("#timer").html(e);return setTimeout(d,1000)}};$(document).ready(function(){setTimeout(c,30000);setTimeout(d,1000);$(".idploop").on("click",function(){return $("#idp").val($(this).attr("val"))});return $("#refuse").on("click",function(){return $("#confirm").attr("value",$(this).attr("val"))})})}).call(this);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment