4c6147a12865ea349d3d35610f9cb43aadd3a366
jnavarr5
  Wed Nov 13 15:27:28 2024 -0800
Updating the name of the first tutorial now that we will be adding more. Making the first tutorial use the global object so I can call it from the new popup window with the rest of the tutorials. Moving a function to clean up the code. Updating the makefile with the new name change, refs #34290

diff --git src/hg/js/hgTracks.js src/hg/js/hgTracks.js
index fe69b9a..1ba7ba2 100644
--- src/hg/js/hgTracks.js
+++ src/hg/js/hgTracks.js
@@ -5806,64 +5806,63 @@
         if ($(retrievables).length > 0) {
             $(retrievables).each( function (i) {
                 var trackName = $(this).attr('id').substring(3);
                 imageV2.requestImgUpdate(trackName,"","");
             });
         }
         imageV2.loadRemoteTracks();
         makeItemsByDrag.load();
 
         if (typeof clinicalTour !== 'undefined') {
             if (typeof startClinicalOnLoad !== 'undefined' && startClinicalOnLoad){
                 clinicalTour.start();
             }
         }
         // show a tutorial page if this is a new user
-        if (typeof tour !== 'undefined' && tour) {
-            setupSteps();
+        if (typeof basicTour !== 'undefined') {
             if (typeof startTutorialOnLoad !== 'undefined' && startTutorialOnLoad) {
-                tour.start();
+                basicTour.start();
             }
             let lsKey = "hgTracks_hideTutorial";
             let isUserLoggedIn = (typeof userLoggedIn !== 'undefined' && userLoggedIn === true);
             let hideTutorial = localStorage.getItem(lsKey);
             let tutMsgKey = "hgTracks_tutMsgCount";
             let tmp = localStorage.getItem(tutMsgKey), tutMsgCount = 0;
             if (tmp !== null) {tutMsgCount = parseInt(tmp);}
             // if the user is not logged in and they have not already gone through the
             // tutorial
             if (!isUserLoggedIn && !hideTutorial && tutMsgCount < 5) {
                 let msg = "New to the Genome Browser? See our short (2-3 minute) guided tutorial. " +
                     "All tutorials can be found in the top blue bar menu under <b>Help</b> > <b>Interactive Tutorial</b>.<br>" +
                     "<button id='showTutorialLink' href=\"#showTutorial\">Start tutorial</button>";
                 notifBoxSetup("hgTracks", "hideTutorial", msg, true);
                 notifBoxShow("hgTracks", "hideTutorial");
                 localStorage.setItem("hgTracks_tutMsgCount", ++tutMsgCount);
                 $("#showTutorialLink").on("click", function() {
                     $("#hgTracks_hideTutorialnotifyHideForever").trigger("click");
-                    tour.start();
+                    basicTour.start();
                 });
             }
             // allow user to bring the tutorial up under the help menu whether they've seen
             // it or not
             let tutorialLinkMenuItem = document.createElement("li");
             tutorialLinkMenuItem.id = "hgTracksHelpTutorialMenuItem";
             tutorialLinkMenuItem.innerHTML = "<a id='hgTracksHelpTutorialLink' href='#showTutorial'>" +
                 "Interactive Tutorial</a>";
             $("#help > ul")[0].appendChild(tutorialLinkMenuItem);
             $("#hgTracksHelpTutorialLink").on("click", function () {
-                tour.start();
+                basicTour.start();
             });
             // Create a new button in the Help menu to show all available javascript tutorials
             let tutorialLinks = document.createElement("li");
             tutorialLinks.id = "hgTracksHelpTutorialLinks";
             tutorialLinks.innerHTML = "<a id='hgTracksHelpTutorialLinks' href='#showTutuorialPopup'>" +
                 "Show All Interactive Tutorials</a>";
             $("#help > ul")[0].appendChild(tutorialLinks);
             $("#hgTracksHelpTutorialLinks").on("click", function () {
                 openTutorialPopup();
             });
         }
         
         // Any highlighted region must be shown and warnBox must play nice with it.
         imageV2.drawHighlights();
         // When warnBox is dismissed, any image highlight needs to be redrawn.