From b32d3a42b4f7a66c72af887ba88d30b64b8f175c Mon Sep 17 00:00:00 2001 From: pliablepixels Date: Sun, 21 Feb 2016 15:44:07 -0500 Subject: various updates Former-commit-id: 856f39b345da94a05658a5e5c1b749cacc9203b3 --- www/LICENSE-DESKTOP-CLIENT.txt | 23 +++++++++++++++++++++++ www/css/style.css | 2 +- www/index.html | 1 + www/js/DataModel.js | 10 +++++++++- www/js/EventModalCtrl.js | 13 ++++++++++++- www/js/MontageHistoryCtrl.js | 6 +++--- www/js/app.js | 22 +++++++++++++++++++++- www/templates/devoptions.html | 9 ++++++++- www/templates/events-modal.html | 26 ++++++++++++++++++-------- 9 files changed, 96 insertions(+), 16 deletions(-) create mode 100644 www/LICENSE-DESKTOP-CLIENT.txt diff --git a/www/LICENSE-DESKTOP-CLIENT.txt b/www/LICENSE-DESKTOP-CLIENT.txt new file mode 100644 index 00000000..11c8e216 --- /dev/null +++ b/www/LICENSE-DESKTOP-CLIENT.txt @@ -0,0 +1,23 @@ +The code is free for personal, non commercial use +http://creativecommons.org/licenses/by-nc-sa/4.0/ +In summary: Share Alike, Adapt,Attribute, NonCommercial + +For Desktop Clients: +The Desktop clients are free to download and use ONLY for users +who are using the desktop client with the free and open source ZoneMinder +software. If you are selling a service based on zoneminder and are either distributing the Desktop Client to your users or asking your users to use the desktop client by download it themselves, you are violating the non-commercial use. You will need to procure a license before you do so. + +Be nice, please. + +If you have any questions on licensing feel free to contact me. + +Ninja icon; +https://openclipart.org/detail/172393/ninja-logo +License: https://openclipart.org/share + +Blop sound for notifications: +http://soundbible.com/2067-Blop.html + + +-thanks + diff --git a/www/css/style.css b/www/css/style.css index 2a9e9098..589bf7e6 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -370,7 +370,7 @@ http://www.cssportal.com/tryit/index.php?file=blog/css-notification-badge */ .events-range-modal { position:absolute; - bottom:60px; + bottom:30px; left:30px; z-index:99; opacity:0.7; diff --git a/www/index.html b/www/index.html index 85f6e828..c1d25389 100644 --- a/www/index.html +++ b/www/index.html @@ -227,6 +227,7 @@ +
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 diff --git a/www/templates/devoptions.html b/www/templates/devoptions.html index 2ae803fb..4bc0bda0 100644 --- a/www/templates/devoptions.html +++ b/www/templates/devoptions.html @@ -68,12 +68,19 @@
- Event image scale(%)  + Event single image scale(%) 
+
+ Event Montage image scale(%)  + +
+
Max. items for Timeline