Files
firefly-iii/public/js/ff/intro/intro.js
2017-10-20 20:23:45 +02:00

34 lines
911 B
JavaScript
Vendored

/*
* 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.
*/
/** global: routeForTour, routeStepsUri, routeForFinishedTour, forceDemoOff */
$(function () {
"use strict";
if (!forceDemoOff) {
$.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() {
$.getJSON(routeForFinishedTour);
}