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

49 lines
1.6 KiB
JavaScript
Raw Normal View History

/*
* intro.js
* Copyright (c) 2017 thegrumpydictator@gmail.com
*
2017-10-21 08:40:00 +02:00
* This file is part of Firefly III.
*
* Firefly III is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Firefly III is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
2017-12-17 14:43:13 +01:00
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
2018-01-10 07:57:36 +01:00
/** global: nextLabel, prevLabel,skipLabel,doneLabel routeForTour, token, 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({
2018-01-10 07:57:36 +01:00
nextLabel: nextLabel,
prevLabel: prevLabel,
skipLabel: skipLabel,
doneLabel: doneLabel,
2017-07-16 07:35:08 +02:00
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-11-15 11:33:07 +01:00
$.post(routeForFinishedTour, {_token: token});
2017-07-16 07:35:08 +02:00
}