4c15f3e254d1e9c7cb3c4dca17f2808c07dbdb4f tdreszer Thu Jul 7 17:52:25 2011 -0700 Moved all ddcl extension code into a ddcl object in ddcl.js. Reworked filterComp code to be more like filterTable code since IE was getting timeouts on HAIB TFBS. diff --git src/hg/lib/hui.c src/hg/lib/hui.c index 3cb02f1..e3ffd74 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -3505,46 +3505,49 @@ /* Does the UI for a list of filterBy structure */ { if(filterBySet == NULL) return; #define FILTERBY_HELP_LINK "help" int count = slCount(filterBySet); if(count == 1) puts(""); else printf("Filter items by: (select multiple categories and items - %s)
\n",FILTERBY_HELP_LINK); filterBy_t *filterBy = NULL; webIncludeResourceFile("ui.dropdownchecklist.css"); jsIncludeFile("ui.dropdownchecklist.js",NULL); +#ifdef NEW_JQUERY +jsIncludeFile("ddcl.js",NULL); +#endif///def NEW_JQUERY int ix=0; for(filterBy = filterBySet;filterBy != NULL; filterBy = filterBy->next) { puts("
"); if(count == 1) printf("Filter by %s (select multiple items - %s)",filterBy->title,FILTERBY_HELP_LINK); else printf("%s",filterBy->title); printf("
\n"); // TODO: columnCount (Number of filterBoxes per row) should be configurable through tdb setting #ifdef NEW_JQUERY - #define FILTER_BY_FORMAT "
\n" #else///ifndef NEW_JQUERY - #define FILTER_BY_FORMAT "
\n" #endif///ndef NEW_JQUERY printf(FILTER_BY_FORMAT,ix,tdb->track,filterBy->column); ix++; printf("All\n",(filterBy->slChoices == NULL || slNameInList(filterBy->slChoices,"All")?" SELECTED":"")); struct slName *slValue; int ix=1; for(slValue=filterBy->slValues;slValue!=NULL;slValue=slValue->next,ix++) { char varName[32]; char *label = NULL; char *name = NULL; if (filterBy->useIndex) { safef(varName, sizeof(varName), "%d",ix); @@ -3565,32 +3568,34 @@ { char *styler = label + strlen(label)+1; if (*styler != '\0') { if (*styler == '#') // Legacy: just the color that follows printf(" style='color: %s;'",styler); else printf(" style='%s'",styler); } } printf(">%s\n",label); } } printf("\n"); +#ifndef NEW_JQUERY // The following is needed to make msie scroll to selected option. printf("\n",tdb->track); +#endif///ndef NEW_JQUERY puts("
"); return; } #define COLOR_BG_DEFAULT_IX 0 #define COLOR_BG_ALTDEFAULT_IX 1 #define DIVIDING_LINE "
\n" #define DIVIDER_PRINT(color) printf(DIVIDING_LINE,COLOR_BG_DEFAULT,(color)) static char *checkBoxIdMakeForTrack(struct trackDb *tdb,members_t** dims,int dimMax,membership_t *membership) /* Creates an 'id' string for subtrack checkbox in style that matrix understand: "cb_dimX_dimY_view_cb" */ { int ix; #define CHECKBOX_ID_SZ 128 @@ -6420,37 +6425,35 @@ } } } dyStringPrintf(dyLink,VOCAB_MULTILINK_END,members->groupTitle,members->groupTitle); freeMem(vocab); return dyStringCannibalize(&dyLink); } static boolean compositeUiByFilter(char *db, struct cart *cart, struct trackDb *parentTdb, char *formName) /* UI for composite tracks: filter subgroups by multiselects to select subtracks. */ { membersForAll_t* membersForAll = membersForAllSubGroupsGet(parentTdb,cart); if(membersForAll == NULL || membersForAll->filters == FALSE) // Not Matrix or filters return FALSE; jsIncludeFile("ui.core.js",NULL); -jsIncludeFile("ui.dropdownchecklist.js",NULL); webIncludeResourceFile("ui.dropdownchecklist.css"); - -// TODO: -// 1) Scroll long lists should be configurable through tdb setting -// #define FILTER_COMPOSITE_OPEN_SIZE 16 -// 2) columnCount (Number of filterBoxes per row) should be configurable through tdb setting +jsIncludeFile("ui.dropdownchecklist.js",NULL); +#ifdef NEW_JQUERY +jsIncludeFile("ddcl.js",NULL); +#endif///def NEW_JQUERY cgiDown(0.7); printf("Filter subtracks %sby: (select multiple %sitems - %s)
\n", (membersForAll->members[dimX] != NULL || membersForAll->members[dimY] != NULL ? "further ":""), (membersForAll->dimMax == dimA?"":"categories and "),FILTERBY_HELP_LINK); printf("\n"); // Do All [+][-] buttons if(membersForAll->members[dimX] == NULL && membersForAll->members[dimY] == NULL) // No matrix { #define PM_BUTTON_FILTER_COMP "" printf("
All:
"); printf(PM_BUTTON_FILTER_COMP,"true", "plus_fc",'+'); printf(PM_BUTTON_FILTER_COMP,"false","minus_fc",'-'); //#define PM_BUTTON2_FILTER_COMP ""