summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/MonitorModalCtrl.js2
-rw-r--r--www/js/NVR.js2
-rwxr-xr-xwww/js/app.js27
3 files changed, 28 insertions, 3 deletions
diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js
index fb751161..4d5f94f2 100644
--- a/www/js/MonitorModalCtrl.js
+++ b/www/js/MonitorModalCtrl.js
@@ -117,7 +117,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$
$scope.togglePTZ();
} else { // rest of the functions are PTZ
if (!$scope.showPTZ) {
- NVR.debug("PTZ is not on, or disabled");
+ //NVR.debug("PTZ is not on, or disabled");
return;
}
// coming here means PTZ is on
diff --git a/www/js/NVR.js b/www/js/NVR.js
index c9c674e2..b0330995 100644
--- a/www/js/NVR.js
+++ b/www/js/NVR.js
@@ -20,7 +20,7 @@ angular.module('zmApp.controllers')
DO NOT TOUCH zmAppVersion
It is changed by sync_version.sh
*/
- var zmAppVersion = "1.3.052";
+ var zmAppVersion = "1.3.053";
var isBackground = false;
var justResumed = false;
var timeSinceResumed = -1;
diff --git a/www/js/app.js b/www/js/app.js
index 0b87bd82..71a51c00 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -20,7 +20,7 @@ angular.module('zmApp', [
'fileLogger',
'angular-carousel',
'angularAwesomeSlider',
- 'com.2fdevs.videogular',
+ 'com.2fdevs.videogular',
'com.2fdevs.videogular.plugins.controls',
'com.2fdevs.videogular.plugins.overlayplay',
'mgo-angular-wizard',
@@ -1629,6 +1629,12 @@ angular.module('zmApp', [
NVR.log ("--------->Setting up network state handlers....");
window.addEventListener("offline", onOffline, false);
window.addEventListener("online", onOnline, false);
+
+ NVR.log ("--------->Setting up global key handler...");
+ if ($rootScope.platformOS == 'desktop') {
+ window.addEventListener('keydown', keyboardHandler, true);
+
+ }
if ($rootScope.platformOS == 'desktop') {
NVR.log ("---> Hacked up waked detection...");
detectWake();
@@ -1637,6 +1643,25 @@ angular.module('zmApp', [
},3000);
+ function keyboardHandler(evt) {
+ if (evt.metaKey || evt.ctrlKey) {
+ if (evt.keyCode == 76) {
+ evt.preventDefault();
+ NVR.log ("****** Lock pressed ******");
+ $ionicHistory.nextViewOptions({
+ disableAnimate: true
+ });
+ if ($state.current.name != 'app.zm-portal-login') {
+ $state.go ('app.zm-portal-login');
+ }
+ else {
+ NVR.log ("Already at portal, not going again");
+ }
+
+ }
+ }
+ }
+
// credit: https://blog.alexmaccaw.com/javascript-wake-event
function detectWake() {
var TIMEOUT = 10000;