108 lines
3.8 KiB
JavaScript
Raw Normal View History

2019-03-25 19:10:58 -06:00
/*
* 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 routes = [
{
path: '/home',
templateUrl: './pages/home.html',
name: 'home',
on: {
pageAfterIn: function () {
function tryToLoadHomePage() {
if (typeof loadHomePage != "function") {
setTimeout(tryToLoadHomePage, 500);
} else {
loadHomePage(function () {});
}
}
tryToLoadHomePage();
}
2019-03-25 19:10:58 -06:00
}
},
{
2019-04-11 00:45:01 -06:00
path: '/login',
url: './pages/login.html',
name: 'login'
},
2019-03-31 16:55:18 -06:00
{
path: '/updateprofile',
templateUrl: './pages/updateprofile.html',
name: 'updateprofile',
on: {
pageAfterIn: function () {
function tryToLoadProfilePage() {
if (typeof loadProfilePage != "function") {
setTimeout(tryToLoadProfilePage, 500);
} else {
loadProfilePage();
}
}
tryToLoadProfilePage();
2019-03-31 16:55:18 -06:00
}
}
},
2019-03-25 19:10:58 -06:00
{
path: '/settings',
name: 'prefs',
async: function (routeTo, routeFrom, resolve, reject) {
var username = localStorage.getItem("username");
if (username == null) {
username = "Not logged in";
}
var serverurl = localStorage.getItem("serverurl");
if (serverurl == null) {
serverurl = "None";
}
resolve({
templateUrl: './pages/settings.html'
}, {
context: {
settings: [{
setting: "userinfo",
title: '<i class="fa fa-user"></i> <span id="username">' + username + '</span>',
text: '',
2019-03-25 19:10:58 -06:00
onclick: ""
},
2019-03-31 16:55:18 -06:00
{
setting: "updateprofile",
title: "Update profile",
2019-04-11 00:45:01 -06:00
text: "Change the business name and information.",
2019-03-31 16:55:18 -06:00
onclick: "router.navigate('/updateprofile')"
},
2019-03-25 19:10:58 -06:00
{
2019-04-11 00:45:01 -06:00
setting: "logout",
title: "Sign out",
2019-04-11 00:45:01 -06:00
onclick: "router.navigate('/login')"
2019-03-25 19:10:58 -06:00
},
{
setting: "versions",
2019-04-11 00:45:01 -06:00
title: "Helping Helena Merchant v1.0.0",
text: "Copyright &copy; 2018-2019 Netsyms Technologies. License: <span style=\"text-decoration: underline;\" onclick=\"openBrowser('https://source.netsyms.com/Netsyms/HelpingHelenaMerchant?pk_campaign=HelpingHelenaMerchantApp');\">Mozilla Public License 2.0</span>.",
2019-03-25 19:10:58 -06:00
onclick: ""
},
{
setting: "opensource",
title: "Open Source Information",
text: "",
onclick: "router.navigate('/credits')"
},
{
setting: "privacy",
title: "Privacy Policy",
text: "",
onclick: "openBrowser('" + SETTINGS["terms_of_service_url"] + "')"
2019-03-25 19:10:58 -06:00
}]
}
});
}
},
{
path: '/credits',
url: './pages/credits.html',
name: 'credits'
}
];