f1a5c6783582c33961b05d700690fbd1cae20363 larrym Thu Jul 7 17:25:06 2011 -0700 add jsPrintHash and related routines diff --git src/hg/inc/jsHelper.h src/hg/inc/jsHelper.h index bea9420..e0202d8 100644 --- src/hg/inc/jsHelper.h +++ src/hg/inc/jsHelper.h @@ -128,16 +128,32 @@ /* 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. */ boolean advancedJavascriptFeaturesEnabled(struct cart *cart); // Returns TRUE if advanced javascript features are currently enabled 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=...>. */ +void jsAddString(struct hash *h, char *name, char *val); +// Add a string to a hash which will be used to print a javascript object; +// existing values are replaced. + +void jsAddNumber(struct hash *h, char *name, long val); +// Add a number to a hash which will be used to print a javascript object; +// existing values are replaced. + +void jsAddBoolean(struct hash *h, char *name, boolean val); +// Add a boolean to a hash which will be used to print a javascript object; +// existing values are replaced. + +void jsPrintHash(struct hash *hash, char *name, int indentLevel); +// prints a hash as a javascript variable + + #endif /* JSHELPER_H */