3saul
May 29, 2015, 2:47am
1
This may already be possible (if it is then please let me know how to accomplish it) - I’d like the ability to identify if I have already used a class name somewhere in my project. This would save time troubleshooting when a scene gets complicated with lots of new elements and accidentally naming one the same as an existing element.
this will tell how many elements have a certain class name.
var z = document.getElementsByClassName('myClassName').length;
alert (z);
It will return a 0 (zero) if no elements are found with the class named “myClassName”
2 Likes
MarkHunte
(Mark Hunte)
May 30, 2015, 8:34am
3
I have made a template that will allow you to have a place where you can see the used classes and their ids.
This template allows you to get a quick list of element class names along with their ID.
This may help in debugging where you have a large project with a lot of class names and you may have reused a name by mistake.
As in this feature request:
http://forums.tumult.com/t/list-of-used-class-names/2533?u=markhunte33?u=markhunte
The template has a DUMMY SCENE for demonstration which has some example elements with class names and ids.
And a CLASSLIST scene which is where when select it and P…
MarkHunte
(Mark Hunte)
May 30, 2015, 10:39am
5
I have added a second template which I think is better.
This is a second template. Which I think is easier to use.
It has two dummy scenes which you can replace as you will.
The usage of this one is you add a button to your scene ( you can make it a persistent symbol so that it shows up on all scenes.)
Add the On Mouse click action run javascript = classList() to the button. ( if it is a symbol then add the action while in symbol edit mode)
The button will toggle a class-id list display (scrollable )on and off on the current page.
The class-id…
MarkHunte
(Mark Hunte)
May 30, 2015, 7:25pm
6
Hopefully this is my last iteration of this
So I could not resist trying to be able to click on an item in the class list and highlighting the corresponding element.
This template does that
There is now an highlight link under each class. Clicking it will place a red outline around the element.
When you click a highlight link for an element that is not on the the current scene, the element is still highlighted .
You can navigate through the scenes to look for it.
Toggling the class list display off will remove all outline…