fcb6dc8dfa166136193177c895ca181200850e4d max Mon Jan 19 06:02:31 2026 -0800 changing superTrack TrackUi quite a bit. Removing dropdowns and replacing them with buttons. Also adding buttons for setting all tracks or all visible tracks to a visibility. While at it, making a change to the js-query-library function (inversed the order of arguments) which was requested months ago by Brian, but I forgot to make the change after code review. Also shortening the "source data version" label to just "version". refs #36917. I changed the library function hTvDropDownClassVisOnlyAndExtra() rather than copying the code. This was because I was hesitant to copy/paste all this code into a second function, which would have been the only alternative, as the function cannot be reused as-is. So I modified the function to return the list of visibilities. It's never clear whether it's better to modify functions or copy/paste code. here, not breaking the function into smaller parts, so copy/pasting it, would risk requiring more future copy/pasted code. But the risk is to break existing tracks. diff --git src/lib/cheapcgi.c src/lib/cheapcgi.c index b9bce63b35f..47af4cca3e8 100644 --- src/lib/cheapcgi.c +++ src/lib/cheapcgi.c @@ -194,31 +194,31 @@ } void jsAddEventForId(char *eventName, char *idText, char *jsText) { checkValidEvent(eventName); jsInlineF("document.getElementById('%s').addEventListener('%s', %s);\n", javaScriptLiteralEncode(idText), eventName, jsText); } void jsOnEventById(char *eventName, char *idText, char *jsText) /* Add js mapping for inline event */ { checkValidEvent(eventName); jsInlineF("document.getElementById('%s').on%s = function(event) {if (!event) {event=window.event}; %s};\n", javaScriptLiteralEncode(idText), eventName, jsText); } -void jsOnEventBySelector(char *query, char *eventName, char *jsText) +void jsOnEventBySelector(char *eventName, char *query, char *jsText) /* Add js mapping for inline event given a query selector, e.g. '.className' */ { checkValidEvent(eventName); jsInlineF("document.querySelectorAll('%s').forEach(function (el) { el.addEventListener( '%s', function(event) { %s })});\n", query, eventName, jsText); } void jsOnEventByIdF(char *eventName, char *idText, char *format, ...) /* Add js mapping for inline event with printf formatting */ { checkValidEvent(eventName); jsInlineF("document.getElementById('%s').on%s = function(event) {if (!event) {event=window.event}; ", javaScriptLiteralEncode(idText), eventName); va_list args; va_start(args, format); dyStringVaPrintf(jsInlineLines, format, args); @@ -2113,31 +2113,33 @@ void cgiMakeDropListClassWithIdStyleAndJavascript(char *name, char *id, char *menu[], int menuSize, char *checked, char *class, char *style, struct slPair *events) /* Make a drop-down list with name, id, text class, style and javascript. */ { int i; char *selString; if (checked == NULL) checked = menu[0]; printf("<SELECT"); if (name) printf(" NAME='%s'", name); if (events && !id) // use name as id id = name; if (id) printf(" id='%s'", id); if (class) - printf(" class='%s'", class); + printf(" class='vizSelect %s'", class); +else + printf(" class='vizSelect'"); if (events) { struct slPair *e; for(e = events; e; e = e->next) { jsOnEventById(e->name, id, e->val); } } if (style) printf(" style='%s'", style); printf(">\n"); for (i=0; i<menuSize; ++i) { if (sameWord(menu[i], checked)) selString = " SELECTED";