diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-07-05 15:17:51 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-07-05 15:17:51 -0400 |
| commit | c13f398082262f94293052b4f39036ed7fa1c7f4 (patch) | |
| tree | 915e662918a88a36a6628c6dc2f725fba9a625a9 /www | |
| parent | 84b05d931168df5eade1a5ca3c9dc0b303d98384 (diff) | |
#278 - live stream on push notification - works on Android, iOS TBD
Former-commit-id: 807bd7364e057f43a580d95bc7fc908c556a8776
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/EventServer.js | 29 | ||||
| -rw-r--r-- | www/js/EventServerSettingsCtrl.js | 7 | ||||
| -rw-r--r-- | www/js/PortalLoginCtrl.js | 4 | ||||
| -rw-r--r-- | www/templates/eventserversettings.html | 2 |
4 files changed, 36 insertions, 6 deletions
diff --git a/www/js/EventServer.js b/www/js/EventServer.js index 9b0103cf..2f8d643d 100644 --- a/www/js/EventServer.js +++ b/www/js/EventServer.js @@ -414,14 +414,39 @@ angular.module('zmApp.controllers') if (data.additionalData.foreground == false) { // This means push notification tap in background - - ZMDataModel.zmDebug("**** NOTIFICATION TAPPED SETTING TAPPED TO 1 ****"); + + ZMDataModel.zmDebug ("*** PUSH NOTFN.>>>>"+JSON.stringify(data)); + + // set tappedMid to monitor + //*** PUSH DATA>>>>{"sound":"blop","message":"Alarms: Basement (2854) ","additionalData":{"mid":"2","coldstart":false,"collapse_key":"do_not_collapse","foreground":false}} + + ZMDataModel.zmDebug("Notification Tapped"); $rootScope.alarmCount = "0"; $rootScope.isAlarm = 0; $rootScope.tappedNotification = 1; + var mid = data.additionalData.mid; + + // if Multiple mids, take the first one + var mi = mid.indexOf(','); + if (mi > 0) + { + mid = mid.slice(0,mi); + } + mid = parseInt(mid); + + $rootScope.tappedMid = mid; + ZMDataModel.zmLog ("Push notification: Tapped Monitor taken as:"+$rootScope.tappedMid); + + if ($rootScope.platformOS == 'ios') { + if ($rootScope.tappedMid != 0) + { + ZMDataModel.zmDebug("iOS Push: tapped Notification not supported, YET"); + $rootScope.tappedMid = 0; + } + ZMDataModel.zmDebug ("iOS only: clearing background push"); push.finish(function() { ZMDataModel.zmDebug("processing of push data is finished"); diff --git a/www/js/EventServerSettingsCtrl.js b/www/js/EventServerSettingsCtrl.js index 057ae245..8b677060 100644 --- a/www/js/EventServerSettingsCtrl.js +++ b/www/js/EventServerSettingsCtrl.js @@ -58,12 +58,17 @@ angular.module('zmApp.controllers').controller('zmApp.EventServerSettingsCtrl', }; + 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: '<ion-radio-fix ng-model="myopt.selectedState" ng-value="\'events\'">'+ $translate.instant('kEventView')+'</ion-radio-fix><ion-radio-fix ng-model="myopt.selectedState" ng-value="\'montage\'"> Montage view </ion-radio-fix>', + template: options, title: 'View to navigate to:', diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js index 10dd30ce..a47cc91e 100644 --- a/www/js/PortalLoginCtrl.js +++ b/www/js/PortalLoginCtrl.js @@ -188,8 +188,8 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic } else // we go to live { - ZMDataModel.zmDebug("Going to live view but Montage for now"); - $state.go("montage", {}, { reload: true }); + ZMDataModel.zmDebug("Going to live view "); + $state.go("monitors", {}, { reload: true }); return; } } diff --git a/www/templates/eventserversettings.html b/www/templates/eventserversettings.html index 3ea25eb4..36bfa09b 100644 --- a/www/templates/eventserversettings.html +++ b/www/templates/eventserversettings.html @@ -23,7 +23,7 @@ </ion-item> <label class="item item-input item-floating-label" ng-if="loginData.isUseEventServer"> - <span class="input-label">{{'kEventServer'}}</span> + <span class="input-label">{{'kEventServer' | translate}}</span> <input autocapitalize="none" autocomplete="off" autocorrect="off" type="text" placeholder="Event notification url" ng-model="loginData.eventServer"> </label> |
