diff options
Diffstat (limited to 'templates/tm-callback-trigger.html')
-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 |