36c7bf6775818acf0f16d1875e89fe5e8450cc7d
chmalee
Thu Jul 27 12:46:44 2023 -0700
Log when users start and end the tutorial, refs Jairo email
diff --git src/hg/js/tutorial.js src/hg/js/tutorial.js
index 9f26862..597fb2d 100644
--- src/hg/js/tutorial.js
+++ src/hg/js/tutorial.js
@@ -1,252 +1,259 @@
function displaySelectedOption(selectId) {
const selectElement = document.getElementById(selectId);
const selectedOption = selectElement.options[selectElement.selectedIndex].text;
return selectedOption;
}
const tour = new Shepherd.Tour({
defaultStepOptions: {
cancelIcon: {
enabled: true
},
classes: 'class-1 class-2',
scrollTo: { behavior: 'smooth', block: 'center' }
},
useModalOverlay: true
});
+// log when a tutorial is started
+tour.on('start', function() {
+ writeToApacheLog("tutorial start " + getHgsid());
+});
+
var tutorialButtons = {
'back': {
action() {
return this.back();
},
classes: 'shepherd-button-secondary',
text: 'Back'
},
'next': {
action() {
return this.next();
},
text: 'Next'
},
'end': {
action() {
+ // log when the tutorial is finished
+ writeToApacheLog("tutorial finish " + getHgsid());
localStorage.setItem("hgTracks_hideTutorial", "1");
return this.complete();
},
classes: 'shepherd-button-secondary',
text: 'Finish'
}
};
/* Wrapping the tutorial steps and fuctions to only execute after the page loads*/
window.onload = function() {
function selectMiddleButton() {
var hgTracksTable = document.getElementById('imgTbl');
var rowCount = hgTracksTable.rows.length;
var middleIndex = Math.floor(rowCount / 2);
var middleRow = hgTracksTable.rows[middleIndex];
var firstId = middleRow.querySelector('td');
var middleTrackId = firstId.id;
return '#' + middleTrackId;
}
tour.addStep({
title: 'Welcome to the UCSC Genome Browser Tutorial',
text: 'The navigation bar at the top of the page will allow you to access the ' +
'tools, downloads, and help pages. There are four main drop-downs that are useful ' +
'for most users: ' +
'
' +
'
Genomes - switch between the many genomes available
' +
'
Genome Browser - configure, search for tracks, and reset the ' +
'Genome Browser back to the default settings.
' +
'
Tools - access to features such as BLAT, isPCR, '+
'and LiftOver. The Table Browser can also be used to export track data in ' +
'various file formats.
Help - access contact information, FAQs, and Browser Documentation.
' +
'
',
attachTo: {
element: '#nice-menu-1',
on: 'bottom'
},
buttons: [tutorialButtons['next'], tutorialButtons['end']],
id: 'navbar',
classes: 'dark-background'
});
tour.addStep({
title: 'Browsing the Genome',
text: 'The search bar allows you to navigate to a region on the genome using ' +
'genome coordinates, gene symbols, rsIDs, HGVS terms, or DNA sequence. You can even search documentation' +
'and FAQ pages using this search bar. A few example queries are: ' +
'
' +
'Please note, BLAT '+
'is used if your search term is a DNA sequence. For the best ' +
'results, make sure your sequence is long enough to meet BLAT specifications. The ' +
'examples link next to ' +
'the search bar contains even more search queries.' ,
attachTo: {
element: '#positionInput',
on: 'bottom'
},
buttons: [tutorialButtons['back'], tutorialButtons['next']],
id: 'search'
});
tour.addStep({
title: 'Drag-and-Select the Genome Browser Image',
text: 'Dragging the Genome Browser image performs different tasks depeneding on where and ' +
'how you click the image.
'+
'Click-and-Drag the ruler at the top of the image will bring up a menu to zoom into '+
'or highlight the region. Click-and-Drag anywhere else on the Genome Browser image '+
'will allow you to scroll to the left or right.' +
'
' +
'Alternatively, you can: '+
'
'+
'
Hold Alt+drag or Option+drag to highlight
'+
'
Hold Ctrl+drag or Cmd+drag to zoom
'+
'
',
attachTo: {
element: '#td_data_ruler',
on: 'bottom',
},
buttons: [tutorialButtons['back'], tutorialButtons['next']],
id: 'highlight'
});
tour.addStep({
title: 'Quick Link to Change Track Settings',
text: 'Clicking on the rectangle box next to a track is an easy way to quickly ' +
'go to the track settings page for that track.' +
'
' +
'Right-clicking on the track will also bring up a menu ' +
'to change the display mode, configure a track, or view a PNG image of the current ' +
'window.' +
'' +
'',
attachTo: {
element: selectMiddleButton(),
on: 'right',
},
buttons: [tutorialButtons['back'], tutorialButtons['next']],
id: 'hgTrackUiLink'
});
tour.addStep({
title: 'Changing the Display Mode of a Track',
text: 'Annotation tracks can be entirely hidden or shown in four different ways that take ' +
'an increasing amount of vertical space: ' +
'dense, squish, '+
'pack, and full.'+
'
' +
'After changing the display mode of a track, the change will not be applied ' +
'until after you refresh the page. You could either refresh the page manually ' +
'using your web browser or you can click on any of the ' +
'track groups.',
attachTo: {
element: function() {return $("input[name='hgt\.refresh']").slice(0)[0];},
on: 'bottom'
},
buttons: [tutorialButtons['back'], tutorialButtons['next']],
id: 'refresh'
});
tour.addStep({
title: 'Searching for Tracks on the Genome Browser',
text: 'Having trouble finding a dataset for your genome assembly? The ' +
'Track Search ' +
'feature allows searching for terms in track names, descriptions, groups, and ENCODE ' +
'metadata.
'+
'More information about can be found on the following ' +
'help page. '+
'The Track Search feature can also be accessed by hovering over the ' +
'"Genome Browser" drop-down menu.',
attachTo: {
element: '#hgt_tSearch',
on: 'top'
},
buttons: [tutorialButtons['back'], tutorialButtons['next']],
id: 'shortCuts',
});
tour.addStep({
title: 'Configure the Genome Browser Image',
text: 'Use the button to customize graphic font, size, gridlines, ' +
'and more. This can be helpful when exporting an image for publication. ' +
'
' +
'You can also find a link to configure the browser image by hovering over the ' +
'"Genome Browser" drop-down menu.',
attachTo: {
element: '#hgTracksConfigPage',
on: 'bottom'
},
buttons: [tutorialButtons['back'], tutorialButtons['next']],
id: 'configure'
});
tour.addStep({
title: 'Flip the Strand Orientation',
text: 'By default, the UCSC Genome Browser displays the forward strand (5\' to 3\'), but ' +
'it can be configured to display the negative strand (3\' to 5\').
' +
'To reverse the genome orientation, click the button and the Genome Browser image '+
'will flip to show either the negative or positive strand.',
attachTo: {
element: document.getElementById('hgt.toggleRevCmplDisp'),
on: 'bottom'
},
buttons: [tutorialButtons['back'], tutorialButtons['next']],
id: 'reverse'
});
tour.addStep({
title: 'Further Training and Contact Information',
text: 'You can find other guides and training videos on the ' +
'training page. ' +
'You can also search the ' +
'mailing list archive ' +
'to find previously answered questions for guidance. ' +
'
' +
'If you still have questions after searching the ' +
'FAQ page or ' +
'Genome Browser User Guide ' +
'pages, you can email the suitable mailing list for your inquiry from the ' +
'contact us page. ' +
'
' +
'Follow these citation guidelines when using ' +
'the Genome Browser tool suite or data from the UCSC Genome Browser database in a ' +
'research work that will be published in a journal or on the Internet.
' +
'In addition to the relevant paper, '+
'please include a reference to the Genome Browser website in your manuscript: '+
'http://genome.ucsc.edu. ',
attachTo: {
element: '#help.menuparent',
on: 'bottom'
},
buttons: [tutorialButtons['back'], tutorialButtons['end']],
id: 'lastPopUp'
});
}