diff options
| -rw-r--r-- | config.xml | 2 | ||||
| -rw-r--r-- | package.json | 4 | ||||
| -rw-r--r-- | www/js/DataModel.js | 4 | ||||
| -rw-r--r-- | www/js/LogCtrl.js | 100 | ||||
| -rwxr-xr-x | www/js/app.js | 10 |
5 files changed, 55 insertions, 65 deletions
@@ -145,7 +145,6 @@ <plugin name="cordova-plugin-android-fingerprint-auth" spec="^1.4.0" /> <plugin name="cordova-plugin-device" spec="^2.0.1" /> <plugin name="cordova-plugin-file" spec="^6.0.1" /> - <plugin name="cordova-plugin-media-pp-fork" spec="^1.0.2-dev" /> <plugin name="cordova-plugin-statusbar" spec="^2.4.2" /> <plugin name="cordova-library-helper-pp-fork" spec="^1.0.1" /> <plugin name="cordova-plugin-multi-window" spec="0.0.3" /> @@ -167,6 +166,7 @@ <plugin name="cordova-plugin-advanced-websocket" spec="^1.1.3" /> <plugin name="cordova-plugin-network-information" spec="^2.0.1" /> <plugin name="cordova-plugin-x-socialsharing" spec="^5.4.1" /> + <plugin name="cordova-plugin-media-pp-fork" spec="^1.0.2-dev" /> <engine name="android" spec="^6.4.0" /> <engine name="ios" spec="~4.5.5" /> </widget> diff --git a/package.json b/package.json index c6ce98da..55c21e14 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "cordova-plugin-network-information": {}, "cordova-plugin-device": {}, "cordova-plugin-file": {}, - "cordova-plugin-media-pp-fork": {}, "cordova-plugin-statusbar": {}, "cordova-library-helper-pp-fork": {}, "cordova-plugin-multi-window": {}, @@ -53,7 +52,8 @@ "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+" }, "cordova-plugin-advanced-websocket": {}, - "cordova-plugin-x-socialsharing": {} + "cordova-plugin-x-socialsharing": {}, + "cordova-plugin-media-pp-fork": {} } }, "dependencies": { diff --git a/www/js/DataModel.js b/www/js/DataModel.js index d3a48fcd..17e2a688 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -967,8 +967,8 @@ angular.module('zmApp.controllers') if (exists) { log("A cloud configuration has been found"); window.cordova.plugin.cloudsettings.load(function (cloudData) { - console.log("CLOUD DATA FOUND" + JSON.stringify(cloudData)); - debug("Cloud data retrieved is:" + JSON.stringify(cloudData)); + //console.log("CLOUD DATA FOUND" + JSON.stringify(cloudData)); + // debug("Cloud data retrieved is:" + JSON.stringify(cloudData)); if (cloudData && cloudData.defaultServerName && cloudData.serverGroupList) { log("retrieved a valid cloud config with a defaultServerName of:" + cloudData.defaultServerName); log("replacing local DB with cloud..."); diff --git a/www/js/LogCtrl.js b/www/js/LogCtrl.js index e87b8034..38cd3464 100644 --- a/www/js/LogCtrl.js +++ b/www/js/LogCtrl.js @@ -104,55 +104,45 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo }; - $scope.attachLogs = function() { - - - - var body = "zmNinja version:" + $scope.zmAppVersion + - " (" + $rootScope.platformOS + ")<br/>" + - "ZoneMinder version:" + NVRDataModel.getCurrentServerVersion(); - - - body = '<b>'+$translate.instant('kSensitiveBody')+'</b><br/><br/>'+body; - - - $fileLogger.checkFile() - .then (function (d) { - - var url = cordova.file.dataDirectory + d.name; - //url = url.replace("file://",""); - console.log ( "URL:"+url); - NVRDataModel.log ( "URL:"+url); - - - var onSuccess = function(result) { - NVRDataModel.log("Share completed? " + result.completed); // On Android apps mostly return false even while it's true - NVRDataModel.log("Shared to app: " + result.app); // On Android result.app since plugin version 5.4.0 this is no longer empty. On iOS it's empty when sharing is cancelled (result.completed=false) - }; - - var onError = function(msg) { - NVRDataModel.log("Sharing failed with message: " + msg); - }; - - window.plugins.socialsharing.shareViaEmail( - body, //body - 'zmNinja Logs attached', // subject - [zm.authoremail], //to - null, // cc - null, //bcc - [url], - onSuccess, - onError - ); - + // picks up applogs on the FS and sends an email with it + + $scope.attachLogs = function () { + var body = "zmNinja version:" + $scope.zmAppVersion + + " (" + $rootScope.platformOS + ")<br/>" + + "ZoneMinder version:" + NVRDataModel.getCurrentServerVersion(); + body = '<b>' + $translate.instant('kSensitiveBody') + '</b><br/><br/>' + body; + + $fileLogger.checkFile() + .then(function (d) { + var fileWithPath = cordova.file.dataDirectory + d.name; + NVRDataModel.log("file location:" + fileWithPath); + + var onSuccess = function (result) { + NVRDataModel.log("Share completed? " + result.completed); + NVRDataModel.log("Shared to app: " + result.app); + }; + + var onError = function (msg) { + NVRDataModel.log("Sharing failed with message: " + msg); + }; + + window.plugins.socialsharing.shareViaEmail( + body, //body + 'zmNinja Logs attached', // subject + [zm.authoremail], //to + null, // cc + null, //bcc + [fileWithPath], + onSuccess, + onError + ); + }, + function (e) { + NVRDataModel.debug("Error attaching log file:" + JSON.stringify(e)); + }); - }, - function (e) { - NVRDataModel.debug ("Error attaching log file:"+JSON.stringify(e)); - }); - }; //-------------------------------------------------------------------------- // Convenience function to send logs via email @@ -175,7 +165,7 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo var urlNoProtocol = loginData.url.replace(/.*?:\/\//, ""); if (urlNoProtocol != "") { var re2 = new RegExp(urlNoProtocol, "g"); - + logstring = logstring.replace(re2, "<server>"); } urlNoProtocol = loginData.streamingurl.replace(/.*?:\/\//, ""); @@ -309,22 +299,22 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo // reset power state on exit as if it is called after we enter another // state, that effectively overwrites current view power management needs //------------------------------------------------------------------------ - - + + $scope.$on('$ionic.beforeEnter', function () { - $scope.$on ( "process-push", function () { - NVRDataModel.debug (">> LogCtrl: push handler"); + $scope.$on("process-push", function () { + NVRDataModel.debug(">> LogCtrl: push handler"); var s = NVRDataModel.evaluateTappedNotification(); - NVRDataModel.debug("tapped Notification evaluation:"+ JSON.stringify(s)); + NVRDataModel.debug("tapped Notification evaluation:" + JSON.stringify(s)); $ionicHistory.nextViewOptions({ - disableAnimate:true, + disableAnimate: true, disableBack: true }); - $state.go(s[0],s[1],s[2]); + $state.go(s[0], s[1], s[2]); }); }); - + $scope.$on('$ionicView.enter', function () { //console.log("**VIEW ** Log Ctrl Entered"); diff --git a/www/js/app.js b/www/js/app.js index 69c1c6bc..332c4613 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -1689,7 +1689,7 @@ angular.module('zmApp', [ NVRDataModel.log ("--------->Setting up network state handlers...."); document.addEventListener("offline", onOffline, false); - document.addEventListener("online", onOffline, false); + document.addEventListener("online", onOnline, false); },3000); @@ -2205,8 +2205,8 @@ angular.module('zmApp', [ NVRDataModel.log("App is resuming from background"); NVRDataModel.log ("-->Re-registering online/offine"); - document.addEventListener("offline", onOnline, false); - document.addEventListener("online", onOffline, false); + document.addEventListener("offline", onOffline, false); + document.addEventListener("online", onOnline, false); $rootScope.isDownloading = false; @@ -2258,8 +2258,8 @@ angular.module('zmApp', [ function pauseHandler() { NVRDataModel.log ("-->Clearing online/offine"); - document.removeEventListener("offline", onOnline, false); - document.removeEventListener("online", onOffline, false); + document.removeEventListener("offline", onOffline, false); + document.removeEventListener("online", onOnline, false); NVRDataModel.setBackground(true); NVRDataModel.setJustResumed(false); |
