diff --git a/lib/api/GwApi.h b/lib/api/GwApi.h index afef372..9611707 100644 --- a/lib/api/GwApi.h +++ b/lib/api/GwApi.h @@ -129,4 +129,7 @@ class GwApi{ #ifndef DECLARE_CAPABILITY #define DECLARE_CAPABILITY(name,value) #endif +#ifndef DECLARE_STRING_CAPABILITY +#define DECLARE_STRING_CAPABILITY(name,value) +#endif #endif diff --git a/lib/exampletask/GwExampleTask.h b/lib/exampletask/GwExampleTask.h index b759c93..cb128a5 100644 --- a/lib/exampletask/GwExampleTask.h +++ b/lib/exampletask/GwExampleTask.h @@ -46,4 +46,6 @@ DECLARE_CAPABILITY(testboard2,true); //hide some config value //just set HIDE + the name of the config item to true DECLARE_CAPABILITY(HIDEminXdrInterval,true); + +DECLARE_STRING_CAPABILITY(HELP_URL,"https://www.wellenvogel.de"); #endif \ No newline at end of file diff --git a/lib/usercode/GwUserCode.cpp b/lib/usercode/GwUserCode.cpp index df5a633..1e36e13 100644 --- a/lib/usercode/GwUserCode.cpp +++ b/lib/usercode/GwUserCode.cpp @@ -41,7 +41,8 @@ class GwUserCapability{ #define DECLARE_USERTASK(task) GwUserTaskDef __##task##__(task,#task); #define DECLARE_USERTASK_PARAM(task,...) GwUserTaskDef __##task##__(task,#task,__VA_ARGS__); #define DECLARE_INITFUNCTION(task) GwInitTask __Init##task##__(task,#task); -#define DECLARE_CAPABILITY(name,value) GwUserCapability __CAP##name##__(#name,#value); +#define DECLARE_CAPABILITY(name,value) GwUserCapability __CAP##name##__(#name,#value); +#define DECLARE_STRING_CAPABILITY(name,value) GwUserCapability __CAP##name##__(#name,value); #include "GwApi.h" #include "GwUserTasks.h" class TaskApi : public GwApi diff --git a/web/index.html b/web/index.html index c5bde6e..a607101 100644 --- a/web/index.html +++ b/web/index.html @@ -21,6 +21,7 @@
XDR
Data
Update
+
Help
diff --git a/web/index.js b/web/index.js index ae9a10c..d66723b 100644 --- a/web/index.js +++ b/web/index.js @@ -1073,6 +1073,10 @@ function createConfigDefinitions(parent, capabilities, defs,includeXdr) { function loadConfigDefinitions() { getJson("api/capabilities") .then(function (capabilities) { + if (capabilities.HELP_URL){ + let el=document.getElementById('helpButton'); + if (el) el.setAttribute('data-url',capabilities.HELP_URL); + } getJson("config.json") .then(function (defs) { getJson("xdrconfig.json") @@ -1191,7 +1195,11 @@ function converterInfo() { } function handleTab(el) { let activeName = el.getAttribute('data-page'); - if (!activeName) return; + if (!activeName) { + let extUrl= el.getAttribute('data-url'); + if (! extUrl) return; + window.open(extUrl,el.getAttribute('data-window')||'_'); + } let activeTab = document.getElementById(activeName); if (!activeTab) return; let all = document.querySelectorAll('.tabPage');