3d79b89141253b72477ac9276f8acfc125efc7c6 max Thu Apr 20 02:54:47 2023 -0700 #Preview2 week - bugs introduced now will need a build patch to fix small tweaks to dumpToLog feature, refs #30591 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 3cdbd11..7d7b5a7 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -5479,44 +5479,49 @@ 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").click(downloadCurrentTrackData.showDownloadUi); } }); 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"); - if (loadSeconds > maxSeconds && !skipNotification) { - writeToApacheLog("load time: " + loadSeconds + "s, showing warning message"); + writeToApacheLog("warnTiming "+getHgsid()+" time=" + loadSeconds + " skipNotif="+skipNotification); + + if (skipNotification) + return; + var div = document.createElement("div"); div.style.display = "none"; div.style.width = "90%"; div.style.marginLeft = "100px"; div.id = "notifBox"; div.innerHTML = "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.
"+ "
"+ " "+ ""+ "
"; document.body.appendChild(div); notifBoxShow(); $("#notifyHide").click( function() { $("#notifBox").remove(); }); $("#notifyHideForever").click( function() { $("#notifBox").remove(); localStorage.setItem("hgTracks.hideSpeedNotification", "1"); }); } -}