64e75ce877fc48990da4fbe5950a2e9581874bcc kate Fri May 25 12:14:52 2012 -0700 Clean up navigation between pages diff --git src/hg/js/encodeMatrix.js src/hg/js/encodeMatrix.js index 6a51b80..75ce615 100644 --- src/hg/js/encodeMatrix.js +++ src/hg/js/encodeMatrix.js @@ -25,40 +25,39 @@ $div.append('<span id="searchPanelInstructions">search for: </span>' + '<input type="radio" name="searchType" id="searchTracks" value=' + COOKIE_SEARCH_TRACKS + ' onclick="encodeMatrix.setFileSearch(false);">tracks' + '<input type="radio" name="searchType" id="searchFiles" value=' + COOKIE_SEARCH_FILES + ' onclick="encodeMatrix.setFileSearch(true);" >files'); if (isFile) { $('#searchFiles').attr('checked', true); } else { $('#searchTracks').attr('checked', true); } encodeMatrix.setFileSearch(isFile); } return { - // Page names for other pages in this application - pageForChipMatrix: function(organism) { - // URL for Chip-seq matrix - return 'encodeChipMatrix' + organism.charAt(0).toUpperCase() + organism.substring(1) + '.html'; - }, - - pageForDataMatrix: function(organism) { - // URL for Chip-seq matrix - return 'encodeDataMatrix' + organism.charAt(0).toUpperCase() + organism.substring(1) + '.html'; + pageFor: function(pageType, organism) { + // Construct page names for other pages in this application per organism + // page types are: dataMatrix, chipMatrix, dataSummary + // e.g. dataMatrix, mouse -> encodeDataMatrixMouse.html + return 'encode' + + pageType.charAt(0).toUpperCase() + pageType.substring(1) + + organism.charAt(0).toUpperCase() + organism.substring(1) + + '.html'; }, // UI panel for search: select tracks or files setFileSearch: function (isFile) { // Set search type cookie to retain user choice $.cookie(COOKIE_SEARCH, (isFile ? COOKIE_SEARCH_FILES : COOKIE_SEARCH_TRACKS), {expires: 7}); }, isFileSearch: function () { // Check search type cookie to retain user choice // Defaults to track search if no cookie set return ($.cookie(COOKIE_SEARCH) === COOKIE_SEARCH_FILES); },