Custom JavaScript examples - 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: Custom JavaScript examples (/showthread.php?tid=275) |
RE: Custom JavaScript examples - baggins - 11.12.2017 (11.12.2017, 11:15)Daniel. Wrote: I do it always in private browsing then you are sure all is fresh. Good practice is to clear browser cache when strange things start to happen. Thanks! Reloading the browser did the trick. I had to do this even in private mode. Another question: the addresses I use are boolean. Now when it is set to 1, the plan is shown. If I then go to another page on my visualization, and then the value returns to 0, the plan is shown again. Is there a way to avoid this? So the plan should only show when the variable is set to 1 and not when it returns to 0. BR RE: Custom JavaScript examples - admin - 11.12.2017 Code: $(function(){ RE: Custom JavaScript examples - baggins - 11.12.2017 (11.12.2017, 11:52)admin Wrote: Perfect! Thanks. RE: Custom JavaScript examples - AEK - 22.01.2018 (16.12.2016, 14:58)admin Wrote: Please post in English next timeHi admin, I have some problems with this script. I use boolen object, I changed value == 1 to value == true/false. When I'm changing value from false to true, my visu page is switching. But when I Send True once again nothing happens. to make it works I nedd to switch my object to false and then to true. whats the reason of this behavour? (tested on 20170620 FW) the second thing I need is the opposite task. I need to write some value to object when specific plan is Opened. could you help me? RE: Custom JavaScript examples - Erwin van der Zwart - 22.01.2018 Hi, Change line 16 with extra parameter to execute on same object value like this: },true); BR, Erwin RE: Custom JavaScript examples - AEK - 22.01.2018 (22.01.2018, 08:35)Erwin van der Zwart Wrote: Hi, Thanks, Erwin. what about my second question? "the second thing I need is the opposite task. I need to write some value to object when specific plan is Opened. could you help me?" RE: Custom JavaScript examples - Erwin van der Zwart - 22.01.2018 Hi, Try this: Code: $(function(){ Code: $(function(){ BR, Erwin RE: Custom JavaScript examples - admin - 22.01.2018 There's a showplan event that can be used: Code: $(function(){ As for value comparison, can you post whole code? RE: Custom JavaScript examples - gdimaria - 02.03.2018 Hi, is there the possibility to hide/show a specific object from visualization on an event accours? Thanks Peppe RE: Custom JavaScript examples - Erwin van der Zwart - 02.03.2018 Hi, Use custom JS like below and add custom class 'hidebyknx' to your elements that needs to be included: Code: $(function(){ BR, Erwin RE: Custom JavaScript examples - gdimaria - 02.03.2018 (02.03.2018, 11:07)Erwin van der Zwart Wrote: Hi, It works, thank you so much! is there a list of applicable custom classes (knx and not knx)? eg. I would need to refresh the values of the objects contained in a plan or widget when it is displayed and I do not want to bore you with too many requests RE: Custom JavaScript examples - Erwin van der Zwart - 02.03.2018 Hi, Objects are always refreshed on changes so i don’t see why you need to do that.. There is no list of classnames and they have nothing to do with KNX ... BR, Erwin RE: Custom JavaScript examples - gdimaria - 02.03.2018 (02.03.2018, 19:42)Erwin van der Zwart Wrote: Hi, sorry for not explaining better: when I open a widget containing objects, often the values of the objects (feeds) are not updated and I have to do a group reading - myobject:read() by clicking a button. I would like to know if it is possible to read automatically when the page is opened. Thank you. RE: Custom JavaScript examples - Erwin van der Zwart - 03.03.2018 Yes i understand, but you should not need it.. There must be a reason why your objects are not in sync, you need to find out why instead of implementing a bandage that should not be there.. BR, Erwin RE: Custom JavaScript examples - Alphaplasti - 04.03.2018 (11.10.2016, 09:59)buuuudzik Wrote: Here is some svg image and custom script which can be used for learning manipulating svg images by custom javascript. I used Inkscape for editing svg image(e.g. adding new elements). Hello buuuudzik, and everyone, I'm trying your script with svg but it's doesn't work, I think I failed to link svg to script, I don't understand this line : var svg = $('object')[0]; // Choosing svg Can you explain me how to choose svg please ? Thanks a lot Adrien RE: Custom JavaScript examples - buuuudzik - 04.03.2018 Code: $('object') was for selecting the container of your svg element but better way(because you probably have more than one svg image or object) is to add Additional class 'blind1' to this svg image in the visualisatiuon editior and select in this way: Code: $('.blind1 > object') I've tested a minute ago and it seems to work but now I propose to generate HTML via Custom Javascript or create simple app for same task. Full code: Code: // Manipulating SVG images RE: Custom JavaScript examples - Alphaplasti - 05.03.2018 Thank you ! It work perfect, now i can learn about Js and svg manipulation ! RE: Custom JavaScript examples - buuuudzik - 05.03.2018 (05.03.2018, 07:45)Alphaplasti Wrote: Thank you ! It work perfect, now i can learn about Js and svg manipulation ! Good luck, if you have some question please ask RE: Custom JavaScript examples - Alphaplasti - 05.03.2018 (05.03.2018, 08:13)buuuudzik Wrote:(05.03.2018, 07:45)Alphaplasti Wrote: Thank you ! It work perfect, now i can learn about Js and svg manipulation ! Thanks sooo a last question about svg manipulation, How to change a transform function, like "transform="rotate(140, 24, 24)" of a svg ? I tried to adapt Js embedded scrip from svg but It dont work in JS, I've make a mistake or it's not the same JS ? ( I'm a noob on JS..) Thanks! Edit: It's okay, all work, a little mistake in my script thanks ! RE: Custom JavaScript examples - buuuudzik - 06.03.2018 Please check here: https://stackoverflow.com/questions/34689196/svg-animation-using-transform-is-offsetting-the-element |