2017-07-15 21:40:42 +02:00
|
|
|
/*
|
|
|
|
* intro.js
|
|
|
|
* Copyright (c) 2017 thegrumpydictator@gmail.com
|
|
|
|
* This software may be modified and distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License.
|
|
|
|
*
|
|
|
|
* See the LICENSE file for details.
|
|
|
|
*/
|
|
|
|
|
2017-07-23 08:16:11 +02:00
|
|
|
/** global: routeForTour, routeStepsUri, routeForFinishedTour, forceDemoOff */
|
2017-07-15 21:40:42 +02:00
|
|
|
|
|
|
|
$(function () {
|
|
|
|
"use strict";
|
2017-07-22 10:50:30 +02:00
|
|
|
if(!forceDemoOff) {
|
|
|
|
$.getJSON(routeStepsUri).done(setupIntro)
|
|
|
|
}
|
2017-07-16 07:35:08 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
function setupIntro(steps) {
|
|
|
|
|
|
|
|
var intro = introJs();
|
|
|
|
intro.setOptions({
|
|
|
|
steps: steps,
|
|
|
|
exitOnEsc: true,
|
|
|
|
exitOnOverlayClick: true,
|
2017-07-21 06:00:10 +02:00
|
|
|
keyboardNavigation: true
|
2017-07-16 07:35:08 +02:00
|
|
|
});
|
|
|
|
intro.oncomplete(reportIntroFinished);
|
|
|
|
intro.onexit(reportIntroFinished);
|
|
|
|
intro.start();
|
|
|
|
}
|
|
|
|
|
|
|
|
function reportIntroFinished() {
|
|
|
|
$.post(routeForFinishedTour);
|
|
|
|
}
|