f9c068638aaeddd15d998a5fa840e08898c6e83b
kate
  Tue Mar 20 22:55:59 2012 -0700
Changes responding to QA (redmine #5149, issues note 27).  1. Save user-selected search type in cookie so it persists across pages.  2. Include ChIP-seq in cell-based experiment table on data summary page.  3. encode URL passed to hgEncodeVocab so cells having terms with weird chars (e.g. +) will work.  Also, override extra search dropdowns (until figure out how to remove mdbVar cart vars by URL)
diff --git src/hg/js/encodeDataSummary.js src/hg/js/encodeDataSummary.js
index 88c7e4a..1850467 100644
--- src/hg/js/encodeDataSummary.js
+++ src/hg/js/encodeDataSummary.js
@@ -55,46 +55,47 @@
 
         antibodyGroups = encodeProject.getAntibodyGroups(antibodies);
         encodeProject.getDataGroups(dataTypes);
 
         // use to filter out experiments not in this assembly
         expIdHash = encodeProject.getExpIdHash(expIds);
 
         $.each(experiments, function (i, exp) {
             // exlude experiment not in this assembly
             if (expIdHash[exp.ix] === undefined) {
                 return true;
             }
             if (exp.dataType === undefined) {
                 return true;
             }
-            // add experiment into the appropriate list
+            // add experiment into the appropriate list(s)
             if (exp.cellType === 'None') {
                 addDataType(exp.dataType, refGenomeExps, false);
-            } else if (exp.dataType === 'ChipSeq') {
+            } else {
+                addDataType(exp.dataType, cellAssayExps, false);
+            }
+            if (exp.dataType === 'ChipSeq') {
                 antibody = encodeProject.antibodyFromExp(exp);
                 if (!antibody) {
                     return true;
                 }
                 dataType = encodeProject.targetFromAntibody(antibody);
                 if (!dataType) {
                     // this excludes controls
                     return true;
                 }
                 addDataType(dataType, tfbsExps, true);
-            } else {
-                addDataType(exp.dataType, cellAssayExps, false);
             }
         });
         // work-around for some supplementary files being accessioned as experiments (5C)
         // they show up in both reference genome and cell assay lists incorrectly
         // remove them from refGenome list of they are in cellAssayExps
         for (dataType in refGenomeExps) {
             if (cellAssayExps[dataType] !== undefined) {
                 delete refGenomeExps[dataType];
             }
         }
         // fill in tables and activate buttons
         tableOut('#refGenomeTable', refGenomeTypes, refGenomeExps, false);
         tableOut('#elementTable', elementTypes, cellAssayExps, false);
         $('#buttonDataMatrix').click(function () {
             window.location = 'encodeDataMatrixHuman.html';
@@ -138,48 +139,48 @@
                     term = value;
                 }
             } else {
                 dataType = encodeProject.getDataTypeByLabel(value);
                 if (dataType !== undefined) {
                     description = dataType.description;
                     term = dataType.term;
                 }
             }
             // quote the end tags so HTML validator doesn't whine
             $(table).append("<tr class='" + (row % 2 === 0 ? "even" : "odd") + "'><td title='" + description + "'>" + value + "<\/td><td id='" + term + "' class='dataItem' title='Click to search for " + value + " data'>" + exps[value] + "<\/td><\/tr>");
             row++;
         });
 
         $(".even, .odd").click(function () {
-            // TODO: base on preview ?
             var dataType, target, url, antibodyTarget;
             url = encodeMatrix.getSearchUrl(encodeProject.getAssembly());
             if ($(this).parents('table').attr('id') === 'tfbsTable') {
                 target = $(this).children('.dataItem').attr('id');
                 url += '&hgt_mdbVar1=antibody';
                 antibodyTarget = encodeProject.getAntibodyTarget(target);
                 $.each(antibodyTarget.antibodies, function (i, antibody) {
                     url += '&hgt_mdbVal1=' + antibody;
                 });
             } else {
                 dataType = $(this).children('.dataItem').attr('id');
                 url += '&hgt_mdbVar1=dataType&hgt_mdbVal1=' + dataType;
             }
-            url += '&hgt_mdbVar2=view&hgt_mdbVal2=Any';
-            // TODO: open search window 
+            url += '&hgt_mdbVar2=view&hgt_mdbVal2=Any' +
+            // TODO: figure out how to remove mdbVar3 and mdbVar4
+                        '&hgt_mdbVar3=view&hgt_mdbVal3=Any' +
+                        '&hgt_mdbVar4=view&hgt_mdbVal4=Any' ;
             window.open(url, "searchWindow");
         });
 
         $(table).append("<tr><td class='totals'>Total: " + types.length + "<\/td><td class='totals'>" + total + "<\/td><\/tr>");
         if (total === 0) {
             $(table).remove();
         }
     }
 
     // initialize
-
     encodeMatrix.start($summaryTables);
 
     // load data from server
     encodeProject.loadAllFromServer(requests, handleServerData);
 });