|
|
|
@ -92,83 +92,113 @@ var routes = [
|
|
|
|
|
path: '/settings',
|
|
|
|
|
name: 'settings',
|
|
|
|
|
async: function (routeTo, routeFrom, resolve, reject) {
|
|
|
|
|
var mapstyles = [];
|
|
|
|
|
for (var id in SETTINGS.maptileurls) {
|
|
|
|
|
if (SETTINGS.maptileurls.hasOwnProperty(id)) {
|
|
|
|
|
mapstyles.push({
|
|
|
|
|
value: id,
|
|
|
|
|
label: SETTINGS.maptileurls[id].name,
|
|
|
|
|
selected: localStorage.getItem("mapsource") == id
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var alertsounds = [];
|
|
|
|
|
for (var id in SETTINGS.alertsounds) {
|
|
|
|
|
if (SETTINGS.alertsounds.hasOwnProperty(id)) {
|
|
|
|
|
alertsounds.push({
|
|
|
|
|
value: id,
|
|
|
|
|
label: SETTINGS.alertsounds[id].name,
|
|
|
|
|
selected: localStorage.getItem("alertsound") == id
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var settings = [{
|
|
|
|
|
setting: "alertsound",
|
|
|
|
|
title: "Alert sound",
|
|
|
|
|
text: "Select which sound to play when a package is nearby.",
|
|
|
|
|
select: true,
|
|
|
|
|
options: alertsounds
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "alertvolume",
|
|
|
|
|
title: "Alert volume",
|
|
|
|
|
min: 0,
|
|
|
|
|
max: 100,
|
|
|
|
|
step: 1,
|
|
|
|
|
value: localStorage.getItem("alertvolume"),
|
|
|
|
|
slider: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "alertinterval",
|
|
|
|
|
title: "Alert interval (seconds)",
|
|
|
|
|
min: 15,
|
|
|
|
|
max: 120,
|
|
|
|
|
step: 15,
|
|
|
|
|
value: localStorage.getItem("alertinterval") == null ? 30 : localStorage.getItem("alertinterval"),
|
|
|
|
|
slider: true
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
if (platform_type == "cordova") {
|
|
|
|
|
settings.push({
|
|
|
|
|
setting: "wakelock",
|
|
|
|
|
title: "Keep screen on",
|
|
|
|
|
text: "Improves GPS accuracy and alert sound reliability, but uses more battery.",
|
|
|
|
|
toggle: true,
|
|
|
|
|
checked: localStorage.getItem("wakelock") == "true",
|
|
|
|
|
onclick: ""
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
settings.push(
|
|
|
|
|
{
|
|
|
|
|
setting: "darktheme",
|
|
|
|
|
title: "Use dark theme",
|
|
|
|
|
text: "Saves power on phones with OLED screens.",
|
|
|
|
|
toggle: true,
|
|
|
|
|
checked: localStorage.getItem("darktheme") == "true",
|
|
|
|
|
onclick: ""
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "units",
|
|
|
|
|
title: "Measurement units",
|
|
|
|
|
text: "Use feet and miles for showing distance",
|
|
|
|
|
toggle: true,
|
|
|
|
|
checked: localStorage.getItem("units") == "imperial",
|
|
|
|
|
onclick: ""
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "mapsource",
|
|
|
|
|
title: "Map style",
|
|
|
|
|
select: true,
|
|
|
|
|
options: mapstyles,
|
|
|
|
|
text: "Choose which map style to use."
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "versions",
|
|
|
|
|
title: "PackageHelper app v" + app_version,
|
|
|
|
|
text: "Copyright © 2019 Netsyms Technologies. Licensed under the Mozilla Public License 2.0.",
|
|
|
|
|
onclick: ""
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "opensource",
|
|
|
|
|
title: "Credits and open source info",
|
|
|
|
|
text: "",
|
|
|
|
|
onclick: "router.navigate('/credits')"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "privacy",
|
|
|
|
|
title: "Privacy policy and legal",
|
|
|
|
|
text: "",
|
|
|
|
|
onclick: "openBrowser('https://netsyms.com/legal?pk_campaign=PackageHelpterApp')"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
resolve({
|
|
|
|
|
templateUrl: './pages/settings.html'
|
|
|
|
|
}, {
|
|
|
|
|
context: {
|
|
|
|
|
settings: [
|
|
|
|
|
{
|
|
|
|
|
setting: "alertsound",
|
|
|
|
|
title: "Alert sound",
|
|
|
|
|
text: "Select which sound to play when a package is nearby.",
|
|
|
|
|
onclick: "pickAlertSound()"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "alertvolume",
|
|
|
|
|
title: "Alert volume",
|
|
|
|
|
min: 0,
|
|
|
|
|
max: 100,
|
|
|
|
|
step: 1,
|
|
|
|
|
value: localStorage.getItem("alertvolume"),
|
|
|
|
|
slider: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "alertinterval",
|
|
|
|
|
title: "Alert interval (seconds)",
|
|
|
|
|
min: 15,
|
|
|
|
|
max: 120,
|
|
|
|
|
step: 15,
|
|
|
|
|
value: localStorage.getItem("alertinterval") == null ? 30 : localStorage.getItem("alertinterval"),
|
|
|
|
|
slider: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "wakelock",
|
|
|
|
|
title: "Keep screen on",
|
|
|
|
|
text: "Improves GPS accuracy and alert sound reliability, but uses more battery.",
|
|
|
|
|
toggle: true,
|
|
|
|
|
checked: localStorage.getItem("wakelock") == "true",
|
|
|
|
|
onclick: ""
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "darktheme",
|
|
|
|
|
title: "Use dark theme",
|
|
|
|
|
text: "Saves power on phones with OLED screens.",
|
|
|
|
|
toggle: true,
|
|
|
|
|
checked: localStorage.getItem("darktheme") == "true",
|
|
|
|
|
onclick: ""
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "units",
|
|
|
|
|
title: "Measurement units",
|
|
|
|
|
text: "Use feet and miles for showing distance",
|
|
|
|
|
toggle: true,
|
|
|
|
|
checked: localStorage.getItem("units") == "imperial",
|
|
|
|
|
onclick: ""
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "mapsource",
|
|
|
|
|
title: "Map style",
|
|
|
|
|
text: "Choose which map style to use.",
|
|
|
|
|
onclick: "pickMapSource()"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "versions",
|
|
|
|
|
title: "PackageHelper app v1.0.0",
|
|
|
|
|
text: "Copyright © 2019 Netsyms Technologies. Licensed under the Mozilla Public License 2.0.",
|
|
|
|
|
onclick: ""
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "opensource",
|
|
|
|
|
title: "Credits and open source info",
|
|
|
|
|
text: "",
|
|
|
|
|
onclick: "router.navigate('/credits')"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
setting: "privacy",
|
|
|
|
|
title: "Privacy policy and legal",
|
|
|
|
|
text: "",
|
|
|
|
|
onclick: "openBrowser('https://netsyms.com/legal?pk_campaign=PackageHelpterApp')"
|
|
|
|
|
}]
|
|
|
|
|
settings: settings
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|