summaryrefslogtreecommitdiffstats
path: root/templates/tm-callback-trigger.html
diff options
context:
space:
mode:
authorSimon Rettberg2015-02-24 16:30:07 +0100
committerSimon Rettberg2015-02-24 16:30:07 +0100
commitbb6432a6158b97cd5b92ab316d9d8b52bca2044d (patch)
treee64f4d92458d2fb501eb0af13c6dc37adc731747 /templates/tm-callback-trigger.html
parentMiniLinux download with version selection (diff)
downloadslx-admin-bb6432a6158b97cd5b92ab316d9d8b52bca2044d.tar.gz
slx-admin-bb6432a6158b97cd5b92ab316d9d8b52bca2044d.tar.xz
slx-admin-bb6432a6158b97cd5b92ab316d9d8b52bca2044d.zip
Various fixes
Diffstat (limited to 'templates/tm-callback-trigger.html')
-rw-r--r--templates/tm-callback-trigger.html16
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