692065227f9b0f987144c4608ffd6c31ce2af35d kate Mon Jul 29 17:45:05 2019 -0700 Add support for styling submit buttons to indicate if they have been pressed (in modal mode). Do this for reverse and multi-region buttons on hgTracks. refs #23922 diff --git src/hg/lib/hPrint.c src/hg/lib/hPrint.c index eda4fae..f1cb7bf 100644 --- src/hg/lib/hPrint.c +++ src/hg/lib/hPrint.c @@ -81,56 +81,61 @@ void hPutc(char c) /* putc that can be suppressed if not making html. */ { if (!suppressHtml) fputc(c, stdout); } void hWrites(char *string) /* Write string with no '\n' if not suppressed. */ { if (!suppressHtml) fputs(string, stdout); } +void hButtonMaybePressed(char *name, char *label, char *msg, char *onClick, boolean pressed) +/* If not suppresed, write out button optionally with onclick javascript, message and + styled to indicate modal state (button pressed) + */ +{ +if (!suppressHtml) + cgiMakeSubmitButtonMaybePressed(name, label, msg, onClick, pressed); +} + void hButton(char *name, char *label) /* Write out button if not suppressed. */ { -if (!suppressHtml) - cgiMakeButton(name, label); +hButtonMaybePressed(name, label, NULL, NULL, FALSE); } void hButtonWithMsg(char *name, char *label, char *msg) /* Write out button with msg if not suppressed. */ { -if (!suppressHtml) - cgiMakeButtonWithMsg(name, label, msg); +hButtonMaybePressed(name, label, msg, NULL, FALSE); } void hButtonWithOnClick(char *name, char *label, char *msg, char *onClick) /* Write out button with onclick javascript if not suppressed. */ { -if (!suppressHtml) - cgiMakeButtonWithOnClick(name, label, msg, onClick); +hButtonMaybePressed(name, label, msg, onClick, FALSE); } void hOnClickButton(char *id, char *command, char *label) -/* Write out push button if not suppressed. */ +/* Write out button with onclick command */ { -if (!suppressHtml) - cgiMakeOnClickButton(id, command, label); +hButtonMaybePressed(id, label, NULL, command, FALSE); } void hTextVar(char *varName, char *initialVal, int charSize) /* Write out text entry field if not suppressed. */ { if (!suppressHtml) cgiMakeTextVar(varName, initialVal, charSize); } void hIntVar(char *varName, int initialVal, int maxDigits) /* Write out numerical entry field if not supressed. */ { if (!suppressHtml) cgiMakeIntVar(varName, initialVal, maxDigits); }