2017-12-16 13:36:56 -07: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/. -->
2017-12-22 22:58:38 -07:00
< div class = "list-group" >
< div class = "list-group-item" >
< h4 > < i class = "fa fa-user" > < / i > < span id = "username" > Not logged in< / span > < / h4 >
< i class = "fa fa-key" > < / i > Pairing Code: < span id = "pairingkey" > None< / span > < br / >
< i class = "fa fa-server" > < / i > Server: < span id = "syncurl" > None< / span >
< / div >
2018-03-27 16:05:13 -06:00
< div class = "list-group-item" onclick = "openscreen('accounts', 'FADE');" >
< b > Manage and switch accounts< / b >
< / div >
2017-12-22 22:58:38 -07:00
< / div >
2017-06-16 18:47:16 -06:00
< div class = "list-group" >
2017-07-10 13:18:57 -06:00
< div class = "list-group-item" onclick = "updatepassword()" >
< b > Update Password< / b >
2017-07-21 02:22:53 -06:00
< p > Enter your new password if you changed it from AccountHub.< / p >
2017-07-10 13:18:57 -06:00
< / div >
2017-06-30 00:56:47 -06:00
< div class = "list-group-item" onclick = "deleteall()" >
2018-03-27 16:05:13 -06:00
< b > Disconnect All Accounts< / b >
< p > Forget all account data for all connected accounts and open the setup tool.< / p >
2017-07-10 13:18:57 -06:00
< / div >
< / div >
< div class = "list-group" >
< div class = "list-group-item" onclick = "toggleAnimations()" >
< b > Turn animations < span id = "animations_offon_label" > off< / span > < / b >
2017-07-10 13:48:15 -06:00
< p > Disable transitions and animations on slow devices or to save battery life.< / p >
2017-06-16 18:47:16 -06:00
< / div >
2017-06-30 00:56:47 -06:00
< / div >
2017-08-06 23:41:05 -06:00
< div class = "list-group" >
< div class = "list-group-item" onclick = "openscreen('zeroconf', 'FADE')" >
< b > Server Locator< / b >
< p > Scan the local network for Business Apps services.< / p >
< / div >
< / div >
2017-07-10 13:38:03 -06:00
< div class = "list-group" >
< div class = "list-group-item" >
2017-07-10 13:48:15 -06:00
< b > < span id = "app_name" > Netsyms Business Apps for Mobile< / span > v< span id = "app_version" > 1.x< / span > < / b >
< br / >
2018-03-27 17:59:35 -06:00
Copyright © 2018 Netsyms Technologies. Licensed under the < span style = "text-decoration: underline;" onclick = "window.open('https://source.netsyms.com/Business/MobileApp?pk_campaign=BusinessMobile-SystemBrowser', '_system', '');" > Mozilla Public License 2.0< / span > .
2017-07-10 13:38:03 -06:00
< br / >
2017-12-16 13:52:57 -07:00
< span style = "text-decoration: underline;" onclick = "window.open('https://netsyms.com/?pk_campaign=BusinessMobile-SystemBrowser', '_system', '');" > https://netsyms.com< / span >
2017-07-10 13:38:03 -06:00
< br / >
< span id = "app_package" > com.netsyms.BusinessMobile< / span >
< br / >
build #< span id = "app_version_code" > 1xxxx< / span >
< / div >
2017-07-10 13:48:15 -06:00
< div class = "list-group-item" onclick = "openscreen('credits', 'FADE')" >
< b > Credits and Open Source< / b >
< / div >
2017-12-09 18:27:25 -07:00
< div class = "list-group-item" onclick = "cordova.InAppBrowser.open('https://netsyms.biz/mobile-privacy-policy', '_blank', 'location=yes');" >
2017-07-10 13:48:15 -06:00
< b > Privacy Policy< / b >
< / div >
2017-07-10 13:38:03 -06:00
< / div >
2017-06-30 00:56:47 -06:00
< script >
setnavbar("settings");
function deleteall() {
2017-12-09 21:46:05 -07:00
navigator.notification.confirm("Really wipe user data? You will need to resync the app with AccountHub to use it again. This will not delete 2-factor auth keys.", function (result) {
2017-07-10 13:18:57 -06:00
if (result != 1) {
return;
}
// Wipe localStorage
localStorage.removeItem("username");
2017-12-09 21:46:05 -07:00
localStorage.removeItem("password");
2017-10-13 19:45:15 -06:00
localStorage.removeItem("syncurl");
2017-07-10 13:18:57 -06:00
localStorage.removeItem("key");
2018-03-27 16:05:13 -06:00
localStorage.removeItem("accounts");
2018-10-22 13:44:26 -06:00
NativeStorage.remove("accounts", function () {
// force-reload app
navigator.notification.alert("All connection data and credentials erased.", function () {
restartApplication();
}, "App Reset", 'Continue');
});
2017-07-10 13:18:57 -06:00
}, "Are you sure?");
2017-06-30 00:56:47 -06:00
}
2017-07-10 13:18:57 -06:00
function toggleAnimations() {
if (localStorage.getItem("animations") === null || localStorage.getItem("animations") === "true") {
localStorage.setItem("animations", "false");
$.fx.off = true;
$('#animations_offon_label').text("on");
navigator.notification.alert("Animations turned off.", null, "Setting updated", "Dismiss");
} else {
localStorage.setItem("animations", "true");
$.fx.off = false;
$('#animations_offon_label').text("off");
navigator.notification.alert("Animations turned on.", null, "Setting updated", "Dismiss");
}
}
/**
2018-03-27 16:05:13 -06:00
* Prompts the user to enter their password, then checks the password and
2017-07-10 13:18:57 -06:00
* saves or displays an error.
* @returns {undefined}
*/
function updatepassword() {
navigator.notification.prompt("Re-enter your password.", function (results) {
if (results.buttonIndex == 1) {
2017-10-13 19:45:15 -06:00
$.post(localStorage.getItem("syncurl"), {
2017-07-10 13:18:57 -06:00
username: localStorage.getItem("username"),
key: localStorage.getItem("key"),
password: results.input1,
action: "check_password"
}, function (data) {
if (data.status === 'OK') {
localStorage.setItem("password", results.input1);
2018-03-27 16:05:13 -06:00
passwd(results.input1);
2017-07-10 13:18:57 -06:00
navigator.notification.alert("Saved password updated.", function () {
// Reload app just to be safe
restartApplication();
}, "Success", 'Continue');
} else {
navigator.notification.alert(data.msg, null, "Error", 'Dismiss');
}
}, "json").fail(function () {
navigator.notification.alert("Could not connect to the server. Try again later.", null, "Error", 'Dismiss');
});
}
}, "Update Password", ["Save", "Cancel"]);
}
2017-07-10 13:38:03 -06:00
2017-07-10 13:18:57 -06:00
if (localStorage.getItem("animations") === "false") {
$('#animations_offon_label').text("on");
}
2017-07-10 13:48:15 -06:00
2017-07-10 13:38:03 -06:00
cordova.getAppVersion.getVersionNumber(function (version) {
$('#app_version').text(version);
});
cordova.getAppVersion.getPackageName(function (package) {
$('#app_package').text(package);
});
cordova.getAppVersion.getVersionCode(function (version) {
$('#app_version_code').text(version);
});
2018-03-27 16:05:13 -06:00
2017-12-22 22:58:38 -07:00
if (localStorage.getItem("username")) {
$("#username").text(localStorage.getItem("username"));
}
if (localStorage.getItem("key")) {
var key = localStorage.getItem("key");
var stars = "";
for (var i = 0; i < key.length - 6 ; i + + ) {
stars += "*";
}
$("#pairingkey").text(key.slice(0, 3) + stars + key.slice(-3));
}
if (localStorage.getItem("syncurl")) {
$("#syncurl").text(localStorage.getItem("syncurl").replace("/mobile/index.php", ""));
}
2017-06-30 00:56:47 -06:00
< / script >