/* * 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', keepAlive: true, options: { context: { giver: localStorage.getItem("accttype") == "giver", receiver: localStorage.getItem("accttype") == "receiver" } }, on: { pageAfterIn: function () { function tryToLoadHomePage() { if (typeof loadHomePage != "function") { setTimeout(tryToLoadHomePage, 500); } else { loadHomePage(function () {}); } } tryToLoadHomePage(); } } }, { path: '/setup/0', url: './pages/setup0.html', name: 'setup0' }, { path: '/setup/1/:acctType', templateUrl: './pages/setup1.html', name: 'setup1' }, { path: '/sendmoney/:publicID', templateUrl: './pages/sendmoney.html', name: 'sendmoney', on: { pageAfterIn: function () { function tryToLoadSendMoneyPage() { if (typeof loadSendMoneyPage != "function") { setTimeout(tryToLoadSendMoneyPage, 500); } else { loadSendMoneyPage(); } } tryToLoadSendMoneyPage(); } } }, { path: '/moneysent/:amount/:name', templateUrl: './pages/moneysent.html', name: 'moneysent' }, { path: '/addfunds', templateUrl: './pages/addfunds.html', name: 'addfunds', on: { pageAfterIn: function () { function tryToInitPaymentPage() { if (typeof initPaymentPage != "function") { setTimeout(tryToInitPaymentPage, 500); } else { initPaymentPage(); } } tryToInitPaymentPage(); } } }, { path: '/fundsadded/:amount/:final_amount', templateUrl: './pages/fundsadded.html', name: 'fundsadded' }, { path: '/updateprofile', templateUrl: './pages/updateprofile.html', name: 'updateprofile', on: { pageAfterIn: function () { function tryToLoadProfilePage() { if (typeof loadProfilePage != "function") { setTimeout(tryToLoadProfilePage, 500); } else { loadProfilePage(); } } tryToLoadProfilePage(); } } }, { 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: ' ' + username + '', text: '', onclick: "" }, { setting: "updateprofile", title: "Update profile", text: "Set a name and tell people about you.", onclick: "router.navigate('/updateprofile')" }, { setting: "account", title: "Sign out", onclick: "router.navigate('/setup/0')" }, { setting: "versions", title: "Helping Helena app v1.0.0", text: "Copyright © 2018-2019 Netsyms Technologies. License: Mozilla Public License 2.0.", 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"] + "')" }] } }); } }, { path: '/credits', url: './pages/credits.html', name: 'credits' } ];