summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rwxr-xr-xwww/js/DataModel.js448
-rw-r--r--www/js/LoginCtrl.js43
-rwxr-xr-xwww/js/app.js18
-rw-r--r--www/lang/locale-en.json3
-rw-r--r--www/templates/login.html7
5 files changed, 337 insertions, 182 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index 848824d5..e6df5e3c 100755
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -178,6 +178,7 @@ angular.module('zmApp.controllers')
'loginAPISupported': false,
'montageResizeSteps': 5,
'currentServerVersion': '',
+ 'saveToCloud': true
};
@@ -293,7 +294,7 @@ angular.module('zmApp.controllers')
}
}
-
+
function getZmsMultiPortSupport(forceReload) {
var d = $q.defer();
@@ -309,13 +310,12 @@ angular.module('zmApp.controllers')
configParams.ZM_MIN_STREAMING_PORT = data.config.Value;
setCurrentServerMultiPortSupported(true);
log("Got min streaming port value of: " + configParams.ZM_MIN_STREAMING_PORT);
- }
- else {
+ } else {
setCurrentServerMultiPortSupported(false);
log("ZM_MIN_STREAMING_PORT not configure, disabling");
configParams.ZM_MIN_STREAMING_PORT = 0;
}
-
+
d.resolve(configParams.ZM_MIN_STREAMING_PORT);
return (d.promise);
@@ -353,7 +353,7 @@ angular.module('zmApp.controllers')
if (loginData.currentServerVersion && (versionCompare(loginData.currentServerVersion, zm.versionWithLoginAPI) != -1 || loginData.loginAPISupported)) {
myurl = loginData.apiurl + '/host/getCredentials.json';
- debug("Server version " + loginData.currentServerVersion+ " > 1.31.41, so using getCredentials API:" + myurl);
+ debug("Server version " + loginData.currentServerVersion + " > 1.31.41, so using getCredentials API:" + myurl);
$http.get(myurl)
.then(function (s) {
@@ -519,7 +519,7 @@ angular.module('zmApp.controllers')
//var d = $q.defer();
// if we are here, we should remove cache
-
+
loginData = angular.copy(newLogin);
serverGroupList[loginData.serverName] = angular.copy(loginData);
@@ -528,24 +528,24 @@ angular.module('zmApp.controllers')
//debug ("Crypto is: " + ct);
- localforage.setItem("serverGroupList", ct)
- .then(function () {
- debug ("saving serverGroupList worked");
+ return localforage.setItem("serverGroupList", ct)
+ .then(function () {
+
return localforage.setItem("defaultServerName", loginData.serverName);
- })
- .then (function () {
- debug ("saving defaultServerName worked");
+ })
+ .then(function () {
+ //debug("saving defaultServerName worked");
return localforage.removeItem("settings-temp-data");
- })
- .then (function() {
- debug ("removing settings-temp-data worked");
- })
- .catch(function (err) {
+ })
+
+ .catch(function (err) {
log("SetLogin localforage store error " + JSON.stringify(err));
});
-
+
+
+
}
//credit: https://gist.github.com/alexey-bass/1115557
@@ -624,7 +624,7 @@ angular.module('zmApp.controllers')
},
isMultiPortDisabled: function () {
- return loginData.disableSimulStreaming;
+ return loginData.disableSimulStreaming;
},
getCurrentServerVersion: function () {
@@ -815,11 +815,130 @@ angular.module('zmApp.controllers')
},
- init: function () {
- // console.log("****** DATAMODEL INIT SERVICE CALLED ********");
+ cloudSync: function () {
+
+ var d = $q.defer();
+ if (!window.cordova) {
+ log("Cloud settings plugin not found, skipping cloud sync...");
+ d.resolve(true);
+ return d.promise;
+ }
+
+ window.cordova.plugin.cloudsettings.enableDebug(function(){
+ console.log("Debug mode enabled");
+ });
+
+ log("CloudSync: Syncing with cloud if enabled...");
+
+ var sgl = "";
+ var decodedSgl = "";
+ var dsn = "";
+
+ localforage.getItem("serverGroupList")
+ .then(function (_sgl) {
+ sgl = _sgl;
+ return localforage.getItem("defaultServerName");
+ })
+ .then(function (_dsn) {
+ dsn = _dsn;
+ return true;
+ })
+ .then(function () {
+ if (sgl && dsn) {
+
+ if (typeof sgl == 'string') {
+ log("user profile encrypted, decoding...");
+ var bytes = CryptoJS.AES.decrypt(sgl.toString(), zm.cipherKey);
+ decodedSgl = JSON.parse(bytes.toString(CryptoJS.enc.Utf8));
+
+ }
+ else {
+ decodedSgl = sgl;
+ }
+
+
+ var loadedData = decodedSgl[dsn];
+
+ if (!isEmpty(loadedData)) {
+
+ if (!loadedData.saveToCloud) {
+ log ("Cloud sync is disabled, exiting...");
+ d.resolve(true);
+ return d.promise;
+ }
+ }
+ log("Found valid local configuration, overwriting cloud settings...");
+ //console.log (">>>>>>>>>>>>>>SAVING: " + sgl + dsn);
+ window.cordova.plugin.cloudsettings.save({
+ 'serverGroupList': sgl,
+ 'defaultServerName': dsn
+ },
+ function () {
+ log("local data synced with cloud...");
+ d.resolve(true);
+ return d.promise;
+ },
+ function () {
+ log("error syncing cloud data...");
+ d.resolve(true);
+ return d.promise;
+ }, true);
+
+ }
+ // bad or missing local config
+ else {
+ log("Did not find a valid local configuration, trying cloud...");
+
+ window.cordova.plugin.cloudsettings.exists(function (exists) {
+ log ("A cloud configuration has been found");
+ if (exists) {
+ window.cordova.plugin.cloudsettings.load(function (cloudData) {
+ console.log ("CLOUD DATA FOUND"+JSON.stringify(cloudData));
+ if (cloudData && cloudData.defaultServerName && cloudData.serverGroupList) {
+ log("retrieved a valid cloud config with a defaultServerName of:"+cloudData.defaultServerName);
+ log("replacing local DB with cloud...");
+ localforage.setItem('isFirstUse', false)
+ .then(function () {
+ log("cleared first use");
+ return localforage.setItem("defaultServerName", cloudData.defaultServerName);
+ })
+ .then(function () {
+ log("saved defaultServerName");
+ return localforage.setItem("serverGroupList", cloudData.serverGroupList);
+ })
+ .then(function () {
+ log("saved serverGroupList, returning from cloudSync()");
+ d.resolve(true);
+ return d.promise;
+ });
+
+
+ }
+ // cloud did not have (useable)data
+ else {
+ log("Did not find a valid cloud config");
+ d.resolve(true);
+ return d.promise;
+ }
+
+ });
+ } else {
+ log("Cloud data does not exist");
+ d.resolve(true);
+ return d.promise;
+ }
+ });
+
+ }
+ });
+
+ return d.promise;
+ },
+ init: function () {
+ // console.log("****** DATAMODEL INIT SERVICE CALLED ********")
log("ZMData init: checking for stored variables & setting up log file");
@@ -858,29 +977,6 @@ angular.module('zmApp.controllers')
$ionicLoading.hide();
serverGroupList = decodedVal;
- // console.log(">>>> DECRYPTED serverGroupList " + JSON.stringify(serverGroupList));
- var demoServer = "{\"serverName\":\"zmNinjaDemo\",\"username\":\"zmninja\",\"password\":\"zmNinja$xc129\",\"url\":\"https://demo.zoneminder.com/zm\",\"apiurl\":\"https://demo.zoneminder.com/zm/api\",\"eventServer\":\"\",\"maxMontage\":\"40\",\"streamingurl\":\"https://demo.zoneminder.com/cgi-bin-zm\",\"maxFPS\":\"3\",\"montageQuality\":\"50\",\"singleImageQuality\":\"100\",\"montageHistoryQuality\":\"50\",\"useSSL\":true,\"keepAwake\":true,\"isUseAuth\":\"1\",\"isUseEventServer\":false,\"disablePush\":false,\"eventServerMonitors\":\"\",\"eventServerInterval\":\"\",\"refreshSec\":\"2\",\"enableDebug\":false,\"usePin\":false,\"pinCode\":\"\",\"canSwipeMonitors\":true,\"persistMontageOrder\":false,\"onTapScreen\":\"Events\",\"enableh264\":true,\"gapless\":false,\"montageOrder\":\"\",\"montageHiddenOrder\":\"\",\"montageArraySize\":\"0\",\"graphSize\":2000,\"enableAlarmCount\":true,\"montageSize\":\"3\",\"useNphZms\":true,\"useNphZmsForEvents\":true,\"packMontage\":false,\"exitOnSleep\":false,\"forceNetworkStop\":false,\"defaultPushSound\":false,\"enableBlog\":true,\"use24hr\":false, \"packeryPositions\":\"\"}";
- var demoS = JSON.parse(demoServer);
- //console.log("JSON parsed demo" + JSON.stringify(demoS));
-
- var isFoundDemo = false;
- var as = Object.keys(serverGroupList);
- for (var x = 0; x < as.length; x++) {
- if (as[x] == 'zmNinjaDemo')
- isFoundDemo = true;
- //console.log ("************ FOUND SERVER NAME " + as[x]);
- // if serverGroupList[x]
- }
-
- // Don't add the demo if there is another server
- // because this means the user deleted it
-
- if (!isFoundDemo && as.length == 0) {
- debug("Pushing demo server config to server groups");
- //serverGroupList.push(demoS);
- serverGroupList[demoS.serverName] = angular.copy(demoS);
- }
-
var sname;
$ionicLoading.show({
template: $translate.instant('kRetrievingProfileData'),
@@ -1315,6 +1411,12 @@ angular.module('zmApp.controllers')
}
+ if (typeof loginData.saveToCloud == 'undefined') {
+
+ loginData.saveToCloud = true;
+
+ }
+
loginData.canSwipeMonitors = true;
loginData.forceImageModePath = false;
@@ -1531,10 +1633,14 @@ angular.module('zmApp.controllers')
//localforage.setItem("isFirstUse", val,
// function(err) {if (err) log ("localforage error, //storing isFirstUse: " + JSON.stringify(err));});
isFirstUse = val;
- debug ("Setting isFirstUse to:"+val);
+ debug("Setting isFirstUse to:" + val);
localforage.setItem("isFirstUse", val)
- .then (function (succ) { debug ("Saved isFirstUse ok");})
- .catch (function (err) { debug ("Error Saving isFirstUse:" + JSON.stringify(err));});
+ .then(function (succ) {
+ debug("Saved isFirstUse ok");
+ })
+ .catch(function (err) {
+ debug("Error Saving isFirstUse:" + JSON.stringify(err));
+ });
//console.log (">>>>>>setting isFirstUse to " + val);
},
@@ -1594,12 +1700,12 @@ angular.module('zmApp.controllers')
$http.get(apiurl)
.then(function (success) {
if (success.data.version) {
- // console.log ("API VERSION RETURNED: " + JSON.stringify(success));
+ // console.log ("API VERSION RETURNED: " + JSON.stringify(success));
$rootScope.apiValid = true;
setCurrentServerVersion(success.data.version);
d.resolve(success.data.version);
} else {
- debug ("Setting APIValid to false as API version was not retrieved");
+ debug("Setting APIValid to false as API version was not retrieved");
$rootScope.apiValid = false;
setCurrentServerVersion("");
d.reject("-1.-1.-1");
@@ -1628,30 +1734,30 @@ angular.module('zmApp.controllers')
var myurl = loginData.url;
log("Checking if reCaptcha is enabled in ZM...");
-// console.log ("Recaptcha: "+myurl);
+ // console.log ("Recaptcha: "+myurl);
$http.get(myurl)
.then(function (success) {
- // console.log ("Inside recaptcha success");
- if (success.data.search("g-recaptcha") != -1) {
- // recaptcha enable. zmNinja won't work
- log("ZM has recaptcha enabled", "error");
- displayBanner('error', ['Recaptcha must be disabled in Zoneminder', $rootScope.appName + ' will not work with recaptcha'], "", 8000);
- d.resolve(true);
- return (d.promise);
+ // console.log ("Inside recaptcha success");
+ if (success.data.search("g-recaptcha") != -1) {
+ // recaptcha enable. zmNinja won't work
+ log("ZM has recaptcha enabled", "error");
+ displayBanner('error', ['Recaptcha must be disabled in Zoneminder', $rootScope.appName + ' will not work with recaptcha'], "", 8000);
+ d.resolve(true);
+ return (d.promise);
- } else {
+ } else {
+ d.resolve(false);
+ log("ZM has recaptcha disabled - good");
+ return (d.promise);
+ }
+ },
+ function (err) {
+ // for whatever reason recaptcha check failed
+ // console.log ("Inside recaptcha fail");
d.resolve(false);
- log("ZM has recaptcha disabled - good");
- return (d.promise);
- }
- },
- function (err) {
- // for whatever reason recaptcha check failed
- // console.log ("Inside recaptcha fail");
- d.resolve(false);
log("Recaptcha failed, but assuming ZM has recaptcha disabled");
return (d.promise);
- });
+ });
return (d.promise);
},
@@ -1926,7 +2032,7 @@ angular.module('zmApp.controllers')
debug("Monitor URL to fetch is:" + myurl);
$http.get(myurl /*,{timeout:15000}*/ )
.success(function (data) {
- // console.log("HTTP success got " + JSON.stringify(data.monitors));
+ // console.log("HTTP success got " + JSON.stringify(data.monitors));
monitors = data.monitors;
@@ -2163,55 +2269,52 @@ angular.module('zmApp.controllers')
},
- zmPrivacyProcessed: function() {
+ zmPrivacyProcessed: function () {
var apiurl = loginData.apiurl;
var myurl = apiurl + '/configs/viewByName/ZM_SHOW_PRIVACY.json';
var d = $q.defer();
$http({
- url: myurl,
- method: 'GET',
- transformResponse: undefined
- })
- // $http.get(myurl)
- .then (function (textsucc) {
-
- var succ;
- try {
- console.log (textsucc);
- succ = JSON.parse(textsucc.data);
- if (succ.data) succ = succ.data;
- if (succ.config) {
- if (succ.config.Value=='1') {
- debug ("Real value of PRIVACY is:"+succ.config.Value);
- d.resolve(false);
- }
- else {
- debug ("Real value of PRIVACY is:"+succ.config.Value);
+ url: myurl,
+ method: 'GET',
+ transformResponse: undefined
+ })
+ // $http.get(myurl)
+ .then(function (textsucc) {
+
+ var succ;
+ try {
+ console.log(textsucc);
+ succ = JSON.parse(textsucc.data);
+ if (succ.data) succ = succ.data;
+ if (succ.config) {
+ if (succ.config.Value == '1') {
+ debug("Real value of PRIVACY is:" + succ.config.Value);
+ d.resolve(false);
+ } else {
+ debug("Real value of PRIVACY is:" + succ.config.Value);
+ d.resolve(true);
+ }
+ return d.promise;
+ } else {
+ debug("ZM_SHOW_PRIVACY likely does not exist");
d.resolve(true);
+ return d.promise;
}
- return d.promise;
- }
- else {
- debug ("ZM_SHOW_PRIVACY likely does not exist");
+
+ } catch (e) {
+ debug("ZM_SHOW_PRIVACY parsing error, assuming it doesn't exist");
d.resolve(true);
return d.promise;
}
-
- }
- catch (e) {
- debug ("ZM_SHOW_PRIVACY parsing error, assuming it doesn't exist");
+
+ },
+ function (err) {
+ debug("ZM_SHOW_PRIVACY returned an error, it likely doesn't exist");
d.resolve(true);
return d.promise;
- }
- },
- function (err) {
- debug ("ZM_SHOW_PRIVACY returned an error, it likely doesn't exist");
- d.resolve(true);
- return d.promise;
-
- });
+ });
return d.promise;
},
@@ -2604,11 +2707,11 @@ angular.module('zmApp.controllers')
configureStorageDB: function () {
- debug ("Inside configureStorageDB");
+ debug("Inside configureStorageDB");
var d = $q.defer();
localforage.config({
name: zm.dbName
-
+
});
if ($rootScope.platformOS == 'ios') {
@@ -2626,61 +2729,60 @@ angular.module('zmApp.controllers')
];
}
- debug ("configureStorageDB: trying order:" + JSON.stringify(order));
-
+ debug("configureStorageDB: trying order:" + JSON.stringify(order));
+
localforage.defineDriver(window.cordovaSQLiteDriver).then(function () {
- return localforage.setDriver(
- // Try setting cordovaSQLiteDriver if available,
- // for desktops, it will pick the next one
- order
- );
- })
- .then ( function (succ) {
- log("configureStorageDB:localforage driver for storage:" + localforage.driver());
- debug ("configureStorageDB:Making sure this storage driver works...");
- return localforage.setItem('testPromiseKey', 'testPromiseValue');
- })
- .then (function (succ) {
- return localforage.getItem('testPromiseKey');
- })
- .then (function (succ) {
- if (succ != 'testPromiseValue') {
- log ("configureStorageDB:this driver could not restore a test val, reverting to localstorage and hoping for the best...");
- return forceLocalStorage();
- }
- else {
- debug ("configureStorageDB:test get/set worked, this driver is ok...");
- d.resolve(true);
- return d.promise;
- }
- })
- .catch (function (err) {
- log ("configureStorageDB:this driver errored, reverting to localstorage and hoping for the best...: " + JSON.stringify(err));
- return forceLocalStorage();
- });
-
+ return localforage.setDriver(
+ // Try setting cordovaSQLiteDriver if available,
+ // for desktops, it will pick the next one
+ order
+ );
+ })
+ .then(function (succ) {
+ log("configureStorageDB:localforage driver for storage:" + localforage.driver());
+ debug("configureStorageDB:Making sure this storage driver works...");
+ return localforage.setItem('testPromiseKey', 'testPromiseValue');
+ })
+ .then(function (succ) {
+ return localforage.getItem('testPromiseKey');
+ })
+ .then(function (succ) {
+ if (succ != 'testPromiseValue') {
+ log("configureStorageDB:this driver could not restore a test val, reverting to localstorage and hoping for the best...");
+ return forceLocalStorage();
+ } else {
+ debug("configureStorageDB:test get/set worked, this driver is ok...");
+ d.resolve(true);
+ return d.promise;
+ }
+ })
+ .catch(function (err) {
+ log("configureStorageDB:this driver errored, reverting to localstorage and hoping for the best...: " + JSON.stringify(err));
+ return forceLocalStorage();
+ });
+
return d.promise;
function forceLocalStorage() {
- // var d = $q.defer();
- localforage.setDriver (localforage.LOCALSTORAGE)
- .then (function (succ) {
- log ("configureStorageDB:localforage forced setting to localstorage returned a driver of: " + localforage.driver());
- d.resolve(true);
- return d.promise;
- },
- function (err) {
- log ("*** configureStorageDB: Error setting localStorage too, zmNinja WILL NOT SAVE ***");
- log ("*** configureStorageDB: Dance, rejoice, keep re-configuring everytime you run ***");
- d.resolve(true);
- return d.promise;
- });
+ // var d = $q.defer();
+ localforage.setDriver(localforage.LOCALSTORAGE)
+ .then(function (succ) {
+ log("configureStorageDB:localforage forced setting to localstorage returned a driver of: " + localforage.driver());
+ d.resolve(true);
+ return d.promise;
+ },
+ function (err) {
+ log("*** configureStorageDB: Error setting localStorage too, zmNinja WILL NOT SAVE ***");
+ log("*** configureStorageDB: Dance, rejoice, keep re-configuring everytime you run ***");
+ d.resolve(true);
+ return d.promise;
+ });
return d.promise;
}
- },
+ },
getBaseURL: function (id) {
var idnum = parseInt(id);
@@ -2701,39 +2803,41 @@ angular.module('zmApp.controllers')
$ionicLoading.show({
template: $translate.instant('kCleaningUp'),
noBackdrop: true,
-
- });
+
+ });
var d = $q.defer();
log(loginData.url + "=>Logging out of any existing ZM sessions...");
$rootScope.authSession = "undefined";
- console.log ("CURRENT SERVER: "+loginData.currentServerVersion);
+ console.log("CURRENT SERVER: " + loginData.currentServerVersion);
if (loginData.currentServerVersion && (versionCompare(loginData.currentServerVersion, zm.versionWithLoginAPI) != -1 || loginData.loginAPISupported)) {
- debug ("Logging out using API method");
- $http.get(loginData.apiurl+'/host/logout.json',{timeout: 7000})
- .then (function(s) {
- debug ("Logout returned... ");
- d.resolve(true);
- $ionicLoading.hide();
- return d.promise;
- },
- function (e) {
- debug ("Logout errored but really don't worry, your ZM version may not support it");
- $ionicLoading.hide();
- d.resolve(true);
- return d.promise;
- }
- );
- return d.promise;
+ debug("Logging out using API method");
+ $http.get(loginData.apiurl + '/host/logout.json', {
+ timeout: 7000
+ })
+ .then(function (s) {
+ debug("Logout returned... ");
+ d.resolve(true);
+ $ionicLoading.hide();
+ return d.promise;
+ },
+ function (e) {
+ debug("Logout errored but really don't worry, your ZM version may not support it");
+ $ionicLoading.hide();
+ d.resolve(true);
+ return d.promise;
+ }
+ );
+ return d.promise;
}
// old logout mode
- debug ("Logging out using Web method");
+ debug("Logging out using Web method");
$http({
method: 'POST',
timeout: 7000,
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index 14b8d511..793d28cf 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -573,6 +573,49 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
//console.log ("SAVING: "+JSON.stringify($scope.loginData));
NVRDataModel.setLogin($scope.loginData);
+
+ if ($rootScope.platformOS != 'desktop') {
+
+ if ($scope.loginData.saveToCloud) {
+ NVRDataModel.debug ("writing data to cloud");
+
+ var serverGroupList = NVRDataModel.getServerGroups();
+ serverGroupList[$scope.loginData.serverName] = angular.copy($scope.loginData);
+
+ var ct = CryptoJS.AES.encrypt(JSON.stringify(serverGroupList), zm.cipherKey).toString();
+
+ window.cordova.plugin.cloudsettings.save({
+ 'serverGroupList': ct,
+ 'defaultServerName': $scope.loginData.serverName
+ },
+ function () {
+ NVRDataModel.debug("local data synced with cloud...");
+
+ },
+ function () {
+ NVRDataModel.debug("error syncing cloud data...");
+
+ }, true);
+
+ }
+ else {
+ NVRDataModel.debug ("Clearing cloud settings...");
+ window.cordova.plugin.cloudsettings.save({
+ },
+ function () {
+ NVRDataModel.debug("cloud data cleared");
+
+ },
+ function (err) {
+ NVRDataModel.debug("error clearing cloud data: " + err);
+
+ }, true);
+ }
+
+
+ }
+
+
$rootScope.runMode = NVRDataModel.getBandwidth();
oldName = $scope.loginData.serverName;
diff --git a/www/js/app.js b/www/js/app.js
index 9d88362d..3b907780 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -111,7 +111,8 @@ angular.module('zmApp', [
eventServerErrorDelay: 5000, // time to wait till I report initial connect errors
zmVersionCheckNag: 60 * 24, // in hrs
waitTimeTillResume: 5, // in sec, for ES error
- versionWithLoginAPI: "1.31.45"
+ versionWithLoginAPI: "1.31.45",
+ androidBackupKey: "AEdPqrEAAAAIqF-OaHdwIzZhx2L1WOfAGTagBxm5a1R4wBW_Uw"
})
@@ -1807,11 +1808,12 @@ angular.module('zmApp', [
//console.log("localforage config");
NVRDataModel.configureStorageDB()
- .then(function () {
+ .then (function () {NVRDataModel.log ("localforage driver:"+localforage.driver()); return NVRDataModel.cloudSync(); } )
+ .then(function () {
// this should alert "cordovaSQLiteDriver" when in an emulator or a device
- NVRDataModel.log("localforage driver for storage:" + localforage.driver());
-
+
// Now lets import old data if it exists:
+ NVRDataModel.log ("Cloudsync operation complete, continuing...");
var defaultServerName = $localstorage.get("defaultServerName");
localforage.getItem("defaultServerName")
@@ -1979,7 +1981,7 @@ angular.module('zmApp', [
NVRDataModel.log("First time detected ");
$state.go("app.first-use");
return;
- //continueRestOfInit();
+
} else {
continueRestOfInit();
}
@@ -2028,14 +2030,10 @@ angular.module('zmApp', [
function loadServices() {
NVRDataModel.log("Language file loaded, continuing with rest");
NVRDataModel.init();
-
-
zmCheckUpdates.start();
NVRDataModel.log("Setting up POST LOGIN timer");
zmAutoLogin.start();
- setupPauseAndResume();
-
-
+ setupPauseAndResume();
}
diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json
index 33197246..6674bd9b 100644
--- a/www/lang/locale-en.json
+++ b/www/lang/locale-en.json
@@ -312,6 +312,9 @@
"kRetrievingProfileData" :"retrieving profile data",
"kSave" :"Save",
"kSavingSnapshot" :"saving snapshot",
+ "kSaveToCloud" :"sync with cloud",
+ "kSaveToCloudIOS" :"saves settings to your personal iCloud account",
+ "kSaveToCloudANDROID" :"saves settings via Android's Backup Service. May take several hours to sync",
"kScore" :"score",
"kScrub" :"Scrub",
"kSearch" :"search",
diff --git a/www/templates/login.html b/www/templates/login.html
index e3c6e6fc..8fbd1dc3 100644
--- a/www/templates/login.html
+++ b/www/templates/login.html
@@ -16,6 +16,13 @@
</label>
</div>
<label>
+
+ <ion-toggle ng-if="$root.platformOS != 'desktop'" ng-model="loginData.saveToCloud" toggle-class="toggle-calm">
+ <span class="item-text-wrap">{{'kSaveToCloud'|translate}}</span>
+ <p ng-if="$root.platformOS=='ios'"> <span class="item-text-wrap">{{'kSaveToCloudIOS' | translate}}</span></p>
+ <p ng-if="$root.platformOS=='android'"> <span class="item-text-wrap">{{'kSaveToCloudANDROID' | translate}}</span></p>
+ </ion-toggle>
+
<ion-toggle ng-model="loginData.enableLowBandwidth" toggle-class="toggle-calm">
<span class="item-text-wrap">{{'kLowBandwidth'|translate}}</span>
</ion-toggle>