You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
JavaScript
53 lines
1.2 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
var $$ = Dom7;
|
|
|
|
// Run platform-specific setup code for Cordova or NW.js
|
|
initPlatform();
|
|
|
|
var app = new Framework7({
|
|
root: "#app",
|
|
name: "HelpingHelena",
|
|
id: "com.netsyms.HelpingHelena",
|
|
theme: platform_theme,
|
|
init: true,
|
|
initOnDeviceReady: false,
|
|
routes: routes
|
|
});
|
|
|
|
var mainView = app.views.create('.view-main', {
|
|
url: "/"
|
|
});
|
|
|
|
var router = mainView.router;
|
|
|
|
function restartApplication() {
|
|
window.location = "index.html";
|
|
}
|
|
|
|
router.on("pageInit", function (pagedata) {
|
|
pagedata.$el.find('script').each(function (el) {
|
|
if ($$(this).attr('src')) {
|
|
var s = document.createElement('script');
|
|
s.src = $$(this).attr('src');
|
|
$$('head').append(s);
|
|
} else {
|
|
eval($$(this).text());
|
|
}
|
|
});
|
|
switch (pagedata.name) {
|
|
case "settings":
|
|
updateSettingsData();
|
|
break;
|
|
}
|
|
});
|
|
|
|
|
|
if (localStorage.getItem("configured") == null) {
|
|
// Open the setup page
|
|
router.navigate("/setup/0");
|
|
} else {
|
|
router.navigate("/home");
|
|
} |