diff options
| -rw-r--r-- | www/js/DataModel.js | 18 | ||||
| -rw-r--r-- | www/js/EventServer.js | 26 | ||||
| -rw-r--r-- | www/js/EventServerSettingsCtrl.js | 633 | ||||
| -rw-r--r-- | www/js/LoginCtrl.js | 4 | ||||
| -rw-r--r-- | www/lang/locale-en.json | 4 | ||||
| -rw-r--r-- | www/templates/eventserversettings.html | 15 |
6 files changed, 369 insertions, 331 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 736312d1..328df81a 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -101,7 +101,9 @@ angular.module('zmApp.controllers') 'language': 'en', 'reachability': true, 'forceImageModePath': false, - 'disableNative': false + 'disableNative': false, + 'vibrateOnPush': true, + 'soundOnPush': true @@ -663,6 +665,18 @@ angular.module('zmApp.controllers') loginData.disableNative = false; } + + if (typeof loginData.vibrateOnPush == 'undefined') { + zmDebug("vibrate on push not found, setting to true"); + loginData.vibrateOnPush = true; + + } + + if (typeof loginData.soundOnPush == 'undefined') { + zmDebug("sound on push not found, setting to true"); + loginData.soundOnPush = true; + + } zmLog("DataModel init recovered this loginData as " + JSON.stringify(loginData)); @@ -883,7 +897,7 @@ angular.module('zmApp.controllers') }, function (error) { zmDebug("getAPIversion error handler " + JSON.stringify(error)); - d.resolve("0.0.0"); + d.reject("-1.-1.-1"); return (d.promise); }); return (d.promise); diff --git a/www/js/EventServer.js b/www/js/EventServer.js index 1c214770..7504a3af 100644 --- a/www/js/EventServer.js +++ b/www/js/EventServer.js @@ -68,6 +68,8 @@ angular.module('zmApp.controllers') var d = $q.defer(); var loginData = ZMDataModel.getLogin(); + + console.log ("INIT GOT " + JSON.stringify(loginData)); if (loginData.isUseEventServer == false || !loginData.eventServer) { ZMDataModel.zmLog("No Event Server present. Not initializing"); @@ -75,7 +77,7 @@ angular.module('zmApp.controllers') return d.promise; } - if (!$rootScope.apnsToken) + //if (!$rootScope.apnsToken) pushInit(); @@ -233,6 +235,10 @@ angular.module('zmApp.controllers') //-------------------------------------------------------------------------- // Send an arbitrary object to the Event Serve // currently planned to use it for device token + // isForce =1 when you need to send the message even + // if config says ES is off. This may happen when + // you turn off ES and then we need sendMessage to + // let ZMES know not to send us messages //-------------------------------------------------------------------------- function sendMessage(type, obj, isForce) { var ld = ZMDataModel.getLogin(); @@ -321,11 +327,11 @@ angular.module('zmApp.controllers') } function pushInit() { - ZMDataModel.zmLog("Setting up push registration"); + ZMDataModel.zmLog(">>>Setting up push registration"); var push; var mediasrc; var media; - + var ld = ZMDataModel.getLogin(); var plat = $ionicPlatform.is('ios') ? 'ios' : 'android'; @@ -344,10 +350,10 @@ angular.module('zmApp.controllers') { "ios": { - "alert": "true", - "badge": "true", - "sound": "true", - "clearBadge": "true" + "alert": true, + "badge": true, + "sound": ld.soundOnPush, + "clearBadge": true } } @@ -356,7 +362,6 @@ angular.module('zmApp.controllers') } else { mediasrc = "/android_asset/www/sounds/blop.mp3"; var android_media_file = "blop"; - var ld = ZMDataModel.getLogin(); @@ -367,7 +372,8 @@ angular.module('zmApp.controllers') "android": { "senderID": zm.gcmSenderId, "icon": "ic_stat_notification", - "sound":"true" + sound:ld.soundOnPush, + vibrate: ld.vibrateOnPush //"sound": android_media_file } } @@ -395,7 +401,7 @@ angular.module('zmApp.controllers') platform: plat, token: $rootScope.apnsToken, state: pushstate - }); + },1); }); diff --git a/www/js/EventServerSettingsCtrl.js b/www/js/EventServerSettingsCtrl.js index 316ac2ab..215a6c4c 100644 --- a/www/js/EventServerSettingsCtrl.js +++ b/www/js/EventServerSettingsCtrl.js @@ -1,324 +1,331 @@ /* jshint -W041 */ -/* jslint browser: true*/ -/* global cordova,StatusBar,angular,console */ - -angular.module('zmApp.controllers').controller('zmApp.EventServerSettingsCtrl', ['$scope', '$ionicSideMenuDelegate', 'zm', '$stateParams', 'EventServer', '$ionicHistory', '$rootScope', '$state', 'message', 'ZMDataModel', '$ionicPlatform','$ionicPopup', '$timeout', '$translate', function ($scope, $ionicSideMenuDelegate, zm, $stateParams, EventServer, $ionicHistory, $rootScope, $state, message, ZMDataModel, $ionicPlatform, $ionicPopup, $timeout, $translate) { - $scope.openMenu = function () { - $ionicSideMenuDelegate.toggleLeft(); - }; - - - $scope.openMenu = function () { - $ionicSideMenuDelegate.toggleLeft(); - }; - - - //---------------------------------------------------------------- - // Alarm notification handling - //---------------------------------------------------------------- - $scope.handleAlarms = function () { - $rootScope.isAlarm = !$rootScope.isAlarm; - if (!$rootScope.isAlarm) { - $rootScope.alarmCount = "0"; - $ionicHistory.nextViewOptions({ - disableBack: true - }); - - - $state.go("events", { - "id": 0 - }, { - reload: true - }); - } - }; - - //---------------------------------------------------------------- - // Save anyway when you exit - //---------------------------------------------------------------- - + /* jslint browser: true*/ + /* global cordova,StatusBar,angular,console */ + + angular.module('zmApp.controllers').controller('zmApp.EventServerSettingsCtrl', ['$scope', '$ionicSideMenuDelegate', 'zm', '$stateParams', 'EventServer', '$ionicHistory', '$rootScope', '$state', 'message', 'ZMDataModel', '$ionicPlatform', '$ionicPopup', '$timeout', '$translate', function ($scope, $ionicSideMenuDelegate, zm, $stateParams, EventServer, $ionicHistory, $rootScope, $state, message, ZMDataModel, $ionicPlatform, $ionicPopup, $timeout, $translate) { + $scope.openMenu = function () { + $ionicSideMenuDelegate.toggleLeft(); + }; + + + $scope.openMenu = function () { + $ionicSideMenuDelegate.toggleLeft(); + }; + + + //---------------------------------------------------------------- + // Alarm notification handling + //---------------------------------------------------------------- + $scope.handleAlarms = function () { + $rootScope.isAlarm = !$rootScope.isAlarm; + if (!$rootScope.isAlarm) { + $rootScope.alarmCount = "0"; + $ionicHistory.nextViewOptions({ + disableBack: true + }); + + + $state.go("events", { + "id": 0 + }, { + reload: true + }); + } + }; + + + // we need this to dynamically get title + // name as ion-view is set in stone and + // we don't get title till beforeEnter + // which is odd - I'd expect beforeEnter to load + // before View is loaded + $scope.getTitle = function() + { + return $scope.loginData.serverName; + }; + + //---------------------------------------------------------------- + // Save anyway when you exit + //---------------------------------------------------------------- + $scope.$on('$ionicView.beforeLeave', function () { - saveItems(); - - - }); - - //-------------------------------------------------- - // notification tap action - //-------------------------------------------------- - - - - $scope.selectScreen = function () { - - var ld = ZMDataModel.getLogin(); - - $scope.myopt = { - selectedState: ld.onTapScreen - }; - - - var options = '<ion-radio-fix ng-model="myopt.selectedState" ng-value="\''+$translate.instant('kTapEvents')+'\'">'+ $translate.instant('kTapEvents')+'</ion-radio-fix>'; - - options+= '<ion-radio-fix ng-model="myopt.selectedState" ng-value="\''+$translate.instant('kTapMontage')+'\'">'+ $translate.instant('kTapMontage')+'</ion-radio-fix>'; - - options+= '<ion-radio-fix ng-model="myopt.selectedState" ng-value="\''+$translate.instant('kTapLiveMonitor')+'\'">'+ $translate.instant('kTapLiveMonitor')+'</ion-radio-fix>'; - - - - $rootScope.zmPopup = $ionicPopup.show({ - scope: $scope, - template: options, - - - title: 'View to navigate to:', - subTitle: 'currently set to: ' + ld.onTapScreen, - buttons: [ - { - text: $translate.instant('kButtonCancel'), - + saveItems(); + + + }); + + + $scope.$on('$ionicView.beforeEnter', function () { + + $scope.loginData = ZMDataModel.getLogin(); + console.log ("Event server - before Enter, loginData is " + JSON.stringify($scope.loginData)); + $scope.defScreen = $scope.loginData.onTapScreen; + + if ($scope.loginData.eventServer == "") { + $scope.loginData.eventServer = "wss://" + extractDomain($scope.loginData.url) + ":9000"; + } + + + + res = $scope.loginData.eventServerMonitors.split(","); + minterval = $scope.loginData.eventServerInterval.split(","); + + + for (var i = 0; i < $scope.monitors.length; i++) { + + + if (!isEnabled($scope.monitors[i].Monitor.Id)) { + // if the filter list has IDs and this is not part of it, uncheck it + $scope.monitors[i].Monitor.isChecked = false; + //console.log("Marking false"); + $scope.monitors[i].Monitor.reportingInterval = 0; + } else { + // console.log("Marking true"); + $scope.monitors[i].Monitor.isChecked = true; + $scope.monitors[i].Monitor.reportingInterval = getInterval($scope.monitors[i].Monitor.Id); + } + + } + }); + + + //-------------------------------------------------- + // notification tap action + //-------------------------------------------------- + + + + $scope.selectScreen = function () { + + var ld = ZMDataModel.getLogin(); + + $scope.myopt = { + selectedState: ld.onTapScreen + }; + + + var options = '<ion-radio-fix ng-model="myopt.selectedState" ng-value="\'' + $translate.instant('kTapEvents') + '\'">' + $translate.instant('kTapEvents') + '</ion-radio-fix>'; + + options += '<ion-radio-fix ng-model="myopt.selectedState" ng-value="\'' + $translate.instant('kTapMontage') + '\'">' + $translate.instant('kTapMontage') + '</ion-radio-fix>'; + options += '<ion-radio-fix ng-model="myopt.selectedState" ng-value="\'' + $translate.instant('kTapLiveMonitor') + '\'">' + $translate.instant('kTapLiveMonitor') + '</ion-radio-fix>'; + + + + $rootScope.zmPopup = $ionicPopup.show({ + scope: $scope, + template: options, + + + title: 'View to navigate to:', + subTitle: 'currently set to: ' + ld.onTapScreen, + buttons: [ + { + text: $translate.instant('kButtonCancel'), + }, - { - text: $translate.instant('kButtonOk'), - onTap: function (e) { - - ld.onTapScreen = $scope.myopt.selectedState; - ZMDataModel.zmLog("Setting new onTap State:"+ld.onTapScreen); - ZMDataModel.setLogin(ld); - $scope.defScreen = $scope.myopt.selectedState; - $scope.loginData = ld; - - - } + { + text: $translate.instant('kButtonOk'), + onTap: function (e) { + + ld.onTapScreen = $scope.myopt.selectedState; + ZMDataModel.zmLog("Setting new onTap State:" + ld.onTapScreen); + ZMDataModel.setLogin(ld); + $scope.defScreen = $scope.myopt.selectedState; + $scope.loginData = ld; + + + } } ] - }); - - - }; - - //---------------------------------------------------------------- - // Accordion list show/hide - //---------------------------------------------------------------- - - $scope.toggleGroup = function (group) { - if ($scope.isGroupShown(group)) { - $scope.shownGroup = null; - } else { - $scope.shownGroup = group; - } - }; - $scope.isGroupShown = function (group) { - return $scope.shownGroup === group; - }; - - $scope.saveItems = function () { - saveItems(); - }; - - //---------------------------------------------------------------- - // Saves ES data - //---------------------------------------------------------------- - - function saveItems() { - ZMDataModel.zmDebug("Saving Event Server data"); - var monstring = ""; - var intervalstring = ""; - var plat = $ionicPlatform.is('ios') ? 'ios':'android'; - for (var i = 0; i < $scope.monitors.length; i++) { - if (isNaN($scope.monitors[i].Monitor.reportingInterval)) { - $scope.monitors[i].Monitor.reportingInterval = 0; - } - if ($scope.monitors[i].Monitor.isChecked) { - monstring = monstring + $scope.monitors[i].Monitor.Id + ","; - var tint = parseInt($scope.monitors[i].Monitor.reportingInterval); - if (isNaN(tint)) tint = 0; - intervalstring = intervalstring + tint + ","; - } - - } - - if (monstring.charAt(monstring.length - 1) == ',') - monstring = monstring.substr(0, monstring.length - 1); - - if (intervalstring.charAt(intervalstring.length - 1) == ',') - intervalstring = intervalstring.substr(0, intervalstring.length - 1); - - $scope.loginData.eventServerMonitors = monstring; - $scope.loginData.eventServerInterval = intervalstring; - - // $scope.loginData.isUseEventServer = ($scope.check.isUseEventServer) ? "1" : "0"; - // $scope.loginData.disablePush = ($scope.check.disablePush) ? "1" : "0"; - - - - - - //console.log("**** EVENT MONSTRING " + monstring); - //console.log("**** EVENT INTERVALSTRING " + intervalstring); - - - var pushstate = "enabled"; - if ($scope.loginData.disablePush == true || $scope.loginData.isUseEventServer==false) - pushstate = "disabled"; - - if ($scope.loginData.isUseEventServer==true) { - EventServer.init() - .then(function (data) { - // console.log("Sending control filter"); - ZMDataModel.zmDebug("Sending Control message 'filter' with monlist="+monstring+" and interval="+intervalstring); - EventServer.sendMessage("control", { - type: 'filter', - monlist: monstring, - intlist: intervalstring - },1); - - if ($rootScope.apnsToken !="") - // if its defined then this is post init work - // so lets transmit state here - - { - // we need to disable the token - ZMDataModel.zmDebug("Sending token state "+pushstate); - EventServer.sendMessage('push', - { - type:'token', - platform:plat, - token:$rootScope.apnsToken, - state:pushstate - }); + }); + + + }; + + //---------------------------------------------------------------- + // Accordion list show/hide + //---------------------------------------------------------------- + + $scope.toggleGroup = function (group) { + if ($scope.isGroupShown(group)) { + $scope.shownGroup = null; + } else { + $scope.shownGroup = group; + } + }; + $scope.isGroupShown = function (group) { + return $scope.shownGroup === group; + }; + + $scope.saveItems = function () { + saveItems(); + }; + + //---------------------------------------------------------------- + // Saves ES data + //---------------------------------------------------------------- + + function saveItems() { + ZMDataModel.zmDebug("Saving Event Server data"); + var monstring = ""; + var intervalstring = ""; + var plat = $ionicPlatform.is('ios') ? 'ios' : 'android'; + for (var i = 0; i < $scope.monitors.length; i++) { + if (isNaN($scope.monitors[i].Monitor.reportingInterval)) { + $scope.monitors[i].Monitor.reportingInterval = 0; + } + if ($scope.monitors[i].Monitor.isChecked) { + monstring = monstring + $scope.monitors[i].Monitor.Id + ","; + var tint = parseInt($scope.monitors[i].Monitor.reportingInterval); + if (isNaN(tint)) tint = 0; + intervalstring = intervalstring + tint + ","; + } + + } + + if (monstring.charAt(monstring.length - 1) == ',') + monstring = monstring.substr(0, monstring.length - 1); + + if (intervalstring.charAt(intervalstring.length - 1) == ',') + intervalstring = intervalstring.substr(0, intervalstring.length - 1); + + $scope.loginData.eventServerMonitors = monstring; + $scope.loginData.eventServerInterval = intervalstring; + + + console.log ("SAVED: " + JSON.stringify($scope.loginData)); + ZMDataModel.setLogin($scope.loginData); + + var pushstate = "enabled"; + if ($scope.loginData.disablePush == true || $scope.loginData.isUseEventServer == false) + pushstate = "disabled"; + + if ($scope.loginData.isUseEventServer == true) { + EventServer.init() + .then(function (data) { + // console.log("Sending control filter"); + ZMDataModel.zmDebug("Sending Control message 'filter' with monlist=" + monstring + " and interval=" + intervalstring); + EventServer.sendMessage("control", { + type: 'filter', + monlist: monstring, + intlist: intervalstring + }, 1); + + if ($rootScope.apnsToken != "") + // if its defined then this is post init work + // so lets transmit state here + + { + // we need to disable the token + ZMDataModel.zmDebug("Sending token state " + pushstate); + EventServer.sendMessage('push', { + type: 'token', + platform: plat, + token: $rootScope.apnsToken, + state: pushstate + },1); + + } + + + }); + - } - + + } else { + if ($rootScope.apnsToken != "") + // if its defined then this is post init work + // so lets transmit state here + + { + // we need to disable the token + ZMDataModel.zmDebug("Sending token state " + pushstate); + EventServer.sendMessage('push', { + type: 'token', + platform: plat, + token: $rootScope.apnsToken, + state: pushstate + }, 1); + + } + // Give the above some time to transmit + + EventServer.disconnect(); - }); - // Give the above some time to transmit - $timeout (function() { - ZMDataModel.setLogin($scope.loginData);},2000); - } - else - { - if ($rootScope.apnsToken !="") - // if its defined then this is post init work - // so lets transmit state here - - { - // we need to disable the token - ZMDataModel.zmDebug("Sending token state "+pushstate); - EventServer.sendMessage('push', - { - type:'token', - platform:plat, - token:$rootScope.apnsToken, - state:pushstate - },1); - - } - // Give the above some time to transmit - $timeout (function() { - EventServer.disconnect();ZMDataModel.setLogin($scope.loginData);},3000); - } - - - - ZMDataModel.displayBanner('info', ['settings saved']); - } - - //---------------------------------------------------------------- - // returns domain name in string - - // http://stackoverflow.com/questions/8498592/extract-root-domain-name-from-string - //---------------------------------------------------------------- - function extractDomain(url) { - var domain; - //find & remove protocol (http, ftp, etc.) and get domain - if (url.indexOf("://") > -1) { - domain = url.split('/')[2]; - } - else { - domain = url.split('/')[0]; - } - - //find & remove port number - domain = domain.split(':')[0]; - - return domain; -} - - - //---------------------------------------------------------------- - // returns reporting interval for monitor ID - //---------------------------------------------------------------- - function getInterval(id) { - // means no interval, should only happen one time - // till we save - if ($scope.loginData.eventServerInterval == "") - return 0; - var retval = 0; - for (var i = 0; i < res.length; i++) { - if (res[i] == id) { - retval = parseInt(minterval[i]); - break; - } - } - return retval; - } - - //---------------------------------------------------------------- - // Returns true/false if monitor ID is in event monitor list - //---------------------------------------------------------------- - function isEnabled(id) { - if ($scope.loginData.eventServerMonitors == "") - return true; - - var isThere = false; - for (var i = 0; i < res.length; i++) { - if (res[i] == id) { - isThere = true; - //console.log("isRes found: " + id); - break; - } - } - return isThere; - } - - //------------------------------------------------------------------------- - // Controller Main - //------------------------------------------------------------------------ - $scope.monitors = []; - $scope.monitors = message; - - - $scope.loginData = ZMDataModel.getLogin(); - $scope.defScreen = $scope.loginData.onTapScreen; - - if ($scope.loginData.eventServer == "") - { - $scope.loginData.eventServer = "wss://"+extractDomain($scope.loginData.url)+":9000"; - } - - - - var res = $scope.loginData.eventServerMonitors.split(","); - var minterval = $scope.loginData.eventServerInterval.split(","); - - - for (var i = 0; i < $scope.monitors.length; i++) { - - - if (!isEnabled($scope.monitors[i].Monitor.Id)) { - // if the filter list has IDs and this is not part of it, uncheck it - $scope.monitors[i].Monitor.isChecked = false; - //console.log("Marking false"); - $scope.monitors[i].Monitor.reportingInterval = 0; - } else { - // console.log("Marking true"); - $scope.monitors[i].Monitor.isChecked = true; - $scope.monitors[i].Monitor.reportingInterval = getInterval($scope.monitors[i].Monitor.Id); - } - - } - + + } + + + + ZMDataModel.displayBanner('info', ['settings saved']); + } + + //---------------------------------------------------------------- + // returns domain name in string - + // http://stackoverflow.com/questions/8498592/extract-root-domain-name-from-string + //---------------------------------------------------------------- + function extractDomain(url) { + var domain; + //find & remove protocol (http, ftp, etc.) and get domain + if (url.indexOf("://") > -1) { + domain = url.split('/')[2]; + } else { + domain = url.split('/')[0]; + } + + //find & remove port number + domain = domain.split(':')[0]; + + return domain; + } + + + //---------------------------------------------------------------- + // returns reporting interval for monitor ID + //---------------------------------------------------------------- + function getInterval(id) { + // means no interval, should only happen one time + // till we save + if ($scope.loginData.eventServerInterval == "") + return 0; + var retval = 0; + for (var i = 0; i < res.length; i++) { + if (res[i] == id) { + retval = parseInt(minterval[i]); + break; + } + } + return retval; + } + + //---------------------------------------------------------------- + // Returns true/false if monitor ID is in event monitor list + //---------------------------------------------------------------- + function isEnabled(id) { + if ($scope.loginData.eventServerMonitors == "") + return true; + + var isThere = false; + for (var i = 0; i < res.length; i++) { + if (res[i] == id) { + isThere = true; + //console.log("isRes found: " + id); + break; + } + } + return isThere; + } + + //------------------------------------------------------------------------- + // Controller Main + //------------------------------------------------------------------------ + $scope.monitors = []; + $scope.monitors = message; + var res ,minterval; + + + diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index a4dd1b32..439b9f56 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -526,7 +526,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r platform: $rootScope.platformOS, token: $rootScope.apnsToken, state: "disabled" - }); + },1); } } @@ -542,7 +542,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r platform: $rootScope.platformOS, token: $rootScope.apnsToken, state: "enabled" - }); + },1); } EventServer.sendMessage("control", { type: 'filter', diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json index 4db47f2f..cde95b43 100644 --- a/www/lang/locale-en.json +++ b/www/lang/locale-en.json @@ -37,7 +37,7 @@ "kClear" :"Clear", "kCollapse" :"collapse", "kConfiguration" :"Configuration", - "kControl" : "control", + "kControl" :"control", "kCredentialsBody" :"Please provide your ZoneMinder credentials", "kCredentialsTitle" :"Credentials Required", "kCurrentState" :"current state", @@ -273,6 +273,7 @@ "kShowing" :"Showing", "kShowingEvent" :"showing event", "kSleep" :"Sleep", + "kSoundOnPush" :"Play sound on push", "kSpeed" :"speed", "kStart" :"Start", "kStateAreYouSure" :"Are you sure you want to ", @@ -312,6 +313,7 @@ "kValidNameZMAuth" :"Please enter a valid username and password for ZM auth", "kVersion" :"Version", "kVersionIncompatible" :"I am incompatible with your ZoneMinder version", + "kVibrateOnPush" :"Vibrate on push", "kVideo" :"Video", "kWake" :"Wake", "kWarningLargeTimeline" :"A large value can affect timeline performance. If you find timeline performance slow, try reducing the value to 200 and work your way up from there.", diff --git a/www/templates/eventserversettings.html b/www/templates/eventserversettings.html index 36bfa09b..a29b4ca4 100644 --- a/www/templates/eventserversettings.html +++ b/www/templates/eventserversettings.html @@ -1,4 +1,6 @@ -<ion-view view-title="{{'kEventServer' | translate}}/{{loginData.serverName}}" cache-view="false"> +<ion-view cache-view="false"> + + <ion-nav-title>{{'kEventServer' | translate}}/{{getTitle();}}" </ion-nav-title> <ion-nav-buttons side="left"> <button class="button button-icon button-clear ion-navicon" ng-click="openMenu()"></button> @@ -15,7 +17,7 @@ <div class="list list-inset"> {{'kEventServerConfig1' | translate }} </div> - <ion-checkbox ng-model="loginData.isUseEventServer" ng-checked="{{loginData.isUseEventServer}}">{{'kUseEventServer' | translate}}</ion-checkbox> + <ion-checkbox ng-model="loginData.isUseEventServer" ng-checked="loginData.isUseEventServer">{{'kUseEventServer' | translate}}</ion-checkbox> <ion-item ng-href="" ng-click="selectScreen()"> @@ -28,7 +30,14 @@ </label> - <ion-toggle ng-if="loginData.isUseEventServer" ng-model="loginData.disablePush" ng-checked="{{loginData.disablePush}}" toggle-class="toggle-calm" class="item-text-wrap">{{'kOnlyUseWebSocket'| translate }}<br/><p>{{'kDisablePush' | translate }}</p></ion-toggle> + <ion-toggle ng-if="loginData.isUseEventServer" ng-model="loginData.disablePush" ng-checked="loginData.disablePush" toggle-class="toggle-calm" class="item-text-wrap">{{'kOnlyUseWebSocket'| translate }}<br/><p>{{'kDisablePush' | translate }}</p></ion-toggle> + + + <!-- vibrate app setting is not av. on iOS--> + <ion-toggle ng-if="loginData.isUseEventServer && $root.platformOS !='ios'" ng-model="loginData.vibrateOnPush" ng-checked="loginData.vibrateOnPush" toggle-class="toggle-calm" >{{'kVibrateOnPush'| translate }}</ion-toggle> + + + <ion-toggle ng-if="loginData.isUseEventServer" ng-model="loginData.soundOnPush" ng-checked="loginData.soundOnPush" toggle-class="toggle-calm" >{{'kSoundOnPush'| translate }}</ion-toggle> <!-- <ion-toggle ng-model="loginData.defaultPushSound" toggle-class="toggle-calm" class="item-text-wrap" ng-checked="{{loginData.defaultPushSound}}">use system sound<p>please save and restart app</p></ion-toggle> |
