2b30b55d6a5b71648296873b570b9d68b4901b6a galt Wed Feb 15 02:21:56 2017 -0800 CSP code cleanup. Using jsInlineF where needed for compact and efficient code, not using fixed-size local javascript strings which could overflow. diff --git src/hg/lib/tablesTables.c src/hg/lib/tablesTables.c index 5856e9c..8e033eb 100644 --- src/hg/lib/tablesTables.c +++ src/hg/lib/tablesTables.c @@ -66,36 +66,34 @@ for (suggest = suggestList; suggest != NULL; suggest = suggest->next) { dyStringPrintf(dy,"%s\"%s\"", separator, suggest->name); separator = ","; } dyStringPrintf(dy,"]\n"); dyStringPrintf(dy," });\n"); dyStringPrintf(dy,"});\n"); jsInline(dy->string); dyStringFree(&dy); } static void printWatermark(char *id, char *watermark) /* Print light text filter prompt as watermark. */ { -char javascript[1024]; -safef(javascript, sizeof javascript, +jsInlineF( "$(function() {\n" " $('#%s').watermark(\"%s\");\n" "});\n", id, watermark); -jsInline(javascript); } static void showTableFilterControlRow(struct fieldedTable *table, struct cart *cart, char *varPrefix, int maxLenField, struct hash *suggestHash) /* Assuming we are in table already drow control row. * The suggestHash is keyed by field name. If something is there we'll assume * it's value is slName list of suggestion values */ { /* Include javascript and style we need */ webIncludeResourceFile("jquery-ui.css"); jsIncludeFile("jquery.js", NULL); jsIncludeFile("jquery.plugins.js", NULL); jsIncludeFile("jquery-ui.js", NULL); jsIncludeFile("jquery.watermark.js", NULL);