a53b9958fa734f73aeffb9ddfe2fbad1ca65f90c
galt
  Mon Jan 30 16:18:41 2017 -0800
Check-in of CSP2 Content-Security-Policy work. All C-language CGIs should now support CSP2 in browser to stop major forms of XSS javascript injection. Javascript on pages is gathered together, and then emitted in a single script block at the end with a nonce that tells the browser, this is js that we generated instead of being injected by a hacker. Both inline script from script blocks and inline js event handlers had to be pulled out and separated. You will not see js sprinkled through-out the page now. Older browsers that support CSP1 or that do not understand CSP at all will still work, just without protection. External js libraries loaded at runtime need to be added to the CSP policy header in src/lib/htmshell.c.

diff --git src/hg/lib/hPrint.c src/hg/lib/hPrint.c
index 9256da5..0e52fd3 100644
--- src/hg/lib/hPrint.c
+++ src/hg/lib/hPrint.c
@@ -102,35 +102,35 @@
 
 void hButtonWithMsg(char *name, char *label, char *msg)
 /* Write out button with msg if not suppressed. */
 {
 if (!suppressHtml)
     cgiMakeButtonWithMsg(name, label, msg);
 }
 
 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);
 }
 
-void hOnClickButton(char *command, char *label)
+void hOnClickButton(char *id, char *command, char *label)
 /* Write out push button if not suppressed. */
 {
 if (!suppressHtml)
-    cgiMakeOnClickButton(command, label);
+    cgiMakeOnClickButton(id, command, label);
 }
 
 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);
 }