mirror of
https://github.com/dkmstr/openuds.git
synced 2025-01-10 01:17:59 +03:00
The index is now "static", so we reload it every minute for the user to
get the state of different services updated.
This commit is contained in:
parent
04ec90ad61
commit
78526b3560
@ -6,6 +6,8 @@ uds.safari = false
|
||||
uds.ie = false
|
||||
uds.firefox = false
|
||||
|
||||
uds.reloadCounter = 12
|
||||
|
||||
# First, detect browser
|
||||
(() ->
|
||||
ua = navigator.userAgent.toLowerCase()
|
||||
@ -226,3 +228,15 @@ uds.onLink = ->
|
||||
|
||||
return
|
||||
|
||||
uds.resetReloadCounter = ->
|
||||
uds.reloadCounter = 12
|
||||
|
||||
uds.setReload = ->
|
||||
setTimeout uds.reload, 5000
|
||||
|
||||
uds.reload = ->
|
||||
if uds.reloadCounter == 0
|
||||
window.location.reload()
|
||||
else
|
||||
uds.reloadCounter -= 1
|
||||
uds.setReload()
|
||||
|
@ -188,6 +188,9 @@
|
||||
<script>
|
||||
function launchURL(el) {
|
||||
var $el = $(el);
|
||||
|
||||
uds.resetReloadCounter(); // Resets page update
|
||||
|
||||
url = $el.attr('data-href');
|
||||
url = url != null ? url : $el.attr('href');
|
||||
if ( url.substring(0, 7) == 'udsa://' ) {
|
||||
@ -257,6 +260,8 @@
|
||||
autorun = false;
|
||||
}
|
||||
|
||||
uds.setReload();
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
Loading…
Reference in New Issue
Block a user