Files
firefly-iii/public/js/ff/intro/intro.js

34 lines
911 B
JavaScript
Raw Normal View History

/*
* 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 */
$(function () {
"use strict";
2017-08-12 07:47:42 +02:00
if (!forceDemoOff) {
2017-07-22 10:50:30 +02:00
$.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() {
2017-10-20 20:23:45 +02:00
$.getJSON(routeForFinishedTour);
2017-07-16 07:35:08 +02:00
}