1.started removal of CDNs.\n 2. Improved modular structure for all parts of project including database.

This commit is contained in:
2024-08-30 23:27:28 +01:00
parent 18977c8cac
commit f9cd9ec33a
2895 changed files with 490579 additions and 7561 deletions

33
static/js/dom.js Normal file
View File

@@ -0,0 +1,33 @@
// Module for DOM manipulation
export default class DOM {
static updateElement(id, data) {
const element = document.getElementById(id);
if (element) {
element.textContent = data;
}
}
// Add more DOM manipulation methods as needed
static convertForm2JSON(elementForm) {
formData = {}
formDataTmp = elementForm.serializeArray();
formDataTmp.forEach((value, key) => {
formData[key] = value;
/*
console.log('key: ' + key);
console.log('value: ' + value);
*/
});
return formData;
}
static loadPageBody(contentNew) {
let pageBody = document.querySelector(idPageBody);
pageBody.innerHTML = contentNew;
}
static getHashPageCurrent() {
return document.body.dataset.page;
}
}