nesges / widgets-for-fhem-tablet-ui Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hey,
Ich habe gesehen, dass du die Demo leider offline gehen nehmen musstest. Ich hätte einen Server mit reichlich Kapazität rumstehen, eventuell wäre das eine Lösung für Dich?
Kontaktiere mich am einfachsten mal per Mail [email protected]
Some widgets can't coexist because they share a global variable named "base". Specifically settimer won't work if there's a volume or joinedlabel in the same html page.
<div data-type="settimer" data-device="Wecker" data-cmd="set"></div>
and <div data-type="joinedlabel" data-device="Twilight" data-glue=" – " data-get='["sr","ss"]'>
Note: This is kind of a race condition between which widget gets initialized first. It may or may not work (I had one condition where it would work in Firefox but not in Chrome).
After step 2 the command "Wecker NaN:NaN" is displayed:
The timer should have been set
I've traced the problem to line
$ grep -r base=this . | grep -v var
./widget_wind_direction.js: base=this;
./widget_knob.js: base=this;
./widget_kodinowplaying.js: base=this;
./widget_weather.js: base=this;
./widget_weather.js: base=this;
./widget_image.js: base=this;
./widget_thermostat.js: base=this;
./widget_settimer.js: base=this;
./widget_volume.js: base=this;
./widget_simplechart.js: base=this;
./widget_mpdnowplaying.js: base=this;
./widget_joinedlabel.js: base=this;
./widget_klimatrend.js: base=this;
Because "base" is a global variable, in button_set.famultibutton.toggleOn()
(
base.widgetname
may or may not refer to the intended value. See this screenshot from the Chrome debugger:Even though I know where the problem is, I have no earthly idea how to fix it, because the byzantine way that JavaScript pretends to be able to do OO programming with classes and inheritance always makes my brain hurt. Simply prepending base=this
with a var
doesn't work, because then it would be local to init()
.
Hi,
since the last fhem update i get this:
widget_clock.js:2 Uncaught ReferenceError: loadplugin is not defined(anonymous function) @ widget_clock.js:2
fhem-tablet-ui.js:317 initPage: 465.491ms
Hi,
proposal for english wind-direction in widget:
data-lang="en"
(default is german)
changed wind_direction.js as attached.
Is it possible for you to check it in? feel free to change it
Regards!
ich versuche aber gerade das weather widget bei mir einzubinden. PROPLANTA liefert bei mir "Schneeregen", damit klappt das mapping nicht: TypeError: mapped is undefined
Wie soll diese Schleife bewirken?
[quote] var mapped = _weather.translationmap[val];
while(typeof mapped != "undefined" && !mapped.match(/^:/)) {
mapped = _weather.translationmap[mapped];
}[/quote]
Danach muss sicherheitshalber nochmal auf (typeof mapped != "undefined") geprüft werden bevor versucht wird, mapped zu benutzen.
Problem is, widget_iframe should be under widget_famultibutton - it's not correct in your hierarchy-view too...
doesn't do anything, but errors, you have to add these lines at the beginning of widget_iframe.js:
function depends_iframe (){
if(typeof Module_famultibutton == 'undefined')
return ["famultibutton"];
};
Bye & thanks for the good work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.