diff options
| author | pliablepixels <pliablepixels@gmail.com> | 2016-02-21 15:44:07 -0500 |
|---|---|---|
| committer | pliablepixels <pliablepixels@gmail.com> | 2016-02-21 15:44:07 -0500 |
| commit | b32d3a42b4f7a66c72af887ba88d30b64b8f175c (patch) | |
| tree | 7c1f3d9bf0bb799f6efb5fec9f073ee8a2d8d84d /www/js | |
| parent | 376e3136f2cfa45c31027cd569b7b767dc764cea (diff) | |
various updates
Former-commit-id: 856f39b345da94a05658a5e5c1b749cacc9203b3
Diffstat (limited to 'www/js')
| -rw-r--r-- | www/js/DataModel.js | 10 | ||||
| -rw-r--r-- | www/js/EventModalCtrl.js | 13 | ||||
| -rw-r--r-- | www/js/MontageHistoryCtrl.js | 6 | ||||
| -rw-r--r-- | www/js/app.js | 22 |
4 files changed, 45 insertions, 6 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 73b1d6b6..a64f52a2 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -37,7 +37,8 @@ angular.module('zmApp.controllers') 'streamingurl': "", 'maxFPS': "3", // image streaming FPS 'montageQuality': "50", // montage streaming quality in % - 'singleImageQuality': "50", // single streaming quality in % + 'singleImageQuality': "100", // single streaming quality in % + 'montageHistoryQuality':"50", 'useSSL':false, // "1" if HTTPS 'keepAwake':true, // don't dim/dim during live view 'isUseAuth':true, // true if user wants ZM auth @@ -282,6 +283,13 @@ angular.module('zmApp.controllers') } + if (typeof loginData.montageHistoryQuality == 'undefined') + { + zmDebug ("montageHistoryQuality does not exist. Setting to 50"); + loginData.montageHistoryQuality = "50"; + + } + zmLog ("DataModel init recovered this loginData as " + JSON.stringify(loginData)); } else diff --git a/www/js/EventModalCtrl.js b/www/js/EventModalCtrl.js index 4b51dba6..60d4cc37 100644 --- a/www/js/EventModalCtrl.js +++ b/www/js/EventModalCtrl.js @@ -14,6 +14,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro var nphTimer; var eventQueryHandle; $scope.loginData = ZMDataModel.getLogin(); + $scope.currentRate='-'; var eventImageDigits = 5; // failsafe @@ -234,6 +235,8 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.currentProgress = resp.status.progress; $scope.eventId = resp.status.event; + $scope.d_eventId = $scope.eventId; + $scope.currentRate = resp.status.rate; if ($scope.currentProgress > $scope.currentEventDuration) $scope.currentProgress = $scope.currentEventDuration; @@ -273,6 +276,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.currentProgress = 0; // if = then we are at end $scope.eventId = resp.data.status.event; + $scope.d_eventId = $scope.eventId; ZMDataModel.zmDebug ("STEP 3: New eid " + $scope.eventId + " duration " + $scope.currentEventDuration); eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery); @@ -333,12 +337,14 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro $scope.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); $timeout( function () { sendCommand('14',$scope.connKey, '&offset='+$scope.currentProgress);},500); ZMDataModel.zmDebug ("so I'm regenerating Connkey to " + $scope.connKey); + eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery); } }); req.error (function (resp) { ZMDataModel.zmDebug ("processEvent error:"+JSON.stringify(resp)); + eventQueryHandle = $timeout (function(){checkEvent();}, zm.eventPlaybackQuery); }); @@ -703,6 +709,10 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro var ld = ZMDataModel.getLogin(); $scope.loginData = ZMDataModel.getLogin(); + $scope.singleImageQuality = ld.singleImageQuality; + //$scope.singleImageQuality = 100; + + currentEvent = $scope.currentEvent; @@ -1018,7 +1028,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro function jumpToEventZms(connkey, dirn) { var cmd = dirn==1?'13':'12'; - + $scope.d_eventId = "..."; ZMDataModel.zmDebug ("Sending " + cmd + " to " + connkey); $ionicLoading.show({ @@ -1182,6 +1192,7 @@ angular.module('zmApp.controllers').controller('EventModalCtrl', ['$scope', '$ro //console.log (JSON.stringify( success)); $scope.eventName = event.Event.Name; $scope.eventId = event.Event.Id; + $scope.d_eventId = $scope.eventId; $scope.eFramesNum = event.Event.Frames; $scope.eventDur = Math.round(event.Event.Length); $scope.loginData = ZMDataModel.getLogin(); diff --git a/www/js/MontageHistoryCtrl.js b/www/js/MontageHistoryCtrl.js index 2046ffcc..29a8701b 100644 --- a/www/js/MontageHistoryCtrl.js +++ b/www/js/MontageHistoryCtrl.js @@ -158,7 +158,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc // console.log ("Old value of event url " + $scope.MontageMonitors[j].eventUrl); //console.log ("ldurl is " + ld.streamingurl); - $scope.MontageMonitors[j].Monitor.eventUrl=ld.streamingurl+"/nph-zms?source=event&mode=jpeg&event="+eid+"&frame=1&replay=gapless&rate="+$scope.sliderVal.realRate+"&connkey="+$scope.MontageMonitors[j].Monitor.connKey+"&scale="+ld.singleImageQuality+"&rand="+$rootScope.rand; + $scope.MontageMonitors[j].Monitor.eventUrl=ld.streamingurl+"/nph-zms?source=event&mode=jpeg&event="+eid+"&frame=1&replay=gapless&rate="+$scope.sliderVal.realRate+"&connkey="+$scope.MontageMonitors[j].Monitor.connKey+"&scale="+ld.montageHistoryQuality+"&rand="+$rootScope.rand; //console.log ("Setting event URL to " +$scope.MontageMonitors[j].Monitor.eventUrl); // console.log ("SWITCHING TO " + $scope.MontageMonitors[j].eventUrl); @@ -213,7 +213,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc if (!ZMDataModel.isBackground()) { - $scope.MontageMonitors[i].Monitor.eventUrl=ld.streamingurl+"/nph-zms?source=event&mode=jpeg&event="+data.events[0].Event.Id+"&frame=1&replay=gapless&rate="+$scope.sliderVal.realRate+"&connkey="+$scope.MontageMonitors[i].Monitor.connKey+"&scale="+ld.singleImageQuality+"&rand="+$rootScope.rand; + $scope.MontageMonitors[i].Monitor.eventUrl=ld.streamingurl+"/nph-zms?source=event&mode=jpeg&event="+data.events[0].Event.Id+"&frame=1&replay=gapless&rate="+$scope.sliderVal.realRate+"&connkey="+$scope.MontageMonitors[i].Monitor.connKey+"&scale="+ld.montageHistoryQuality+"&rand="+$rootScope.rand; @@ -442,7 +442,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageHistoryCtrl', ['$sc element.addClass('animated flipInX'); $scope.MontageMonitors[ndx].Monitor.eventUrlTime=data.event.Event.StartTime; - $scope.MontageMonitors[ndx].Monitor.eventUrl=ld.streamingurl+"/nph-zms?source=event&mode=jpeg&event="+data.event.Event.Id+"&frame=1&replay=gapless&rate="+$scope.sliderVal.realRate+"&connkey="+$scope.MontageMonitors[ndx].Monitor.connKey+"&scale="+ld.singleImageQuality+"&rand="+$rootScope.rand; + $scope.MontageMonitors[ndx].Monitor.eventUrl=ld.streamingurl+"/nph-zms?source=event&mode=jpeg&event="+data.event.Event.Id+"&frame=1&replay=gapless&rate="+$scope.sliderVal.realRate+"&connkey="+$scope.MontageMonitors[ndx].Monitor.connKey+"&scale="+ld.montageHistoryQuality+"&rand="+$rootScope.rand; },700); } diff --git a/www/js/app.js b/www/js/app.js index dba5c28b..f18bbef6 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -1,6 +1,6 @@ /* jshint -W041 */ /* jslint browser: true*/ -/* global cordova,StatusBar,angular,console,alert,PushNotification, moment ,ionic, URI */ +/* global cordova,StatusBar,angular,console,alert,PushNotification, moment ,ionic, URI, $*/ var appVersion = "0.0.0"; @@ -151,6 +151,26 @@ angular.module('zmApp', [ }) +.directive('tooltip', function () { + return { + restrict: 'C', + link: function (scope, element, attrs) { + if (attrs.title) { + var $element = $(element); + $element.attr("title", attrs.title); + $element.tooltipster({ + animation: attrs.animation, + trigger: "click", + position: "right", + positionTracker: true, + maxWidth: 500, + contentAsHTML: true + }); + } + } + }; +}) + //------------------------------------------------------------------ // I use this factory to share data between carousel and lazy load |
