70ef68d210fa4b76c16f7b8e8142a8180f75052a tdreszer Fri Jun 17 20:14:06 2011 -0700 Big checkin of jquery 1.5.1, jquery-ui 1.8 and ui-dropdownchecklist 1.3. Needs more testing and CSS work. DDCL is working on FF, Chrome and IE. Both Chrome and IE support required tiny changes to the DDCL wigit code. DDCL may still have problems with IE. Other jquery wigits have been tested at a cursory level and work fine. Ajax calls may need an extrat dataType: html param. Dialog (popup) needs CSS tuning. diff --git src/hg/lib/fileUi.c src/hg/lib/fileUi.c index a931b59..72167c6 100644 --- src/hg/lib/fileUi.c +++ src/hg/lib/fileUi.c @@ -395,56 +395,66 @@ { struct slName *term = slPopHead(&vals); char *tag = (char *)cvTag(var,term->name); if (tag == NULL) tag = term->name; slPairAdd(&tagLabelPairs,tag,cloneString((char *)cvLabel(term->name))); slNameFree(&term); } // If there is more than one val for this var then create filterBy box for it if (slCount(tagLabelPairs) > 1) { slPairValSortCase(&tagLabelPairs); // should have a list sorted on the label char extraClasses[256]; safef(extraClasses,sizeof extraClasses,"filterTable %s",var); + #ifdef NEW_JQUERY + char *dropDownHtml = cgiMakeMultiSelectDropList(var,tagLabelPairs,NULL,"All",extraClasses,"onchange='filterTable();' onclick='filterTableExclude(this);' style='font-size:.9em;'"); + #else///ifndef NEW_JQUERY char *dropDownHtml = cgiMakeMultiSelectDropList(var,tagLabelPairs,NULL,"All",extraClasses,"onchange='filterTable();' onclick='filterTableExclude(this);'"); + #endif///ndef NEW_JQUERY // Note filterBox has classes: filterBy & {var} if (dropDownHtml) { dyStringPrintf(dyFilters,"<td align='left'>\n<B>%s</B>:<BR>\n%s</td><td width=10> </td>\n", labelWithVocabLink(var,sortOrder->title[sIx],tagLabelPairs,TRUE),dropDownHtml); // TRUE were sending tags, not values freeMem(dropDownHtml); count++; } } if (slCount(tagLabelPairs) > 0) slPairFreeValsAndList(&tagLabelPairs); } // Finally ready to print the filterBys out if (count) { webIncludeResourceFile("ui.dropdownchecklist.css"); jsIncludeFile("ui.dropdownchecklist.js",NULL); #define FILTERBY_HELP_LINK "<A HREF=\"../goldenPath/help/multiView.html\" TARGET=ucscHelp>help</A>" cgiDown(0.9); printf("<B>Filter files by:</B> (select multiple %sitems - %s)\n<table><tr valign='bottom'>\n", (count >= 1 ? "categories and ":""),FILTERBY_HELP_LINK); printf("%s\n",dyStringContents(dyFilters)); printf("</tr></table>\n"); + #ifdef NEW_JQUERY + printf("<script type='text/javascript'>var newJQuery=true;</script>\n"); + printf("<script type='text/javascript'>$(document).ready(function() { $('.filterBy').each( function(i) { ddclSetup(this,'noneIsAll') });});</script>\n"); + #else///ifndef NEW_JQUERY + printf("<script type='text/javascript'>var newJQuery=false;</script>\n"); printf("<script type='text/javascript'>$(document).ready(function() { $('.filterBy').each( function(i) { $(this).dropdownchecklist({ firstItemChecksAll: true, noneIsAll: true, maxDropHeight: filterByMaxHeight(this) });});});</script>\n"); + #endif///ndef NEW_JQUERY } dyStringFree(&dyFilters); } return count; } static void filesDownloadsPreamble(char *db, struct trackDb *tdb) { // Do not bother getting preamble.html // 1) It isn't on the RR (yet) // 2) It will likely refer back to the composite for Description info which is included in this page // 3) The rsync-to-tmp-file hurdle isn't worth the effort. cgiDown(0.7); puts("<B>Data is <A HREF='http://genome.ucsc.edu/ENCODE/terms.html'>RESTRICTED FROM USE</a>"); puts("in publication until the restriction date noted for the given data file.</B>");