af730d9e24c0642fe39657f890bc117ed015ccbf
galt
Wed Feb 15 01:12:26 2017 -0800
CSP code cleanup. Using new var-args versions of functions jsInlineF and jsOnEventByIdF to avoid using lots of fixed-size local javascript strings.
diff --git src/hg/hgSession/hgSession.c src/hg/hgSession/hgSession.c
index 4217a15..0945b80 100644
--- src/hg/hgSession/hgSession.c
+++ src/hg/hgSession/hgSession.c
@@ -963,44 +963,40 @@
hgsNewSessionName, hgsNewSessionName, 32, sessionName);
jsOnEventById("change" , hgsNewSessionName, highlightAccChanges);
jsOnEventById("keypress", hgsNewSessionName, highlightAccChanges);
dyStringPrintf(dyMessage,
" "
" "
" "
" "
"
\n",
hgsLoadPrefix, encSessionName,
hgsDeletePrefix, encSessionName, hgsDeletePrefix, encSessionName,
hgsDoSessionChange, hgsDoSessionChange, hgsCancel);
char id[256];
safef(id, sizeof id, "%s%s", hgsDeletePrefix, encSessionName);
- char javascript[1024];
- safef(javascript, sizeof javascript, confirmDeleteFormat, encSessionName);
- jsOnEventById("click", id, javascript);
+ jsOnEventByIdF("click", id, confirmDeleteFormat, encSessionName);
dyStringPrintf(dyMessage,
"Share with others? \n"
"
\n",
hgsSharePrefix, encSessionName, (shared>0 ? " CHECKED" : ""),
cgiBooleanShadowPrefix(), hgsSharePrefix, encSessionName);
- safef(javascript, sizeof javascript, "{%s %s}", highlightAccChanges, toggleGalleryDisable);
- jsOnEventById("change", "detailsSharedCheckbox", javascript);
- safef(javascript, sizeof javascript, "{%s %s}", highlightAccChanges, toggleGalleryDisable);
- jsOnEventById("click" , "detailsSharedCheckbox", javascript);
+ jsOnEventByIdF("change", "detailsSharedCheckbox", "{%s %s}", highlightAccChanges, toggleGalleryDisable);
+ jsOnEventByIdF("click" , "detailsSharedCheckbox", "{%s %s}", highlightAccChanges, toggleGalleryDisable);
dyStringPrintf(dyMessage,
"List in Public Sessions? \n"
"
\n",
hgsGalleryPrefix, encSessionName, (shared>=2 ? " CHECKED" : ""),
cgiBooleanShadowPrefix(), hgsGalleryPrefix, encSessionName);
jsOnEventById("change", "detailsGalleryCheckbox", highlightAccChanges);
jsOnEventById("click" , "detailsGalleryCheckbox", highlightAccChanges);
/* Set initial disabled state of the gallery checkbox */
jsInline(toggleGalleryDisable);
dyStringPrintf(dyMessage,
"Created on %s.
\n", firstUse);
/* Print custom track counts per assembly */