0f3ca3eaf5792df01b7c600a5428d2d0b2809fcd max Fri Sep 20 13:18:01 2024 -0700 Revert "more features to hubtools: search in both parent and subdirs, better docs" This reverts commit 05e67c59a20a5d00b810a981aef3b00c5bef82e1. diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 5e376d6..a0416eb 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -2114,65 +2114,30 @@ }; /////////////////////////////////////// //// rightClick (aka context menu) //// /////////////////////////////////////// var rightClick = { menu: null, selectedMenuItem: null, // currently choosen context menu item (via context menu). floatingMenuItem: null, currentMapItem: null, supportZoomCodon: true, // add zoom to exon and zoom to codon to right click menu clickedHighlightIdx : null, // the index (0,1,...) of the highlight item that overlaps the last right-click - hideTracks: function (ids) - { - var cartVars = []; - var cartVals = []; - - for (var i = 0; i 0 && hgTracks.trackDb) { var title; var rec = hgTracks.trackDb[id]; if (rec) { title = rec.shortLabel; } else { title = id; } return {id: id, title: "configure " + title}; } else { return null; } @@ -2454,39 +2419,30 @@ break; } } $.ajax({ type: "PUT", async: false, url: "../cgi-bin/hgCollection", data: "cmd=addTrack&track=" + id + "&collection=" + collectionName + "&hgsid=" + getHgsid(), trueSuccess: mySuccess, success: catchErrorOrDispatch, error: errorHandler, }); imageV2.fullReload(); - } else if (cmd === "hideOthers") { - var hideIds = []; - for (var otherId in hgTracks.trackDb) { - if (otherId!==id) - hideIds.push(otherId); - } - rightClick.hideTracks(hideIds); - } else if (cmd === "moveTop") { - } else if ((cmd === 'sortExp') || (cmd === 'sortSim')) { url = "hgTracks?hgsid=" + getHgsid() + "&" + cmd + "="; rec = hgTracks.trackDb[id]; if (tdbHasParent(rec) && tdbIsLeaf(rec)) url += rec.parentTrack; else { // The button already has the ref var link2 = normed($( 'td#td_btn_'+ rightClick.selectedMenuItem.id ).children('a')); if (link2) url = $(link2).attr('href'); else url += rightClick.selectedMenuItem.id; } location.assign(url); @@ -2630,42 +2586,41 @@ updateObj[key] = 1; cart.setVarsObj(updateObj,null,false); imageV2.requestImgUpdate(id, id + ".doMergeItems=1"); } } else { // if ( cmd in 'hide','dense','squish','pack','full','show' ) // Change visibility settings: // // First change the select on our form: rec = hgTracks.trackDb[id]; selectUpdated = vis.update(id, cmd); // Now change the track image if (imageV2.enabled && cmd === 'hide') { // Hide local display of this track and update server side cart. // Subtracks controlled by 2 settings so del vis and set sel=0. - rightClick.hideTracks([id]); - /* if (tdbIsSubtrack(rec)) { + if (tdbIsSubtrack(rec)) { // Remove subtrack level vis and explicitly uncheck. cart.setVars( [ id, id+"_sel" ], [ '[]', 0 ] ); } else if (tdbIsFolderContent(rec)) { // supertrack children need to have _sel set to trigger superttrack reshaping cart.setVars( [ id, id+"_sel" ], [ 'hide', 0 ] ); } else { cart.setVars([id], ['hide']); // Others, just set vis hide. } $(document.getElementById('tr_' + id)).remove(); - imageV2.afterImgChange(true); */ + imageV2.afterImgChange(true); } else if (!imageV2.mapIsUpdateable) { jQuery('body').css('cursor', 'wait'); if (selectUpdated) { // assert(document.TrackForm); document.TrackForm.submit(); } else { // Add vis update to queue then submit cart.setVars([id], [cmd], null, false); // synchronous document.TrackHeaderForm.submit(); } } else { imageV2.requestImgUpdate(id, id + "=" + cmd, "", cmd); } } }, @@ -2975,56 +2930,30 @@ title + "..."; o[item] = {onclick: function(menuItemClicked, menuObject) { rightClick.hit(menuItemClicked,menuObject,"followLink"); return true; } }; any = true; } } if (any) { menu.push($.contextMenu.separator); menu.push(o); } } } - - menu.push($.contextMenu.separator); - o = {}; - o[" Hide all other tracks "] = { - onclick: function(menuItemClicked, menuObject) { - rightClick.hit(menuItemClicked, menuObject, "hideOthers"); - return true; } - }; - menu.push(o); - - o = {}; - o[" Move to top "] = { - onclick: function(menuItemClicked, menuObject) { - rightClick.hit(menuItemClicked, menuObject, "moveTop"); - return true; } - }; - menu.push(o); - - o = {}; - o[" Move to bottom "] = { - onclick: function(menuItemClicked, menuObject) { - rightClick.hit(menuItemClicked, menuObject, "moveBottom"); - return true; } - }; - menu.push(o); - if (rightClick.selectedMenuItem && rec) { // Add cfg options at just shy of end... o = {}; if (tdbIsLeaf(rec)) { if (rec.configureBy !== 'none' && (!tdbIsCompositeSubtrack(rec) || rec.configureBy !== 'clickThrough')) { // Note that subtracks never do clickThrough because // parentTrack cfg is the desired clickThrough o[rightClick.makeImgTag("wrench.png")+" Configure "+rec.shortLabel] = { onclick: function(menuItemClicked, menuObject) { rightClick.hit(menuItemClicked, menuObject, "hgTrackUi_popup"); return true; } }; } @@ -5883,58 +5812,37 @@ newLink.setAttribute("id", "hgTracksDownload"); newLink.setAttribute("name", "downloadTracks"); newLink.textContent = "Download Current Track Data"; newLink.href = "#"; newListEl.appendChild(newLink); $("#downloads > ul")[0].appendChild(newListEl); $("#hgTracksDownload").on("click", downloadCurrentTrackData.showDownloadUi); } if (typeof showMouseovers !== 'undefined' && showMouseovers) { convertTitleTagsToMouseovers(); } }); -function hgtWarnTimingMinimal() { - /* a fallback timing warning that does not require any HTML nor javascript inline blocks using the basic confirm dialog */ - var skipNotification = localStorage.getItem("hgTracks.hideSpeedNotification"); - dumpCart(loadSeconds, skipNotification); - - if (skipNotification) - return; - - msg = "This page took more than "+window.hgMaxTimeWarning/1000+" seconds to load. We strive to keep "+ - "the UCSC Genome Browser quick and responsive. See our "+ - "display speed FAQ for "+ - "common causes and solutions to slow performance. If this problem continues, you can create a "+ - "session link via My Data > My Sessions and send the link to genome-www@soe.ucsc.edu."+ - " Hit OK to continue, or cancel to never show this message again."+ - " As soon as this dialog is closed with either button, all tracks will be hidden, to make the genome browser fast again. "; - var isOk = confirm(msg); - if (!isOk) - localStorage.setItem(key, "1"); - // this reloads the page and hides all tracks - window.location.search += '&hideTracks=1'; -} - -function hgtWarnTiming() { +function hgtWarnTiming(maxSeconds) { /* show a dialog box if the page load time was slower than x seconds. Has buttons to hide or never show this again. */ var loadTime = window.performance.timing.domContentLoadedEventStart-window.performance.timing.navigationStart; /// in msecs var loadSeconds = loadTime/1000; if (loadSeconds < maxSeconds) return; var skipNotification = localStorage.getItem("hgTracks.hideSpeedNotification"); dumpCart(loadSeconds, skipNotification); if (skipNotification) return; - msg = "This page took seconds to load. We strive to keep "+ + msg = "This page took "+loadSeconds+" seconds to load. We strive to keep "+ "the UCSC Genome Browser quick and responsive. See our "+ "display speed FAQ for "+ "common causes and solutions to slow performance. If this problem continues, you can create a "+ "session link via My Data > My Sessions and send the link to genome-www@soe.ucsc.edu."; notifBoxSetup("hgTracks", "hideSpeedNotification", msg); notifBoxShow("hgTracks", "hideSpeedNotification"); + }