diff options
| -rw-r--r-- | .DS_Store | bin | 14340 -> 14340 bytes | |||
| -rw-r--r-- | resources/.DS_Store | bin | 6148 -> 6148 bytes | |||
| -rw-r--r-- | resources/android/.DS_Store | bin | 6148 -> 6148 bytes | |||
| -rw-r--r-- | resources/ios/.DS_Store | bin | 0 -> 6148 bytes | |||
| -rw-r--r-- | resources/ios/icon/.DS_Store | bin | 0 -> 6148 bytes | |||
| -rw-r--r-- | www/.DS_Store | bin | 6148 -> 6148 bytes | |||
| -rw-r--r-- | www/index.html | 2 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 3 | ||||
| -rw-r--r-- | www/js/app.js | 31 | ||||
| -rw-r--r-- | www/js/controllers.js | 2 | ||||
| -rw-r--r-- | www/js/ng.js | 14 | ||||
| -rw-r--r-- | www/templates/events-modal.html | 2 |
12 files changed, 48 insertions, 6 deletions
| Binary files differ diff --git a/resources/.DS_Store b/resources/.DS_Store Binary files differindex 72801004..136cf07f 100644 --- a/resources/.DS_Store +++ b/resources/.DS_Store diff --git a/resources/android/.DS_Store b/resources/android/.DS_Store Binary files differindex fb7c1883..7e8d5db6 100644 --- a/resources/android/.DS_Store +++ b/resources/android/.DS_Store diff --git a/resources/ios/.DS_Store b/resources/ios/.DS_Store Binary files differnew file mode 100644 index 00000000..fb7c1883 --- /dev/null +++ b/resources/ios/.DS_Store diff --git a/resources/ios/icon/.DS_Store b/resources/ios/icon/.DS_Store Binary files differnew file mode 100644 index 00000000..5008ddfc --- /dev/null +++ b/resources/ios/icon/.DS_Store diff --git a/www/.DS_Store b/www/.DS_Store Binary files differindex a67d688e..bf8f7220 100644 --- a/www/.DS_Store +++ b/www/.DS_Store diff --git a/www/index.html b/www/index.html index 5da248f6..76db4613 100644 --- a/www/index.html +++ b/www/index.html @@ -55,6 +55,8 @@ <script src="js/StateCtrl.js"></script> <script src="js/DevOptionsCtrl.js"></script> <script src="js/LogCtrl.js"></script> + + <script src="js/ng.js"></script> <!-- https://github.com/maxklenk/angular-circular-navigation - modified to use right angles --> <script src="external/angular-circular-navigation.js"></script> diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 2371983d..9df6ac7b 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -320,7 +320,7 @@ angular.module('zmApp.controllers') if (data.event.Frame[i].Type=="Alarm") { //⬤ - console.log ("**ALARM AT " + i); + //console.log ("**ALARM AT " + i); $scope.slider_options.scale.push({val:i+1,label:' '}); } else @@ -738,6 +738,7 @@ angular.module('zmApp.controllers') }); } + // now get event details to show alarm frames var loginData=ZMDataModel.getLogin(); var myurl = loginData.apiurl+'/events/'+eid+".json"; diff --git a/www/js/app.js b/www/js/app.js index 67844045..042db8e3 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -9,7 +9,8 @@ angular.module('zmApp', [ 'ionic', 'tc.chartjs', 'zmApp.controllers', - 'fileLogger' + 'fileLogger', + 'angular-carousel', 'angularAwesomeSlider' //'angularAwesomeSlider' ]) @@ -48,6 +49,20 @@ angular.module('zmApp', [ }) +.factory('imageLoadingDataShare', function () { + var imageLoading = 0; // 0 = not loading, 1 = loading, -1 = error; + return { + 'set': function (val) { + imageLoading = val; + //console.log ("** IMAGE LOADING **"+val); + }, + 'get': function() { + + return imageLoading; + } + }; +}) + //------------------------------------------------------------------ // this directive will be load any time an image completes loading // via img tags where this directive is added (I am using this in @@ -75,8 +90,8 @@ angular.module('zmApp', [ // This directive is adapted from https://github.com/paveisistemas/ionic-image-lazy-load // I've removed lazyLoad and only made it show a spinner when an image is loading //-------------------------------------------------------------------------------------------- -.directive('imageSpinnerSrc', ['$document', '$compile', - function ($document , $compile) { +.directive('imageSpinnerSrc', ['$document', '$compile','imageLoadingDataShare', + function ($document , $compile, imageLoadingDataShare) { return { restrict: 'A', scope: { @@ -88,9 +103,11 @@ angular.module('zmApp', [ var loader = $compile('<div class="image-loader-container"><ion-spinner style="position:fixed;top:5%;left:5%" class="image-loader" icon="' + $attributes.imageSpinnerLoader + '"></ion-spinner></div>')($scope); $element.after(loader); } + imageLoadingDataShare.set(1); loadImage(); $attributes.$observe('imageSpinnerSrc', function(value){ //console.log ("SOURCE CHANGED"); + imageLoadingDataShare.set(1); loadImage(); //deregistration(); @@ -100,8 +117,16 @@ angular.module('zmApp', [ $element.bind("load", function (e) { if ($attributes.imageSpinnerLoader) { loader.remove(); + imageLoadingDataShare.set(0); } }); + //PP + $element.bind('error', function(){ + loader.remove(); + imageLoadingDataShare.set(0); + }); + + if ($scope.imageSpinnerBackgroundImage == "true") { var bgImg = new Image(); diff --git a/www/js/controllers.js b/www/js/controllers.js index 1a111d03..416549ee 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-carousel', 'angularAwesomeSlider' ]) +angular.module('zmApp.controllers', ['ionic', 'ngCordova', 'ng-mfb','angularCircularNavigation' ]) .controller('zmApp.BaseController', function($scope, $ionicSideMenuDelegate, $ionicPlatform, $timeout, $rootScope) { $scope.openMenu = function () { diff --git a/www/js/ng.js b/www/js/ng.js new file mode 100644 index 00000000..d99945b1 --- /dev/null +++ b/www/js/ng.js @@ -0,0 +1,14 @@ +/*angular.module("ng") +.factory('imageLoadingDataShare', function () { + var imageLoading = 1; // 1 = loading, -1 = error; + return { + 'set': function (val) { + imageLoading = val; + }, + 'get': function() { + return imageLoading; + } + }; + + +});*/ diff --git a/www/templates/events-modal.html b/www/templates/events-modal.html index 60f49707..86f52489 100644 --- a/www/templates/events-modal.html +++ b/www/templates/events-modal.html @@ -13,7 +13,7 @@ <li ng-repeat="slide in slides"> - <img imageonload="finishedLoadingImage($index)" + <img id="hello" imageonload="finishedLoadingImage($index)" image-spinner-src="{{eventBasePath}}{{slide.img}}?rand={{rand}}" image-spinner-loader="lines" ng-class="{'zm-image-fit':imageFit==true, 'zm-image-crop':imageFit==false}";/> |
