70844f06b48c8a1404a1e171aa3afb47024804dd kate Wed Apr 22 14:35:07 2015 -0700 Removed ifdef (BUTTONS_BY_CSS). No functional change. This code added in 2011 is unused. (no redmine) diff --git src/hg/lib/hui.c src/hg/lib/hui.c index e4990d4..025f4e9 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -37,57 +37,42 @@ #include "vcf.h" #include "errCatch.h" #include "samAlignment.h" #include "makeItemsItem.h" #include "bedDetail.h" #include "pgSnp.h" #include "memgfx.h" #include "trackHub.h" #define SMALLBUF 256 #define MAX_SUBGROUP 9 #define ADD_BUTTON_LABEL "add" #define CLEAR_BUTTON_LABEL "clear" #define JBUFSIZE 2048 -#ifdef BUTTONS_BY_CSS -#define BUTTON_PM "<span class='pmButton' " \ - "onclick=\"setCheckBoxesThatContain('%s',%s,true,'%s','','%s')\">%c</span>" -#define BUTTON_DEF "<span class='pmButton' " \ - "onclick=\"setCheckBoxesThatContain('%s',true,false,'%s','','%s'); " \ - "setCheckBoxesThatContain('%s',false,false,'%s','_defOff','%s');\" " \ - "style='width:56px;font-weight:normal; font-family:default;'>default</span>" -#define DEFAULT_BUTTON(nameOrId,anc,beg,contains) \ - printf(BUTTON_DEF,(nameOrId), (beg),(contains),(nameOrId),(beg),(contains)) -#define PLUS_BUTTON(nameOrId,anc,beg,contains) \ - printf(BUTTON_PM, (nameOrId),"true", (beg),(contains),'+') -#define MINUS_BUTTON(nameOrId,anc,beg,contains) \ - printf(BUTTON_PM, (nameOrId),"false",(beg),(contains),'-') -#else///ifndef BUTTONS_BY_CSS #define PM_BUTTON "<IMG height=18 width=18 onclick=\"setCheckBoxesThatContain(" \ "'%s',%s,true,'%s','','%s');\" id=\"btn_%s\" src=\"../images/%s\" alt=\"%s\">\n" #define DEF_BUTTON "<IMG onclick=\"setCheckBoxesThatContain('%s',true,false,'%s','','%s'); " \ "setCheckBoxesThatContain('%s',false,false,'%s','_defOff','%s');\" " \ "id=\"btn_%s\" src=\"../images/%s\" alt=\"%s\">\n" #define DEFAULT_BUTTON(nameOrId,anc,beg,contains) \ printf(DEF_BUTTON,(nameOrId),(beg),(contains),(nameOrId),(beg),(contains),(anc), \ "defaults_sm.png","default") #define PLUS_BUTTON(nameOrId,anc,beg,contains) \ printf(PM_BUTTON, (nameOrId),"true", (beg),(contains),(anc),"add_sm.gif", "+") #define MINUS_BUTTON(nameOrId,anc,beg,contains) \ printf(PM_BUTTON, (nameOrId),"false",(beg),(contains),(anc),"remove_sm.gif","-") -#endif///ndef BUTTONS_BY_CSS boolean isEncode2(char *database) // Return true for ENCODE2 assemblies { return (sameString(database, "hg18") || sameString(database, "hg19") || sameString(database, "mm9")); } static char *htmlStringForDownloadsLink(char *database, struct trackDb *tdb, char *name,boolean nameIsFile) // Returns an HTML string for a downloads link { // If has fileSortOrder, then link to new hgFileUi if (!nameIsFile && trackDbSetting(tdb, FILE_SORT_ORDER) != NULL) { char * link = needMem(PATH_LEN); // 512 should be enough @@ -6923,65 +6908,49 @@ if (cvTerm != NULL) { char *link = wgEncodeVocabLink(words[0], (sameWord(cvSetting,"antibody") ? "target" : "term"), (char *)cvTerm,(char *)cvTerm,rootLabel,suffix); return link; } } } } freeMem(words[0]); freeMem(rootLabel); return cloneString(label); } -#ifdef BUTTONS_BY_CSS -#define BUTTON_MAT "<span class='pmButton' onclick=\"matSetMatrixCheckBoxes(%s%s%s%s)\">%c</span>" -#else///ifndef BUTTONS_BY_CSS #define PM_BUTTON_UC "<IMG height=18 width=18 onclick=\"return " \ "(matSetMatrixCheckBoxes(%s%s%s%s%s%s) == false);\" id='btn_%s' " \ "src='../images/%s'>" -#endif///def BUTTONS_BY_CSS #define MATRIX_RIGHT_BUTTONS_AFTER 8 #define MATRIX_BOTTOM_BUTTONS_AFTER 20 static void buttonsForAll() { -#ifdef BUTTONS_BY_CSS -printf(BUTTON_MAT,"true", "", "", "", '+'); -printf(BUTTON_MAT,"false","", "", "", '-'); -#else///ifndef BUTTONS_BY_CSS printf(PM_BUTTON_UC,"true", "", "", "", "", "", "plus_all", "add_sm.gif"); printf(PM_BUTTON_UC,"false","", "", "", "", "", "minus_all", "remove_sm.gif"); -#endif///def BUTTONS_BY_CSS } static void buttonsForOne(char *name,char *class,boolean vertical) { -#ifdef BUTTONS_BY_CSS -printf(BUTTON_MAT, "true", ",'", class, "'", '+'); -if (vertical) - puts("<BR>"); -printf(BUTTON_MAT, "false", ",'", class, "'", '-'); -#else///ifndef BUTTONS_BY_CSS printf(PM_BUTTON_UC, "true", ",'", class, "'", "", "", name, "add_sm.gif"); if (vertical) puts("<BR>"); printf(PM_BUTTON_UC, "false", ",'", class, "'", "", "", name, "remove_sm.gif"); -#endif///def BUTTONS_BY_CSS } #define MATRIX_SQUEEZE 10 static boolean matrixSqueeze(membersForAll_t* membersForAll) // Returns non-zero if the matrix will be squeezed. Non-zero is actually squeezedLabelHeight { char *browserVersion; if (btIE == cgiClientBrowser(&browserVersion, NULL, NULL) && *browserVersion < '9') return 0; members_t *dimensionX = membersForAll->members[dimX]; members_t *dimensionY = membersForAll->members[dimY]; if (dimensionX && dimensionY) { if (dimensionX->count>MATRIX_SQUEEZE) @@ -7322,43 +7291,36 @@ webIncludeResourceFile("ui.dropdownchecklist.css"); jsIncludeFile("ui.dropdownchecklist.js",NULL); jsIncludeFile("ddcl.js",NULL); } cgiDown(0.7); printf("<B>Select subtracks %sby:</B> (select multiple %sitems - %s)<BR>\n", (membersForAll->members[dimX] != NULL || membersForAll->members[dimY] != NULL ? "further ":""), (membersForAll->dimMax == dimA?"":"categories and "),FILTERBY_HELP_LINK); printf("<TABLE><TR valign='top'>\n"); // Do All [+][-] buttons if (membersForAll->members[dimX] == NULL && membersForAll->members[dimY] == NULL) // No matrix { printf("<TD align='left' width='50px'><B>All:</B><BR>"); -#ifdef BUTTONS_BY_CSS // TODO: Test when a real world case actually calls this. Currently no trackDb.ra cases exist - #define BUTTON_FILTER_COMP "<span class='pmButton inOutButton' " \ - "onclick='waitOnFunction(filterCompositeSet,this,%s)'>%c</span>" - printf(BUTTON_FILTER_COMP,"true", '+'); - printf(BUTTON_FILTER_COMP,"false",'-'); -#else///ifndef BUTTONS_BY_CSS #define PM_BUTTON_FILTER_COMP "<input type='button' class='inOutButton' " \ "onclick=\"waitOnFunction(filterCompositeSet,this,%s); " \ "return false;\" id='btn_%s' value='%c'>" printf(PM_BUTTON_FILTER_COMP,"true", "plus_fc",'+'); printf(PM_BUTTON_FILTER_COMP,"false","minus_fc",'-'); -#endif///ndef BUTTONS_BY_CSS printf("</TD>\n"); } // Now make a filterComp box for each ABC dimension int dimIx=dimA; for (dimIx=dimA;dimIx<membersForAll->dimMax;dimIx++) { printf("<TD align='left'><B>%s:</B><BR>\n", labelWithVocabLinkForMultiples(db,parentTdb,membersForAll->members[dimIx])); #define FILTER_COMPOSITE_FORMAT "<SELECT id='fc%d' name='%s.filterComp.%s' %s " \ "onchange='filterCompositeSelectionChanged(this);' " \ "style='display: none; font-size:.8em;' " \ "class='filterComp'><BR>\n" printf(FILTER_COMPOSITE_FORMAT,dimIx,parentTdb->track,membersForAll->members[dimIx]->groupTag, @@ -7615,40 +7577,34 @@ compositeUiByFilter(db, cart, parentTdb, formName); return TRUE; } static boolean compositeUiAllButtons(char *db, struct cart *cart, struct trackDb *parentTdb, char *formName) // UI for composite tracks: all/none buttons only (as opposed to matrix or lots of buttons { if (trackDbCountDescendantLeaves(parentTdb) <= 1) return FALSE; if (dimensionsExist(parentTdb)) return FALSE; -#ifdef BUTTONS_BY_CSS -#define BUTTON_ALL "<span class='pmButton' onclick='matSubCBsCheck(%s)'>%c</span>" -#define BUTTON_PLUS_ALL_GLOBAL() printf(BUTTON_ALL,"true", '+') -#define BUTTON_MINUS_ALL_GLOBAL() printf(BUTTON_ALL,"false",'-') -#else///ifndef BUTTONS_BY_CSS #define PM_BUTTON_GLOBAL "<IMG height=18 width=18 onclick=\"matSubCBsCheck(%s);\" " \ "id='btn_%s' src='../images/%s'>" #define BUTTON_PLUS_ALL_GLOBAL() printf(PM_BUTTON_GLOBAL,"true", "plus_all", "add_sm.gif") #define BUTTON_MINUS_ALL_GLOBAL() printf(PM_BUTTON_GLOBAL,"false","minus_all","remove_sm.gif") -#endif///ndef BUTTONS_BY_CSS BUTTON_PLUS_ALL_GLOBAL(); BUTTON_MINUS_ALL_GLOBAL(); puts(" <B>Select all subtracks</B><BR>"); return TRUE; } static boolean compositeUiNoMatrix(char *db, struct cart *cart, struct trackDb *parentTdb, char *formName) // UI for composite tracks: subtrack selection. This is the default UI // without matrix controls. { int i, j, k; char *words[SMALLBUF]; char option[SMALLBUF]; int wordCnt;