move inline javascript to its own file

Signed-off-by: szaimen <szaimen@e.mail.de>
This commit is contained in:
szaimen 2022-03-11 17:00:24 +01:00
parent 8a21f2a8f5
commit 4c304d8775
2 changed files with 15 additions and 16 deletions

View file

@ -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);
}

View file

@ -249,7 +249,7 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if isBackupOrRestoreRunning == false %} {% if isBackupContainerRunning == false %}
<h2 id="mastercontainer">Mastercontainer</h2> <h2 id="mastercontainer">Mastercontainer</h2>
You are currently running the {{ current_channel }} channel. (<a href="/api/docker/logs?id=nextcloud-aio-mastercontainer">Logs</a>)<br><br> You are currently running the {{ current_channel }} channel. (<a href="/api/docker/logs?id=nextcloud-aio-mastercontainer">Logs</a>)<br><br>
@ -294,21 +294,7 @@
{% endif %} {% endif %}
{% if isApacheStarting == true or isBackupContainerRunning == true or isWatchtowerRunning == true %} {% if isApacheStarting == true or isBackupContainerRunning == true or isWatchtowerRunning == true %}
<script> <script type="text/javascript" src="automatic_reload.js"></script>
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);
}
</script>
{% endif %} {% endif %}
</div> </div>