4338ba13b766ee88e8b51ddd84dfc1363488e1bd max Wed Mar 29 03:03:23 2023 -0700 making performance warning box nicer based on feedback from Lou, refs #30591 diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js index 21e3260..f21d384 100644 --- src/hg/js/hgTracks.js +++ src/hg/js/hgTracks.js @@ -5483,35 +5483,40 @@ 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; var skipNotification = localStorage.getItem("hgTracks.hideSpeedNotification"); if (loadSeconds > maxSeconds && !skipNotification) { 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 try to make the UCSC Genome Browser responsive. If you want us to look into "+ - "why the page is so slow, you can create a "+ - "session link with My Data > My Sessions and send it to genome-www@soe.ucsc.edu.<br>"+ + div.innerHTML = "This page took "+loadSeconds+" seconds to load. You can read "+ + "<a href='../FAQ/FAQtracks.html#speed' target=_blank>our display speed FAQ</a> to learn more about how the track selection influences the "+ + "performance of the Genome Browser.<br> "+ + "Also, we try to make the UCSC Genome Browser responsive. If you think the page should be faster and want us to look into "+ + "this particular track combination, you can create a "+ + "short session link with My Data > My Sessions and send the link to genome-www@soe.ucsc.edu.<br>"+ "<div style='text-align:center'>"+ "<button id='notifyHide'>Close</button> "+ - "<button id='notifyHideForever'>Close and never show again</button>"+ + "<button id='notifyHideForever'>Close and do not show again</button>"+ "</div>"; document.body.appendChild(div); notifBoxShow(); $("#notifyHide").click( function() { $("#notifBox").remove(); }); $("#notifyHideForever").click( function() { $("#notifBox").remove(); localStorage.setItem("hgTracks.hideSpeedNotification", "1"); }); } }