3c1aee3860376a4192287cf7d252564b846eee06
tdreszer
  Mon Mar 28 15:54:19 2011 -0700
Ensure the backgound floret is used but avoid the overhead that hgTracks uses to acheive this.
diff --git src/hg/hgFileSearch/hgFileSearch.c src/hg/hgFileSearch/hgFileSearch.c
index 77b5cac..f19b9a5 100644
--- src/hg/hgFileSearch/hgFileSearch.c
+++ src/hg/hgFileSearch/hgFileSearch.c
@@ -7,30 +7,33 @@
 #include "hdb.h"
 #include "web.h"
 #include "mdb.h"
 #include "hCommon.h"
 #include "hui.h"
 #include "fileUi.h"
 #include "searchTracks.h"
 #include "cart.h"
 #include "grp.h"
 
 #define FAKE_MDB_MULTI_SELECT_SUPPORT
 
 struct hash *trackHash = NULL;	// Is this needed?
 boolean measureTiming = FALSE;  /* DON'T EDIT THIS -- use CGI param "&measureTiming=." . */
 
+#define FILE_SEARCH_WHAT "Downloadable ENCODE Files"
+#define FILE_SEARCH_NAME FILE_SEARCH_WHAT " Search"
+
 #define FILE_SEARCH              "hgfs_Search"
 #define FILE_SEARCH_FORM         "fileSearch"
 #define FILE_SEARCH_CURRENT_TAB  "fsCurTab"
 #define FILE_SEARCH_ON_FILETYPE  "fsFileType"
 
 // These are common with trackSearch.  Should they be?
 #define TRACK_SEARCH_SIMPLE      "tsSimple"
 #define TRACK_SEARCH_ON_NAME     "tsName"
 #define TRACK_SEARCH_ON_GROUP    "tsGroup"
 #define TRACK_SEARCH_ON_DESCR    "tsDescr"
 #define TRACK_SEARCH_SORT        "tsSort"
 
 #define SUPPORT_COMPOSITE_SEARCH
 #ifdef SUPPORT_COMPOSITE_SEARCH
     //#define USE_TABS
@@ -520,52 +523,55 @@
         #endif///def SUPPORT_COMPOSITE_SEARCH
 
         if (doSearch && mdbSelects != NULL && isNotEmpty(fileTypeSearch))
             fileSearchResults(db, conn, mdbSelects, fileTypeSearch);
         else
             printf("<DIV id='filesFound'><BR>No files found.<BR></DIV><BR>\n");
 
         if (measureTiming)
             uglyTime("Searched for files");
         }
 
     slPairFreeList(&mdbSelects);
     }
 hFreeConn(&conn);
 
-webNewSection("About Downloadable Files Search");
+webNewSection("About " FILE_SEARCH_NAME);
 printf("<p>Search for downloadable ENCODE files by entering search terms in "
         "the Track name or Description fields and/or by making selections with "
         "the group, data format, and/or ENCODE metadata drop-downs.");
 printf("<BR><a target='_blank' href='../goldenPath/help/fileSearch.html'>more help</a></p>\n");
 webEndSectionTables();
 }
 
 void doMiddle(struct cart *cart)
 /* Write body of web page. */
 {
 struct trackDb *tdbList = NULL;
 char *organism = NULL;
 char *db = NULL;
 getDbAndGenome(cart, &db, &organism, NULL);
 char *chrom = cartUsualString(cart, "c", hDefaultChrom(db));
 measureTiming = isNotEmpty(cartOptionalString(cart, "measureTiming"));
 
 // QUESTION: Do We need track list ???  trackHash ??? Can't we just get one track and no children
 trackHash = trackHashMakeWithComposites(db,chrom,&tdbList,FALSE);
 
-cartWebStart(cart, db, "Search for Downloadable ENCODE Files in the %s %s Assembly", organism, hFreezeFromDb(db));
+cartWebStart(cart, db, "Search for " FILE_SEARCH_WHAT " in the %s %s Assembly", organism, hFreezeFromDb(db));
+
+// This cleverness allows us to have the background image like "Track Search" does, without all the hgTracks overhead
+printf("<style type='text/css'>body {background-image:url('%s');}</style>",hBackgroundImage());
 
 webIncludeResourceFile("HGStyle.css");
 webIncludeResourceFile("jquery-ui.css");
 webIncludeResourceFile("ui.dropdownchecklist.css");
 jsIncludeFile("jquery.js", NULL);
 jsIncludeFile("jquery-ui.js", NULL);
 //jsIncludeFile("ui.core.js",NULL);   // NOTE: This appears to be not needed as long as jquery-ui.js comes before ui.dropdownchecklist.js
 jsIncludeFile("ui.dropdownchecklist.js",NULL);
 jsIncludeFile("utils.js",NULL);
 
 // This line is needed to get the multi-selects initialized
 //printf("<script type='text/javascript'>$(document).ready(function() { setTimeout('updateMetaDataHelpLinks(0);',50);  $('.filterBy').each( function(i) { $(this).dropdownchecklist({ firstItemChecksAll: true, noneIsAll: true });});});</script>\n");
 printf("<script type='text/javascript'>$(document).ready(function() { updateMetaDataHelpLinks(0);  $('.filterBy').each( function(i) { $(this).dropdownchecklist({ firstItemChecksAll: true, noneIsAll: true });});});</script>\n");
 
 doFileSearch(db,organism,cart,tdbList);
@@ -576,20 +582,18 @@
 }
 
 char *excludeVars[] = { "submit", "Submit", "g", "ajax", FILE_SEARCH,TRACK_SEARCH_ADD_ROW,TRACK_SEARCH_DEL_ROW};  // HOW IS 'ajax" going to be supported?
 
 int main(int argc, char *argv[])
 /* Process command line. */
 {
 cgiSpoof(&argc, argv);
 htmlSetBackground(hBackgroundImage());
 cartEmptyShell(doMiddle, hUserCookie(), excludeVars, NULL);
 return 0;
 }
 
 // TODO:
 // 1) Done: Limit to first 1000
-// 2) SORT OF: Work out strangeness with dropdownchecklist and use in hgTracks (By some miracle multiselect is working in my hgTracks)
-// 3) Work out support for selecting composites and limiting search to those
-// 4) Work out simple verses advanced tabs
-// 5) work out support for non-encode downloads
-// 6) Make an hgTrackSearch to replces hgTracks track search ??   Silpler code, but may not be good idea.
+// 2) Work out simple verses advanced tabs
+// 3) work out support for non-encode downloads
+// 4) Make an hgTrackSearch to replces hgTracks track search ??   Silpler code, but may not be good idea.