Files
Journal/static/js/main.js
SimolZimol 0e7efe4b74 new file: .env.example
new file:   .gitignore
	new file:   Dockerfile
	new file:   README.md
	new file:   app.py
	new file:   auth.py
	new file:   config.py
	new file:   db.py
	new file:   db_helpers.py
	new file:   docker-compose.yml
	new file:   requirements.txt
	new file:   routes/__init__.py
	new file:   routes/admin_routes.py
	new file:   routes/auth_routes.py
	new file:   routes/journal_routes.py
	new file:   static/css/style.css
	new file:   static/js/main.js
	new file:   templates/admin/dashboard.html
	new file:   templates/admin/users.html
	new file:   templates/base.html
	new file:   templates/day.html
	new file:   templates/future.html
	new file:   templates/index.html
	new file:   templates/login.html
	new file:   templates/week.html
2026-08-02 20:41:24 +02:00

28 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* Bullet Journal kleine Frontend-Helfer */
document.addEventListener("DOMContentLoaded", function () {
// Move-Formular: wenn ein Datum gesetzt ist, Verschieben-Button nutzen
document.querySelectorAll(".move-form").forEach(function (form) {
var dateInput = form.querySelector("input[name='target_date']");
var dateBtn = form.querySelector("button[name='target'][value='date']");
// Deaktiviere den Datums-Button, solange kein Datum gewählt wurde
function updateBtn() {
if (dateBtn) {
dateBtn.disabled = !dateInput || !dateInput.value;
}
}
if (dateInput) {
dateInput.addEventListener("change", updateBtn);
updateBtn();
}
});
// Flash-Nachrichten automatisch ausblenden
setTimeout(function () {
document.querySelectorAll(".flash").forEach(function (el) {
el.style.transition = "opacity .4s";
el.style.opacity = "0";
setTimeout(function () { el.remove(); }, 400);
});
}, 5000);
});