From 403bd587abc92395f9245c2de1adf72197179167 Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Mon, 26 Oct 2015 16:24:16 -0400 Subject: normalized how save works - except no auto save for login --- .DS_Store | Bin 12292 -> 14340 bytes resources/.DS_Store | Bin 10244 -> 10244 bytes resources/ios/.DS_Store | Bin 6148 -> 6148 bytes www/external/android-notification-icons/.DS_Store | Bin 0 -> 8196 bytes www/js/DevOptionsCtrl.js | 20 +++++++++++++++++++- www/js/LoginCtrl.js | 22 ++++++++++++++++++++-- www/templates/devoptions.html | 10 ++++++---- www/templates/eventserversettings.html | 7 +++++-- www/templates/login.html | 8 +++++--- 9 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 www/external/android-notification-icons/.DS_Store diff --git a/.DS_Store b/.DS_Store index 7cda5d2a..5e3d43ae 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/resources/.DS_Store b/resources/.DS_Store index 5ec845ea..d446f978 100644 Binary files a/resources/.DS_Store and b/resources/.DS_Store differ diff --git a/resources/ios/.DS_Store b/resources/ios/.DS_Store index 6295acec..d0ea94a6 100644 Binary files a/resources/ios/.DS_Store and b/resources/ios/.DS_Store differ diff --git a/www/external/android-notification-icons/.DS_Store b/www/external/android-notification-icons/.DS_Store new file mode 100644 index 00000000..a6cabb45 Binary files /dev/null and b/www/external/android-notification-icons/.DS_Store differ diff --git a/www/js/DevOptionsCtrl.js b/www/js/DevOptionsCtrl.js index e474c6ac..129b84fa 100644 --- a/www/js/DevOptionsCtrl.js +++ b/www/js/DevOptionsCtrl.js @@ -24,6 +24,17 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' $state.go("events", {"id": 0}, { reload: true }); } }; + + + //---------------------------------------------------------------- + // Save anyway when you exit + //---------------------------------------------------------------- + + $scope.$on('$ionicView.beforeLeave', function () { + saveDevOptions(); + + + }); //------------------------------------------------------------------------- // Lets make sure we set screen dim properly as we enter @@ -40,7 +51,9 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' //------------------------------------------------------------------ // Perform the login action when the user submits the login form //------------------------------------------------------------------ - $scope.saveDevOptions = function () { + + function saveDevOptions() + { ZMDataModel.zmDebug("SaveDevOptions: called"); if (parseInt($scope.loginData.maxMontage) > zm.safeMontageLimit) { @@ -80,6 +93,11 @@ angular.module('zmApp.controllers').controller('zmApp.DevOptionsCtrl', ['$scope' }).then(function (res) { $ionicSideMenuDelegate.toggleLeft(); }); + } + + $scope.saveDevOptions = function () { + saveDevOptions(); + }; //------------------------------------------------------------------ // controller main diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index a0112969..388ee33a 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -31,9 +31,21 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r $scope.check.isUseEventServer = ($scope.loginData.isUseEventServer == '1') ? true : false; + + //---------------------------------------------------------------- + // Save anyway when you exit + //---------------------------------------------------------------- + + $scope.$on('$ionicView.beforeLeave', function () { + // Don't do this -- it will try to login to ZM + // and go back to the menu + //saveItems(); + }); + + //------------------------------------------------------------------------- // Lets make sure we set screen dim properly as we enter // The problem is we enter other states before we leave previous states @@ -134,8 +146,10 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r //----------------------------------------------------------------------------- // Perform the login action when the user submits the login form //----------------------------------------------------------------------------- - $scope.save = function () { - console.log('Saving login'); + + function saveItems() + { + console.log('Saving login'); /*if (parseInt($scope.loginData.maxMontage) > zm.safeMontageLimit) { $ionicPopup.alert({ @@ -270,6 +284,10 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r }); + } + + $scope.saveItems = function () { + saveItems(); }; diff --git a/www/templates/devoptions.html b/www/templates/devoptions.html index 5b1d2936..78c5dbbb 100644 --- a/www/templates/devoptions.html +++ b/www/templates/devoptions.html @@ -1,10 +1,14 @@ - + + + + + @@ -59,9 +63,7 @@ toggle-class="toggle-calm">Persist hidden monitors - + diff --git a/www/templates/eventserversettings.html b/www/templates/eventserversettings.html index 68e9f1be..65b9affc 100644 --- a/www/templates/eventserversettings.html +++ b/www/templates/eventserversettings.html @@ -10,8 +10,11 @@ - - + + +
+ Please make sure your ZM settings are configured and saved before you configure the event server +
use event server
-- cgit v1.2.3