Web view still in progress

This commit is contained in:
Claude Brisson
2023-11-05 13:51:01 +01:00
parent 5fdf3e8944
commit 5f068476dc
111 changed files with 8905 additions and 215 deletions

View File

@@ -78,27 +78,27 @@ Element.prototype.data = function (key) {
NodeList.prototype.data = function(key) {
this.item(0).data(key);
}
NodeList.prototype.show = function(key) {
this.item(0).show(key);
NodeList.prototype.show = function() {
this.item(0).show();
return this;
}
Element.prototype.show = function (key) {
Element.prototype.show = function() {
this.style.display = 'block';
}
NodeList.prototype.hide = function(key) {
this.item(0).hide(key);
NodeList.prototype.hide = function() {
this.item(0).hide();
return this;
}
Element.prototype.hide = function (key) {
Element.prototype.hide = function() {
this.style.display = 'none';
}
let initFunctions = [];
function onLoad(fct) {
if (typeof(fct) == "function") initFunctions.push(fct);
NodeList.prototype.text = function(txt) {
this.item(0).text(txt);
}
Element.prototype.text = function(txt) {
if (typeof(txt) === 'undefined') {
return this.textContent;
} else {
this.textContent = txt;
}
}
document.on("DOMContentLoaded", () => {
initFunctions.forEach(fct => {
fct();
});
});