|
|
|
@ -17,6 +17,35 @@ $('.item-content[data-setting=darktheme] .toggle input').on("change", function (
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('.item-content[data-setting=wakelock] .toggle input').on("change", function () {
|
|
|
|
|
var checked = $(this).prop('checked');
|
|
|
|
|
console.log(checked);
|
|
|
|
|
localStorage.setItem("wakelock", checked);
|
|
|
|
|
|
|
|
|
|
if (platform_type == "cordova") {
|
|
|
|
|
if (localStorage.getItem("wakelock") == "true") {
|
|
|
|
|
window.powerManagement.dim(function () {
|
|
|
|
|
console.log('Partial wakelock acquired');
|
|
|
|
|
}, function () {
|
|
|
|
|
console.log('Failed to acquire partial wakelock');
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
window.powerManagement.release(function () {
|
|
|
|
|
console.log('Wakelock released');
|
|
|
|
|
}, function () {
|
|
|
|
|
console.log('Failed to release wakelock');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
app.toast.show({
|
|
|
|
|
text: "This setting won't do anything on your device.",
|
|
|
|
|
position: "bottom",
|
|
|
|
|
destroyOnClose: true,
|
|
|
|
|
closeTimeout: 1000 * 10
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function pickAlertSound() {
|
|
|
|
|
var currentalertsound = localStorage.getItem("alertsound");
|
|
|
|
|
app.dialog.create({
|
|
|
|
@ -91,7 +120,7 @@ function pickMapSource() {
|
|
|
|
|
mapsource = "offline";
|
|
|
|
|
}
|
|
|
|
|
localStorage.setItem("mapsource", mapsource);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}).open();
|
|
|
|
|
}
|