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.
135 lines
4.8 KiB
JavaScript
135 lines
4.8 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 routes = [
|
|
{
|
|
path: '/home',
|
|
templateUrl: './pages/home.html',
|
|
name: 'home',
|
|
options: {
|
|
context: {
|
|
colors: [
|
|
// Pastel colors
|
|
"EF9A9A", // red
|
|
"FFCC80", // orange
|
|
"FFF59D", // yellow
|
|
"E6EE9C", // lime
|
|
"A5D6A7", // green
|
|
"80CBC4", // teal
|
|
"81D4FA", // light blue
|
|
"90CAF9", // blue
|
|
"B39DDB", // purple
|
|
"F48FB1", // pink
|
|
// Bright colors
|
|
"F44336", // red
|
|
"FF9800", // orange
|
|
"FFEB3B", // yellow
|
|
"8BC34A", // light green
|
|
"4CAF50", // green
|
|
"009688", // teal
|
|
"03A9F4", // light blue
|
|
"2196F3", // blue
|
|
"673AB7", // purple
|
|
"E91E63", // pink
|
|
// Other colors
|
|
"FFFFFF", // white
|
|
"E0E0E0", // pastel gray
|
|
"9E9E9E", // gray
|
|
"BCAAA4", // pastel brown
|
|
"795548", // brown
|
|
"000000" // black
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
path: '/setup/0',
|
|
url: './pages/setup0.html',
|
|
name: 'setup0'
|
|
},
|
|
{
|
|
path: '/setup/1',
|
|
templateUrl: './pages/setup1.html',
|
|
name: 'setup1'
|
|
},
|
|
{
|
|
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: '<i class="fa fa-server"></i> Server: <span id="url">' + serverurl + '</span>',
|
|
onclick: ""
|
|
},
|
|
{
|
|
setting: "account",
|
|
title: "Sign in to a different account",
|
|
link: true,
|
|
onclick: "router.navigate('/setup/0')"
|
|
},
|
|
{
|
|
setting: "darktheme",
|
|
title: "Use dark theme",
|
|
text: "Reduces eyestrain and saves power on some devices.",
|
|
toggle: true,
|
|
checked: localStorage.getItem("darktheme") == "true",
|
|
onclick: ""
|
|
},
|
|
{
|
|
setting: "versions",
|
|
title: "NotePost app v" + app_version,
|
|
text: "Copyright © 2018-2019 Netsyms Technologies. License: <span style=\"text-decoration: underline;\" onclick=\"openBrowser('https://source.netsyms.com/Apps/NotePostApp?pk_campaign=NotePostApp');\">Mozilla Public License 2.0</span>.",
|
|
onclick: ""
|
|
},
|
|
{
|
|
setting: "opensource",
|
|
title: "Open Source Information",
|
|
text: "",
|
|
link: true,
|
|
onclick: "router.navigate('/credits')"
|
|
},
|
|
{
|
|
setting: "privacy",
|
|
title: "Privacy Policy",
|
|
text: "",
|
|
link: true,
|
|
onclick: "openBrowser('https://netsyms.com/legal?pk_campaign=NotePostApp')"
|
|
}]
|
|
}
|
|
});
|
|
}
|
|
},
|
|
{
|
|
path: '/credits',
|
|
url: './pages/credits.html',
|
|
name: 'credits'
|
|
},
|
|
{
|
|
path: '/editor',
|
|
name: 'editor',
|
|
templateUrl: './pages/editor.html',
|
|
alias: '/editnote', // in case I missed any links
|
|
on: {
|
|
pageAfterIn: function () {
|
|
initEditor();
|
|
}
|
|
}
|
|
}
|
|
]; |