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:
3
lib/exampletask/index.css
Normal file
3
lib/exampletask/index.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.examplecss{
|
||||
background-color: coral;
|
||||
}
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user