1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-18 00:03:07 +01:00

first trigger of builds via GUI

This commit is contained in:
andreas
2023-09-05 21:15:07 +02:00
parent 56b5598c15
commit 0e0be14415
7 changed files with 239 additions and 37 deletions

View File

@@ -72,39 +72,6 @@ class ESPInstaller{
// Return the unescaped value minus everything starting from the equals sign or an empty string
return decodeURIComponent(!!value ? value.toString().replace(/^[^=]+./,"") : "");
};
/**
* add an HTML element
* @param {*} type
* @param {*} clazz
* @param {*} parent
* @param {*} text
* @returns
*/
static addEl(type, clazz, parent, text) {
let el = document.createElement(type);
if (clazz) {
if (!(clazz instanceof Array)) {
clazz = clazz.split(/ */);
}
clazz.forEach(function (ce) {
el.classList.add(ce);
});
}
if (text) el.textContent = text;
if (parent) parent.appendChild(el);
return el;
}
/**
* call a function for each matching element
* @param {*} selector
* @param {*} cb
*/
static forEachEl(selector,cb){
let arr=document.querySelectorAll(selector);
for (let i=0;i<arr.length;i++){
cb(arr[i]);
}
}
static checkAvailable(){
if (! navigator.serial || ! navigator.serial.requestPort) return false;
return true;