diff options
Diffstat (limited to 'www')
| -rw-r--r-- | www/.DS_Store | bin | 6148 -> 6148 bytes | |||
| -rw-r--r-- | www/img/.DS_Store | bin | 6148 -> 6148 bytes | |||
| -rw-r--r-- | www/index.html | 2 | ||||
| -rw-r--r-- | www/js/DataModel.js | 28 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 12 | ||||
| -rw-r--r-- | www/js/TimelineCtrl.js | 12 | ||||
| -rw-r--r-- | www/js/app.js | 32 | ||||
| -rw-r--r-- | www/js/controllers.js | 2 | ||||
| -rw-r--r-- | www/templates/monitors-modal.html | 4 | ||||
| -rw-r--r-- | www/templates/montage.html | 11 |
11 files changed, 87 insertions, 18 deletions
diff --git a/www/.DS_Store b/www/.DS_Store Binary files differindex ba1f286a..5a9c6250 100644 --- a/www/.DS_Store +++ b/www/.DS_Store diff --git a/www/img/.DS_Store b/www/img/.DS_Store Binary files differindex 6d1e5957..3ee2f6ba 100644 --- a/www/img/.DS_Store +++ b/www/img/.DS_Store diff --git a/www/index.html b/www/index.html index 8d225d43..6382df85 100644 --- a/www/index.html +++ b/www/index.html @@ -15,6 +15,7 @@ <link rel="stylesheet" href="css/angular-carousel.css"> <link rel="stylesheet" href="lib/angular-awesome-slider/dist/css/angular-awesome-slider.min.css"> <link rel="stylesheet" href="lib/vis/dist/vis.min.css"> + <link rel="stylesheet" href="lib/ionic-content-banner/dist/ionic.content.banner.min.css"> @@ -63,6 +64,7 @@ <!-- <script src="lib/vis/dist/vis.min.js"></script>--> <script src="lib/vis/dist/vis-dev.js"></script> + <script src="lib/ionic-content-banner/dist/ionic.content.banner.min.js"></script> diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 94f231bc..d85c4a5c 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -7,7 +7,7 @@ // that many other controllers use // It's grown over time. I guess I may have to split this into multiple services in the future -angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ionicLoading', '$ionicBackdrop', '$fileLogger', 'zm','$rootScope',function ($http, $q, $ionicLoading, $ionicBackdrop,$fileLogger,zm, $rootScope) { +angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ionicLoading', '$ionicBackdrop', '$fileLogger', 'zm','$rootScope','$ionicContentBanner', '$timeout',function ($http, $q, $ionicLoading, $ionicBackdrop,$fileLogger,zm, $rootScope,$ionicContentBanner, $timeout) { var zmAppVersion="unknown"; var monitorsLoaded = 0; @@ -38,6 +38,21 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion { $fileLogger.log(logtype, val); } + + function displayBanner (mytype, mytext, myinterval, mytimer) + { + var contentBannerInstance = $ionicContentBanner.show({ + text: mytext || 'no text', + interval: myinterval || 2000, + type: mytype || 'info', + transition: 'vertical' + }); + + $timeout (function() { + contentBannerInstance(); + },mytimer || 6000); + } + return { @@ -253,7 +268,12 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion loginData.maxMontage = 1; } }, - + + + displayBanner: function (mytype, mytext, myinterval, mytimer) + { + displayBanner (mytype, mytext, myinterval, mytimer); + }, //----------------------------------------------------------------------------- // This function returns the numdigits for padding capture images //----------------------------------------------------------------------------- @@ -350,6 +370,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion // to imply no monitors could be loaded. FIXME: conver to proper error monitors = []; console.log("promise resolved inside HTTP fail"); + displayBanner ('error', ['error retrieving monitor list', 'please try again']); d.resolve(monitors); $ionicLoading.hide(); monitorsLoaded = 0 ; @@ -421,6 +442,8 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion $ionicLoading.hide(); console.log("*** ERROR GETTING TOTAL PAGES ***"); zmLog ("Error retrieving page count of events " + JSON.stringify(error), "error"); + displayBanner ('error', ['error retrieving event page count', 'please try again']); + d.reject(error); return d.promise; }); @@ -493,6 +516,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion }) .error(function (err) { if (loadingStr != 'none') $ionicLoading.hide(); + displayBanner ('error', ['error retrieving event list', 'please try again']); console.log("HTTP Events error " + err); zmLog("Error fetching events for page " + pageId + " Err: " + JSON.stringify(err), "error"); // I need to reject this as I have infinite scrolling diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 761bf9ec..562cbc1d 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -366,6 +366,7 @@ $ionicPopover.fromTemplateUrl('templates/events-popover.html', { }) .error(function(err) { ZMDataModel.zmLog("Error retrieving detailed frame API " + JSON.stringify(err)); + ZMDataModel.displayBanner ('error', ['could not retrieve frame details', 'please try again']); }); @@ -803,6 +804,7 @@ $ionicPopover.fromTemplateUrl('templates/events-popover.html', { }) .error(function(err) { ZMDataModel.zmLog("Error retrieving detailed frame API " + JSON.stringify(err)); + ZMDataModel.displayBanner ('error', ['could not retrieve frame details', 'please try again']); }); $scope.totalEventTime = Math.round(parseFloat(edur)) - 1; diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 1620472d..c8490627 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -13,6 +13,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' console.log("******** HAVE ALL MONITORS"); $scope.monitors = message; + ZMDataModel.zmLog ("Inside Montage Ctrl:We found " + $scope.monitors.length + " monitors"); document.addEventListener("pause", onPause, false); document.addEventListener("resume", onResume, false); @@ -595,7 +596,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' } else // modal is active { - $rootScope.modalRand = Math.floor((Math.random() * 100000) + 1); + // $rootScope.modalRand = Math.floor((Math.random() * 100000) + 1); } @@ -706,9 +707,16 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' // $rootScope.rand = Math.floor((Math.random() * 100000) + 1); }); - + $scope.reloadView = function() + { + $rootScope.rand = Math.floor((Math.random() * 100000) + 1); + ZMDataModel.zmLog ("User action: image reload " + $rootScope.rand); + }; $scope.doRefresh = function () { + + + console.log("***Pull to Refresh, recomputing Rand"); ZMDataModel.zmLog ("Reloading view for montage view, recomputing rand"); $rootScope.rand = Math.floor((Math.random() * 100000) + 1); diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index 448a35db..1d1f8e9d 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -9,7 +9,7 @@ // I've disabled pan and zoom and used buttons instead // also limits # of items to maxItems (currently 200) -angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPlatform', '$scope', 'zm', 'ZMDataModel', '$ionicSideMenuDelegate', '$rootScope', '$http', '$q', 'message', '$state', '$ionicLoading', '$ionicPopover', '$ionicScrollDelegate', '$ionicModal', '$timeout', function ($ionicPlatform, $scope, zm, ZMDataModel, $ionicSideMenuDelegate, $rootScope, $http, $q, message, $state, $ionicLoading, $ionicPopover, $ionicScrollDelegate, $ionicModal, $timeout) { +angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPlatform', '$scope', 'zm', 'ZMDataModel', '$ionicSideMenuDelegate', '$rootScope', '$http', '$q', 'message', '$state', '$ionicLoading', '$ionicPopover', '$ionicScrollDelegate', '$ionicModal', '$timeout', '$ionicContentBanner', function ($ionicPlatform, $scope, zm, ZMDataModel, $ionicSideMenuDelegate, $rootScope, $http, $q, message, $state, $ionicLoading, $ionicPopover, $ionicScrollDelegate, $ionicModal, $timeout, $ionicContentBanner) { console.log("Inside Timeline controller"); $scope.openMenu = function () { @@ -188,6 +188,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla }) .error(function (err) { ZMDataModel.zmLog("Error retrieving detailed frame API " + JSON.stringify(err)); + ZMDataModel.displayBanner ('error', ['error retrieving event details', 'please try again']); }); $scope.totalEventTime = Math.round(parseFloat(edur)) - 1; @@ -607,7 +608,14 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla } }); - }); // get Events + }, + function (error) { + ZMDataModel.displayBanner ('error', 'Timeline error', 'Please try again'); + + } + + + ); // get Events }); } diff --git a/www/js/app.js b/www/js/app.js index 3d6c7f48..da984cac 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -242,7 +242,7 @@ angular.module('zmApp', [ // This service automatically logs into ZM at periodic intervals //------------------------------------------------------------------ -.factory('zmAutoLogin', function($interval, ZMDataModel, $http,zm, $browser,$timeout,$q, $rootScope, $ionicLoading, $ionicPopup, $state) { +.factory('zmAutoLogin', function($interval, ZMDataModel, $http,zm, $browser,$timeout,$q, $rootScope, $ionicLoading, $ionicPopup, $state, $ionicContentBanner) { var zmAutoLoginHandle; //------------------------------------------------------------------ @@ -253,7 +253,19 @@ angular.module('zmApp', [ { console.log ("**** ZM LOGIN ERROR INTERCEPT"); - var alertPopup = $ionicPopup.alert( + var contentBannerInstance = $ionicContentBanner.show({ + text: ['ZoneMinder authentication failed', 'Please check settings'], + interval: 2000, + type: 'error', + transition: 'vertical' + }); + + $timeout (function() { + contentBannerInstance(); + },6000); + + + /*var alertPopup = $ionicPopup.alert( { title: 'Zoneminder authentication failed', template: 'This might be a temporary situation and may result in zmNinja not working properly. Please try to log in again.' @@ -263,7 +275,7 @@ angular.module('zmApp', [ $timeout(function() { ZMDataModel.zmLog("Hiding auth error dialog box"); alertPopup.close(); - },5000); + },5000);*/ @@ -276,6 +288,16 @@ angular.module('zmApp', [ $rootScope.$on ("auth-success", function() { + var contentBannerInstance = $ionicContentBanner.show({ + text: ['ZoneMinder authentication success'], + interval: 2000, + type: 'info', + transition: 'vertical' + }); + + $timeout (function() { + contentBannerInstance(); + },2000); console.log ("**** ZM LOGIN SUCCESS INTERCEPT"); }); @@ -385,8 +407,8 @@ angular.module('zmApp', [ console.log ("**** ZM Login FAILED"); ZMDataModel.zmLog ("zmAutologin Error " + JSON.stringify(error), "error, but not calling auth-error emit"); // FIXME should I really emit here? This usually does not mean bad login - // that is handled in success - // $rootScope.$emit('auth-error', error); + // that is handled in success. But looks like bad urls etc come here + $rootScope.$emit('auth-error', error); d.reject("Login Error"); return d.promise; diff --git a/www/js/controllers.js b/www/js/controllers.js index 416549ee..8ea39044 100644 --- a/www/js/controllers.js +++ b/www/js/controllers.js @@ -4,7 +4,7 @@ -angular.module('zmApp.controllers', ['ionic', 'ngCordova', 'ng-mfb','angularCircularNavigation' ]) +angular.module('zmApp.controllers', ['ionic', 'ngCordova', 'ng-mfb','angularCircularNavigation', 'jett.ionic.content.banner' ]) .controller('zmApp.BaseController', function($scope, $ionicSideMenuDelegate, $ionicPlatform, $timeout, $rootScope) { $scope.openMenu = function () { diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html index 9ee970c9..06a4edc3 100644 --- a/www/templates/monitors-modal.html +++ b/www/templates/monitors-modal.html @@ -5,7 +5,7 @@ <ion-modal-view cache-view="false" style="background-color:#444444" > <ion-content > - + <!-- <div style="background-color:red; color:white"> Modal Rand:{{$root.modalRand}} </div>--> <ion-scroll has-bouncing=false min-zoom=1 zooming="true" direction="xy" style="width: 100%; "> <!-- android needs this 100vh - otherwise max- does not work --> @@ -17,7 +17,7 @@ image-spinner-src="{{LoginData.streamingurl}}/cgi-bin/nph-zms?mode=single&monitor={{monitorId}}&maxfps={{LoginData.maxFPS}}&user={{LoginData.username}}&pass={{LoginData.password}}&rand={{$root.modalRand}}" ng-class="{'zm-image-fit':imageFit==true, 'zm-image-crop':imageFit==false}" on-swipe-left="onSwipeLeft(monitorId,-1)" on-swipe-right="onSwipeRight(monitorId,1)" /> </div> </ion-scroll> - <span style="background-color:red; color:white"> Modal Rand:{{$root.modalRand}} </span> + </ion-content> diff --git a/www/templates/montage.html b/www/templates/montage.html index c3ad91e5..7a192c54 100644 --- a/www/templates/montage.html +++ b/www/templates/montage.html @@ -57,7 +57,7 @@ </div> <div ng-if="isModalActive"> - <img id="img-$index" ng-src="img/novideo.png" style="display:block;" width="{{((devWidth)/(7-monitorSize[$index]))}}px;"/> + <img id="img-$index" ng-src="img/pausevideo.png" style="display:block;" width="{{((devWidth)/(7-monitorSize[$index]))}}px;"/> </div> @@ -75,15 +75,18 @@ <div ng-show="minimal"> <nav mfb-menu position="br" effect="zoomin" label="collapse" active-icon="ion-chevron-down" resting-icon="ion-chevron-up" toggling-method="click"> - <button mfb-button icon="ion-close" label="exit full screen" - ng-click="switchMinimal()"> - </button> + <button mfb-button icon="ion-arrow-expand" label="increase size" ng-click="changeSize(1)"> </button> <button mfb-button icon="ion-arrow-shrink" label="decrease size" ng-click="changeSize(-1)"> </button> + <button mfb-button icon="ion-refresh" label="refresh" ng-click="reloadView();"> + </button> + <button mfb-button icon="ion-close" label="exit full screen" + ng-click="switchMinimal()"> + </button> </nav> </div> </ion-view> |
