From 4c304d87750a00303b9e98914b693684334366e7 Mon Sep 17 00:00:00 2001 From: szaimen Date: Fri, 11 Mar 2022 17:00:24 +0100 Subject: [PATCH] move inline javascript to its own file Signed-off-by: szaimen --- php/public/automatic_reload.js | 13 +++++++++++++ php/templates/containers.twig | 18 ++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 php/public/automatic_reload.js diff --git a/php/public/automatic_reload.js b/php/public/automatic_reload.js new file mode 100644 index 00000000..066a46c3 --- /dev/null +++ b/php/public/automatic_reload.js @@ -0,0 +1,13 @@ +if (document.hasFocus()) { + // hide reload button if the site reloads automatically + var list = document.getElementsByClassName("reload button"); + for (var i = 0; i < list.length; i++) { + // list[i] is a node with the desired class name + list[i].style.display = 'none'; + } + + // set timeout for reload + setTimeout(function(){ + window.location.reload(1); + }, 5000); +} \ No newline at end of file diff --git a/php/templates/containers.twig b/php/templates/containers.twig index 2cfe391b..e5ca4db0 100644 --- a/php/templates/containers.twig +++ b/php/templates/containers.twig @@ -249,7 +249,7 @@ {% endif %} {% endif %} - {% if isBackupOrRestoreRunning == false %} + {% if isBackupContainerRunning == false %}

Mastercontainer

You are currently running the {{ current_channel }} channel. (Logs)

@@ -294,21 +294,7 @@ {% endif %} {% if isApacheStarting == true or isBackupContainerRunning == true or isWatchtowerRunning == true %} - + {% endif %}