diff options
author | Simon Rettberg | 2015-02-24 16:30:07 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-02-24 16:30:07 +0100 |
commit | bb6432a6158b97cd5b92ab316d9d8b52bca2044d (patch) | |
tree | e64f4d92458d2fb501eb0af13c6dc37adc731747 /templates | |
parent | MiniLinux download with version selection (diff) | |
download | slx-admin-bb6432a6158b97cd5b92ab316d9d8b52bca2044d.tar.gz slx-admin-bb6432a6158b97cd5b92ab316d9d8b52bca2044d.tar.xz slx-admin-bb6432a6158b97cd5b92ab316d9d8b52bca2044d.zip |
Various fixes
Diffstat (limited to 'templates')
-rw-r--r-- | templates/tm-callback-trigger.html | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/templates/tm-callback-trigger.html b/templates/tm-callback-trigger.html index 26b362ca..274a2246 100644 --- a/templates/tm-callback-trigger.html +++ b/templates/tm-callback-trigger.html @@ -1,5 +1,15 @@ <script type="text/javascript"> - setTimeout(function () { - $.post('api.php?do=cb', { token: TOKEN }); - }, 500); + var slxCbCooldown = 0; + function slxCheckCallbacks() { + $.post('api.php?do=cb', { token: TOKEN }, function(data) { + if ( data.indexOf('True') >= 0 ) { + slxCbCooldown = 0; + } else { + slxCbCooldown++; + } + if (slxCbCooldown < 4) + setTimeout(slxCheckCallbacks, (slxCbCooldown + 1) * 1500); + }, 'text'); + } + setTimeout(slxCheckCallbacks, 500); </script>
\ No newline at end of file |