moved inline javascript to it's own file

This commit is contained in:
Johannes Erwerle 2026-10-21 21:54:29 +02:00
parent 5813d200dc
commit 26f3d5d033
2 changed files with 26 additions and 24 deletions

View file

@ -2,35 +2,13 @@
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="{% static 'vendored/css/bulma.min.css' %}">
<link rel="stylesheet" href="{% static 'vendored/css/bulma.min.css' %}">
<link rel="stylesheet" href="{% static 'webui/css/webui.css' %}">
<link rel="icon" href="{% static 'webui/logo.png'%}" type="image/png"/>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Community Backup</title>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', () => {
// Get all "navbar-burger" elements
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
// Add a click event on each of them
$navbarBurgers.forEach( el => {
el.addEventListener('click', () => {
// Get the target from the "data-target" attribute
const target = el.dataset.target;
const $target = document.getElementById(target);
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
});
</script>
<script type="text/javascript" src={% static 'webui/js/webui.js' %}></script>
</head>
<body>
<nav class="navbar" role="navigation" aria-label="main navigation" >