2017-07-15 21:40:42 +02:00
|
|
|
/*
|
|
|
|
* 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/>.
|
2017-07-15 21:40:42 +02:00
|
|
|
*/
|
|
|
|
|
2017-11-25 08:54:52 +01:00
|
|
|
/** global: routeForTour, token, routeStepsUri, routeForFinishedTour, forceDemoOff */
|
2017-07-15 21:40:42 +02:00
|
|
|
|
|
|
|
$(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-11-15 11:33:07 +01:00
|
|
|
$.post(routeForFinishedTour, {_token: token});
|
2017-07-16 07:35:08 +02:00
|
|
|
}
|