1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2025-12-13 05:53:06 +01:00

allow to add an url tab button

This commit is contained in:
andreas
2024-10-13 17:12:10 +02:00
parent 47973b6bcf
commit 795117b6f4
4 changed files with 17 additions and 3 deletions

View File

@@ -0,0 +1,3 @@
.examplecss{
background-color: coral;
}

View File

@@ -8,6 +8,7 @@
let isActive=false;
const tabName="example";
const configName="exampleBDSel";
const infoUrl='https://github.com/wellenvogel/esp32-nmea2000/tree/master/lib/exampletask';
let boatItemName;
let boatItemElement;
api.registerListener((id,data)=>{
@@ -21,7 +22,12 @@
//using normal dom manipulation methods
//you can use the helper addEl to create elements
let page=api.addTabPage(tabName,"Example");
api.addEl('div','',page,"this is a test tab");
api.addEl('div','hdg',page,"this is a test tab");
api.addEl('button','',page,'Info').addEventListener('click',function(ev){
window.open(infoUrl,'info');
})
//add a tab for an external URL
api.addTabPage('exhelp','Info',infoUrl);
}
}
if (isActive){