Help Locating A Couple Items in Manager Javascript Files

I’m working on a proposed refactor of the manager’s TV panel and have a couple items I can’t seem to track down:

  1. The code that generates the field reset functionality as seen in the Resource panel (hovering shows a reset icon to the right of the label; clicking the label resets the field). I’d like to integrate that same feature into the TV panel, preferably hooking into the same method or altering it (or its class placement) to be usable in both panels.

  2. The code that inserts the field required marker (*). This is one where I take issue with how it’s currently implemented in 3.x (which was changed from 2.x); inserting the asterisk before the label just doesn’t look right. From a interface design perspective it doesn’t make sense to throw off the visual alignment of the labels by doing so. Please consider reversing course on this one :wink:

Thanks for your help!

1 Like

I believe the code that inserts the field required marker (*) for TVs is here:

One down. Thanks so much!

About your second item:
It’s unclear to me what you mean by “field reset functionality”.
The only thing I can see, is a “Set to default” button that already exists in the tab “Template Variables” for the TVs, so I’m not sure where else you want to integrate this functionality.

Yes, it exists in the TV panel in the Resource editing pages, but not in the Element editing panels (i.e., when you are creating or editing the TV itself) … and that’s where I’d like to add the functionality.

I’m sceptical if there is much benefit in doing that.

Nevertheless, here is the code that resets the TVs.

Thank you again!

Yes, the benefit will only be apparent with the changes I’ll be proposing. The relevant change here is that I’ve added the ability to click on the various code examples given in the help descriptions, which inserts that sample code into the field the help refers to. But, with that addition and in cases where a field is already filled, I don’t want users to inadvertently click on an example and lose whatever value they’d already entered.