diff options
| -rw-r--r-- | www/js/MontageCtrl.js | 8 | ||||
| -rw-r--r-- | www/js/app.js | 81 | ||||
| -rw-r--r-- | www/templates/montage.html | 57 |
3 files changed, 60 insertions, 86 deletions
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index cd39a1c7..3631ad20 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -748,12 +748,14 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' //--------------------------------------------------------------------- $scope.onHold = function (index) { montageIndex = index; - isLongPressActive = true; - intervalHandleMontage = $interval(function () { + //isLongPressActive = true; + scaleMontage(); + + /*intervalHandleMontage = $interval(function () { scaleMontage(); }.bind(this), zm.montageScaleFrequency); - console.log("****Interval handle started **********" + zm.montageScaleFrequency); + console.log("****Interval handle started **********" + zm.montageScaleFrequency);*/ }; //--------------------------------------------------------------------- diff --git a/www/js/app.js b/www/js/app.js index 619ae051..e3f928eb 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -69,7 +69,9 @@ angular.module('zmApp', [ }) - +// this can be used to route img-src through interceptors. Works well, but when +// nph-zms streams images it doesn't work as success is never received +// (keeps reading data). Hence not using it now //credit: http://stackoverflow.com/questions/34958575/intercepting-img-src-via-http-interceptor-as-well-as-not-lose-the-ability-to-kee .directive('httpSrc', [ '$http', 'imageLoadingDataShare', 'ZMDataModel', @@ -120,62 +122,6 @@ angular.module('zmApp', [ ]) - - - - -//credit http://stackoverflow.com/questions/20997406/force-http-interceptor-in-dynamic-ngsrc-request -.directive('httpSrcOld', [ - '$http', 'imageLoadingDataShare', 'ZMDataModel', function ($http, imageLoadingDataShare, ZMDataModel) { - var directive = { - link: link, - restrict: 'A' - }; - return directive; - - function link(scope, element, attrs) { - - console.log ("HELLO OLD"); - - var requestConfig = { - method: 'Get', - url: attrs.httpSrcOld, - responseType: 'arraybuffer', - cache: 'true' - }; - - console.log ("Calling " + requestConfig.url); - imageLoadingDataShare.set(1); - $http(requestConfig) - .success(function(data) { - - console.log ("data got " + JSON.stringify(data)); - var arr = new Uint8Array(data); - - var raw = ''; - var i, j, subArray, chunk = 5000; - for (i = 0, j = arr.length; i < j; i += chunk) { - subArray = arr.subarray(i, i + chunk); - raw += String.fromCharCode.apply(null, subArray); - } - - var b64 = btoa(raw); - - attrs.$set('src', "data:image/jpeg;base64," + b64); - imageLoadingDataShare.set(0); - }) - .error (function(data) { - attrs.$set('src', 'img/novideo.png'); - imageLoadingDataShare.set(0); - ZMDataModel.zmDebug ("Inside http-src err"); - }); - - } - - } - ]) - - //------------------------------------------------------------------ // switch between collection repeat or ng-repeat //------------------------------------------------------------------- @@ -1254,6 +1200,27 @@ angular.module('zmApp', [ templateUrl: "templates/first-use.html", controller: 'zmApp.FirstUseCtrl', }) + + .state('montage-history', { + data: { + requireLogin: true + }, + resolve: { + message: function (ZMDataModel) { + console.log("Inside app.events resolve"); + return ZMDataModel.getMonitors(0); + } + + }, + url: "/montage-history", + templateUrl: "templates/montage-history.html", + controller: 'zmApp.MontageHistoryCtrl', + params: { + minimal: false, + isRefresh: false + } + + }) .state('montage', { data: { diff --git a/www/templates/montage.html b/www/templates/montage.html index e182d001..bb0597cb 100644 --- a/www/templates/montage.html +++ b/www/templates/montage.html @@ -5,25 +5,25 @@ </ion-nav-buttons> + <ion-nav-buttons side="right"> - - <button ng-class="packMontage?'button button-icon button-clear ion-android-more-vertical':'button button-icon button-clear ion-android-more-horizontal'" - ng-click="toggleMontageDisplayOrder();"> + + <button ng-class="packMontage?'button button-icon button-clear ion-android-more-vertical':'button button-icon button-clear ion-android-more-horizontal'" ng-click="toggleMontageDisplayOrder();"> </button> - + <span class="rotate-button"> <button class="button button-icon button-clear ion-arrow-swap" ng-click="toggleReorder();"> </button> - </span> + </span> + - <button class="button button-icon button-clear ion-android-contract" ng-click="switchMinimal()"> </button> <!--<button class="button button-icon ion-ios-help-outline" ng-click="popover.show($event)"></button>--> - - - + + + </ion-nav-buttons> <ion-content has-bouncing="false" style="background-color:#444444"> @@ -41,18 +41,21 @@ </div> </span> + + + <div ng-style="packMontage ? { '-webkit-column-count':slider.monsize,'-webkit-column-gap':'0px','line-height':'0px','-webkit-column-fill': 'balance', 'column-fill': 'balance'} : {'-webkit-column-count':slider.monsize,'-webkit-column-gap':'0px','line-height':'0px','display':'-webkit-flex','-webkit-flex-direction':'row','flex-direction':'row', 'flex-wrap':'wrap' }"> - <div ng-style="packMontage ? { '-webkit-column-count':slider.monsize,'-webkit-column-gap':'0px','line-height':'0px' } : {'-webkit-column-count':slider.monsize,'-webkit-column-gap':'0px','line-height':'0px','display':'-webkit-flex','-webkit-flex-direction':'row','flex-direction':'row', 'flex-wrap':'wrap' }"> - - <!--<div ng-style="packMontage ? { '-webkit-column-count':slider.monsize, '-webkit-column-gap':'0px','line-height':'0px' } : { 'flex':'display', '-webkit-column-count':slider.monsize }">--> - - - <span ng-repeat="monitor in MontageMonitors|limitTo: monLimit" - ng-if="monitor.Monitor.Function!='None' && monitor.Monitor.listDisplay!='noshow' && monitor.Monitor.Enabled !='0'"> + <!--<div ng-style="packMontage ? { '-webkit-column-count':slider.monsize, '-webkit-column-gap':'0px','line-height':'0px' } : { 'flex':'display', '-webkit-column-count':slider.monsize }">--> + + + <span ng-repeat="monitor in MontageMonitors|limitTo: monLimit" ng-if="monitor.Monitor.Function!='None' && monitor.Monitor.listDisplay!='noshow' && monitor.Monitor.Enabled !='0'"> <!-- back to ng-src. spinner was not updating when rand changes--> <!-- moving to single so I can rely on rand for reloads --> + + <!--src=" /zm/cgi-bin/nph-zms?source=event&mode=jpeg&event=7664&frame=1&scale=100&rate=100&maxfps=5&replay=gapless&auth=6b8c60f81fa2edff94f80f12bdebd98d&connkey=286643&rand=1453671607"--> + <div style="position: relative;width:{{devWidth/slider.monsize}}px;"> <div ng-if="!isModalActive"> <div ng-if="$root.authSession!='undefined' && !isBackground()"> @@ -84,26 +87,28 @@ {{monitor.Monitor.Name}} </div> </span> - - <div id="slowpulse" ng-class="monitor.Monitor.isAlarmed=='true'?'minimized-alarmed-header animated infinite flash':''" ng-if="minimal"></div> + <div id="slowpulse" ng-class="monitor.Monitor.isAlarmed=='true'?'minimized-alarmed-header animated infinite flash':''" ng-if="minimal"></div> - </div> - </div> + </div> + </div> - <div ng-if="isModalActive"> - <img id="img-$index" image-spinner-src="img/pausevideo.png" style="margin-top:0px; + + <div ng-if="isModalActive"> + <img id="img-$index" image-spinner-src="img/pausevideo.png" style="margin-top:0px; width: 100% !important; height: auto !important;" /> - </div> - + </div> - </span> - <!-- ngrepeat --> + </span> </div> + + <!-- ngrepeat --> + + <ion-item ng-show="!MontageMonitors.length"> |
