e46da004a1ed5fdf64eb24662bf94e0eee2f3bf3 chmalee Tue Aug 22 10:15:31 2023 -0700 Make hgTracks tutorial start automatically with special url variable startTutorial=true, refs #32004 diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index aac2ea6..25e6bee 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -11159,30 +11159,39 @@ webIncludeResourceFile("jquery.contextmenu.css"); jsIncludeFile("jquery.contextmenu.js", NULL); webIncludeResourceFile("ui.dropdownchecklist.css"); jsIncludeFile("ui.dropdownchecklist.js", NULL); jsIncludeFile("ddcl.js", NULL); if (cfgOptionBooleanDefault("showTutorial", FALSE)) { puts(""); puts(""); jsIncludeFile("tutorial.js",NULL); // if the user is logged in, we won't show the notification // that a tutorial is available, just leave the link in the // blue bar under "Help" if (wikiLinkUserName()) jsInline("var userLoggedIn = true;"); + // if the CGI variable startTutorial=true is present (in that exact + // spelling/case), immediately start the tutorial, for example + // when the user clicks a link from a help page. Note that this + // means it is a one time link that won't work on refresh because + // the variable isn't saved onto the URL + if (sameOk(cgiOptionalString("startTutorial"), "true")) + { + jsInline("var startTutorialOnLoad = true;"); + } } } hPrintf("\n"); hPrintf("\n"); cartFlushHubWarnings(); } if (cartVarExists(cart, "chromInfoPage")) { cartRemove(cart, "chromInfoPage"); chromInfoPage(); }