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/lib/fileUi.c src/hg/lib/fileUi.c index a730971..c8e8b29 100644 --- src/hg/lib/fileUi.c +++ src/hg/lib/fileUi.c @@ -715,34 +715,32 @@ printf("<TR valign='top'%s>",(filterable != 0) ?" class='filterable'":""); // Download button printf("<TD nowrap>"); if (parentTdb) field = parentTdb->track; else { field = cloneString(mdbObjFindValue(oneFile->mdb,MDB_VAR_COMPOSITE)); mdbObjRemoveOneVar(oneFile->mdb,MDB_VAR_COMPOSITE,NULL); } assert(field != NULL); char id[256]; safef(id, sizeof id, "ftpBut_%d", butCount++); printf("<input type='button' id='%s' value='Download' title='Download %s ...'>", id, oneFile->fileName); - char javascript[1024]; - safef(javascript, sizeof javascript, "window.location='http://%s/goldenPath/%s/%s/%s%s/%s';" + jsOnEventByIdF("click", id, "window.location='http://%s/goldenPath/%s/%s/%s%s/%s';" ,server,db,ENCODE_DCC_DOWNLOADS, field, subDir, oneFile->fileName); - jsOnEventById("click", id, javascript); #define SHOW_FOLDER_FRO_COMPOSITE_DOWNLOADS #ifdef SHOW_FOLDER_FRO_COMPOSITE_DOWNLOADS if (parentTdb == NULL) printf(" <A href='../cgi-bin/hgFileUi?db=%s&g=%s' title='Navigate to downloads " "page for %s set...'><IMG SRC='../images/folderC.png'></a> ", db,field,field); #endif///def SHOW_FOLDER_FRO_COMPOSITE_DOWNLOADS printf("</TD>\n"); // Each of the pulled out mdb vars if (sortOrder) { for (ix=0;ix<sortOrder->count;ix++) { if (sameString("fileSize",sortOrder->column[ix]))