8bf3bd8ce2aac20d76aced7838628f2a343ad8ff larrym Thu Nov 3 13:15:30 2011 -0700 add replaceRegEx diff --git src/hg/inc/jsHelper.h src/hg/inc/jsHelper.h index 25858c9..b597b1a 100644 --- src/hg/inc/jsHelper.h +++ src/hg/inc/jsHelper.h @@ -117,30 +117,35 @@ /* Make submit button which uses javascript to apply check all or uncheck all to all * checkboxes with given idPrefix. * state parameter determines whether to "check all" or "uncheck all" (TRUE means "check all"). * id parameter may be NULL */ char *jsStripJavascript(char *str); /* Strip out anything that looks like javascript in html string. This function is designed to cleanup user input (e.g. to avoid XSS attacks). Returned string should be free'ed after use. */ char *stripRegEx(char *str, char *regEx, int flags); /* Strip out text matching regEx from str. flags is passed through to regcomp as the cflags argument. Returned string should be free'ed after use. */ +char *replaceRegEx(char *str, char *replace, char *regEx, int flags); +/* Replace text matching regEx in str with replace string. + flags is passed through to regcomp as the cflags argument. + Returned string should be free'ed after use. */ + void jsBeginCollapsibleSection(struct cart *cart, char *track, char *section, char *sectionTitle, boolean isOpenDefault); /* Make the hidden input, collapse/expand button and <TR id=...> needed for utils.js's * setTableRowVisibility(). Caller needs to have already created a <TABLE> and <FORM>. */ void jsEndCollapsibleSection(); /* End the collapsible <TR id=...>. */ /* JSON Element code let's you build up a DOM like data structure in memory and then serialize it into html for communication with client side code. */ // supported types typedef enum _jsonElementType