reorganize public JS files

This commit is contained in:
Vincent CLAVIEN
2025-01-15 17:25:51 +01:00
parent a33a55ea0b
commit 9712d2d382
12 changed files with 323 additions and 316 deletions

View File

@@ -0,0 +1,40 @@
drag.init("app");
document.addEventListener("alpine:init", () => {
// create and init stores
Alpine.store("files", filesStore);
Alpine.store("lightbox", lightboxStore);
Alpine.store("ui", uiStore);
Alpine.store("userPrefs", userPrefsStore);
const salutations = [
"Hi!",
"Hiya!",
"Hello there!",
"Good day!",
"Hullo!",
"Buongiorno!",
"Guten Tag!",
"Bonjour!",
"Oh hey!",
];
Alpine.store("ui").logMsg(`MARL loaded. ${salutations[Math.floor(Math.random() * salutations.length)]} 😊`);
resetStores();
});
// i18n
let appStrings = {};
for (const lang in appLangs) {
const script = document.createElement("script");
script.src = `js/i18n/${lang}.js`;
document.head.appendChild(script);
}
document.addEventListener("alpine-i18n:ready", function () {
AlpineI18n.create("en", appStrings);
AlpineI18n.fallbackLocale = "en";
setLang();
});