This commit is contained in:
Simon Martens
2024-01-25 18:20:18 +01:00
parent 065246acdc
commit 050784025c
25 changed files with 93 additions and 163 deletions

View File

@@ -35,4 +35,4 @@ const startup_briefe = function () {
tabbtnlist[0].click();
};
startup_briefe();
export { startup_briefe };

View File

@@ -94,7 +94,7 @@ const startup_filelistform = function () {
}
var coll = document.getElementsByClassName("expandable");
for (i = 0; i < coll.length; i++) {
for (let i = 0; i < coll.length; i++) {
let element = coll[i]
coll[i].addEventListener("click", () => {
element.classList.toggle("expanded");
@@ -102,4 +102,4 @@ const startup_filelistform = function () {
}
};
startup_filelistform();
export { startup_filelistform };

View File

@@ -1,8 +1,7 @@
const startup_index = function () {
const startup_index = function (AvailableLetters, AvailablePages) {
function encode(e) { return e.replace(/[^]/g, function (e) { return "&#" + e.charCodeAt(0) + ";" }) }
const ACTIVATEGOTOFILTER = function (filter, button) {
const ACTIVATEGOTOFILTER = function (filter, button) {
let f = filter.value;
let gotoinfo = document.getElementById("ha-gotoinfo");
@@ -93,4 +92,4 @@ const startup_index = function () {
searchfilter.addEventListener("input", () => ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn));
};
startup_index();
export { startup_index };

View File

@@ -1,10 +1,39 @@
import "../css/site.css";
import { startup_marginals } from "./marginals.mjs";
import { startup_theme } from "./theme.mjs";
import { startup_menu } from "./menu.js";
import { startup_menu } from "./menu.mjs";
import { startup_markanchor } from "./anchor.mjs";
import { startup_mobilemenu } from "./mobilemenu.js";
import { startup_mobilemenu } from "./mobilemenu.mjs";
import { startup_scrollbutton } from "./scrollbutton.mjs";
import { startup_clipboard } from "./clipboard.mjs";
import { startup_filelistform } from "./filelistform.mjs";
import { startup_index } from "./index.mjs";
import { startup_briefe } from "./briefe.mjs";
import { startup_websocket } from "./websocket.mjs";
import { startup_search } from "./search.mjs";
export { startup_clipboard, startup_mobilemenu, startup_markanchor, startup_menu, startup_scrollbutton, startup_marginals, startup_theme };
const startup_default = function () {
startup_marginals();
startup_theme();
startup_scrollbutton();
startup_menu();
startup_mobilemenu();
startup_markanchor();
startup_clipboard();
}
export {
startup_search,
startup_websocket,
startup_briefe,
startup_index,
startup_filelistform,
startup_default,
startup_clipboard,
startup_mobilemenu,
startup_markanchor,
startup_menu,
startup_scrollbutton,
startup_marginals,
startup_theme
};

View File

@@ -1,41 +0,0 @@
const startup_publishform = function () {
const LOCALPUBLISHSubmit = async function (oFormElement) {
var fd = new FormData();
document.getElementById("ha-publishfilelabel").style.pointerEvents = "none";
document.getElementById("ha-lds-ellipsis-publish").style.display = "inline-block";
document.getElementById("ha-publishmessage").style.opacity = "0";
await fetch(oFormElement.action, {
method: 'POST',
headers: {
'RequestVerificationToken': getCookie('RequestVerificationToken')
}
})
.then(response => response.json())
.then(json => {
if ("Error" in json) {
document.getElementById("ha-publishfilelabel").style.pointerEvents = "auto";
document.getElementById("ha-lds-ellipsis-publish").style.display = "none";
document.getElementById("ha-publishmessage").style.opacity = "1";
document.getElementById("publish-result").value = json.Error;
} else {
document.getElementById("ha-publishfilelabel").style.pointerEvents = "auto";
document.getElementById("ha-lds-ellipsis-publish").style.display = "none";
document.getElementById("ha-publishmessage").style.opacity = "1";
document.getElementById("publish-result").value = "Erfolg!";
location.reload();
}
})
.catch((e) => {
document.getElementById("ha-publishfilelabel").style.pointerEvents = "auto";
document.getElementById("ha-lds-ellipsis-publish").style.display = "none";
document.getElementById("publish-result").value = "Keine Antwort. Bitte Seite neu laden!";
})
}
var publishelement = document.getElementById("ha-publishform");
var publishbutton = document.getElementById("ha-publishfilelabel");
publishbutton.addEventListener("click", () => LOCALPUBLISHSubmit(publishelement));
};
startup_publishform();

View File

@@ -16,4 +16,4 @@ const startup_search = function () {
searchfilter.addEventListener("input", () => ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn));
}
startup_search();
export { startup_search };

View File

@@ -147,4 +147,4 @@ const startup_websocket = function () {
}
};
startup_websocket();
export { startup_websocket };