Page 1 of 1

Code that hides elements whose name is prefixed with a $

Posted: Sunday 20 July 2025 22:41
by redswan
Hi all,

I'm looking for the file(s) that contain the code for hiding elements by prefixing the name with a $. I've looked through a lot of the source, XXcontroller.js, some .cpp, to no avail. Is this done server side or client side - I imagine it's client side. If someone can point me in the right direction I'd me most grateful. I have an idea for another use of this idea, with a different character - hiding the icon - especially for text devices and was curious how this was implemented.

Thanks in advance.

Chris

Re: Code that hides elements whose name is prefixed with a $

Posted: Monday 21 July 2025 9:43
by HvdW
Here you go Chris.
viewtopic.php?t=42583

Re: Code that hides elements whose name is prefixed with a $

Posted: Monday 21 July 2025 11:03
by waltervl
redswan wrote: Sunday 20 July 2025 22:41 I have an idea for another use of this idea, with a different character - hiding the icon - especially for text devices and was curious how this was implemented.
This requested functionality could better be implemented by an edit option on the device, not by some special character in the name.
This probably would require an extra column in the device definition table of the database.
Perhaps not needed if you would add an option to change the icon to none instead of default or some custom.

Or a default UI setting in menu Setup-Settings to hide Icons for Text devices.

You could also hide icons for text devices in the theme.

Re: Code that hides elements whose name is prefixed with a $

Posted: Tuesday 22 July 2025 11:07
by redswan
HvdW wrote: Monday 21 July 2025 9:43 Here you go Chris.
viewtopic.php?t=42583
Thanks HvdW for the tip but I was actually looking for the code which implemented this, i.e. detects the presence of a $ and hides the device.
waltervl wrote: Monday 21 July 2025 11:03 This requested functionality could better be implemented by an edit option on the device, not by some special character in the name.
This probably would require an extra column in the device definition table of the database.
Agreed, it was just an idea and I wondered how the $ mechanism was implemented.
waltervl wrote: Monday 21 July 2025 11:03 Perhaps not needed if you would add an option to change the icon to none instead of default or some custom.
I'd also thought of this, in fact I have already, almost, implemented this on my installation. i.e. I hide the icon if it is the default icon. Maybe the default icon for Text devices could be "none" though this would change the behaviour for current installations.
Probably the easiest solution to implement.
waltervl wrote: Monday 21 July 2025 11:03 Or a default UI setting in menu Setup-Settings to hide Icons for Text devices.

You could also hide icons for text devices in the theme.

Re: Code that hides elements whose name is prefixed with a $

Posted: Tuesday 22 July 2025 13:57
by Kedi
I think if you search the source of 'WebServerCmds.cpp' and/or 'WebServer.cpp' for '$' you will find what you are searching for.

Re: Code that hides elements whose name is prefixed with a $

Posted: Tuesday 22 July 2025 16:06
by redswan
Kedi wrote: Tuesday 22 July 2025 13:57 I think if you search the source of 'WebServerCmds.cpp' and/or 'WebServer.cpp' for '$' you will find what you are searching for.
Thanks Kedi, I missed those files as I only looked in the folder "webserver" and not in "main". All I have to do now is understand ;)

Re: Code that hides elements whose name is prefixed with a $

Posted: Tuesday 22 July 2025 18:12
by HvdW
When you have found how it works please share how to hide the icons in text devices.