Built a new routine for intro tours.

This commit is contained in:
James Cole
2017-07-16 07:35:08 +02:00
parent 09131e8c36
commit 58bfb35fa6
9 changed files with 185 additions and 44 deletions

View File

@@ -6,9 +6,28 @@
* See the LICENSE file for details.
*/
/** global: route_for_tour */
/** global: routeForTour, routeStepsUri, routeForFinishedTour */
$(function () {
"use strict";
//alert('show user intro for ' + route_for_tour);
});
$.getJSON(routeStepsUri).done(setupIntro)
});
function setupIntro(steps) {
var intro = introJs();
intro.setOptions({
steps: steps,
exitOnEsc: true,
exitOnOverlayClick: true,
keyboardNavigation: true,
});
intro.oncomplete(reportIntroFinished);
intro.onexit(reportIntroFinished);
intro.start();
}
function reportIntroFinished() {
$.post(routeForFinishedTour);
}