Logic Machine Forum
Alerts - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Alerts (/showthread.php?tid=2165)



Alerts - impactoz - 19.07.2019

Would it be possible to write using JavaScript an Alert screen - but more advanced than just an alert call...

Would like just an OK button - but showing a graphic image...

How can JavaScript reference items in the graphic library (if at all) ?

Just thinking of a weekly reminder to put the rubbish bins out - having a picture of the rubbish bin and an OK button....


RE: Alerts - Erwin van der Zwart - 21.07.2019

Hi,

What you could do is create separate plans with the messages you like to show and jump to the desired plan by a KNX value. On each message plan you create a OK button that makes the visu jump back to the start page. This requires a few lines of JS.

To change the plans with KNX value you need a small LUA event based script that is triggered by binary objects with tag 'messages'. If a object with a certain name gets true you change a KNX object to a certain value and the visu will show the message you created.

Is this something you search? I have already JS and LUA scripts that does these things.

Another way is to build real HTML pop-ups that holds icons etcetera with JS on the fly, but this is a lot more complex.

BR,

Erwin


RE: Alerts - impactoz - 21.07.2019

I do like your idea - really simple by creating a new plan...  But my initial thought would be that plan would then be visible on the drop down menu - and I would not want that to be seen....
Searching found I can change this via the CSS 
#menu-plan-14 { display:none; }

So I am on the path to progress... Playing around is fun - just need a little knowledge...

Is there an easy way to make this modal - so the user is unable to select anything else other than the button I supply on the popup

Thanks