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

49 lines
1.7 KiB
JavaScript
Raw Normal View History

/*
* intro.js
* Copyright (c) 2019 thegrumpydictator@gmail.com
*
* This file is part of Firefly III (https://github.com/firefly-iii).
2017-10-21 08:40:00 +02:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
2017-10-21 08:40:00 +02:00
*
* This program is distributed in the hope that it will be useful,
2017-10-21 08:40:00 +02:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
2017-10-21 08:40:00 +02:00
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://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
}