diff options
| -rwxr-xr-x | checkperms.sh | 8 | ||||
| -rw-r--r-- | config.xml | 1 | ||||
| -rw-r--r-- | plugins/fetch.json | 34 | ||||
| -rw-r--r-- | www/js/LogCtrl.js | 30 | ||||
| -rw-r--r-- | www/js/MonitorModalCtrl.js | 51 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 3 | ||||
| -rw-r--r-- | www/js/TimelineCtrl.js | 1 | ||||
| -rw-r--r-- | www/templates/monitors-modal.html | 5 |
8 files changed, 107 insertions, 26 deletions
diff --git a/checkperms.sh b/checkperms.sh new file mode 100755 index 00000000..b5f92c5b --- /dev/null +++ b/checkperms.sh @@ -0,0 +1,8 @@ +#!/bin/sh +if [ -z "$1" ]; then + FILE="platforms/android/build/outputs/apk/android-debug.apk" +else + FILE="$1" +fi +echo "*** Permissions for $FILE ***" +`echo $ANDROID_HOME`/build-tools/23.0.1/aapt d permissions $FILE @@ -12,6 +12,7 @@ <access origin="*" subdomains="true" /> <allow-navigation href="*" /> <allow-intent href="*" /> + <access origin="mailto:*" launch-external="yes"/> <preference name="xwalkCommandLine" value="--disable-pull-to-refresh-effect" /> <preference name="xwalkMode" value="embedded" /> <preference name="xwalkMultipleApk" value="true" /> diff --git a/plugins/fetch.json b/plugins/fetch.json index 029d3a7b..f4230c96 100644 --- a/plugins/fetch.json +++ b/plugins/fetch.json @@ -115,39 +115,57 @@ "is_top_level": true, "variables": {} }, - "cordova-plugin-media": { + "com.telerik.plugins.nativepagetransitions": { "source": { "type": "git", - "url": "https://github.com/pliablepixels/cordova-plugin-media", + "url": "https://github.com/Telerik-Verified-Plugins/NativePageTransitions", "subdir": "." }, "is_top_level": true, "variables": {} }, - "com.telerik.plugins.nativepagetransitions": { + "cordova-plugin-globalization": { "source": { "type": "git", - "url": "https://github.com/Telerik-Verified-Plugins/NativePageTransitions", + "url": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization.git", "subdir": "." }, "is_top_level": true, "variables": {} }, - "cordova-plugin-email-composer": { + "cordova-plugin-connectsdk": { "source": { "type": "registry", - "id": "cordova-plugin-email-composer" + "id": "cordova-plugin-connectsdk" }, "is_top_level": true, "variables": {} }, - "cordova-plugin-globalization": { + "cordova-plugin-console": { + "source": { + "type": "registry", + "id": "cordova-plugin-console" + }, + "is_top_level": true, + "variables": {} + }, + "com.jcjee.plugins.emailcomposer": { "source": { "type": "git", - "url": "https://git-wip-us.apache.org/repos/asf/cordova-plugin-globalization.git", + "url": "https://github.com/jcjee/email-composer", "subdir": "." }, "is_top_level": true, "variables": {} + }, + "org.apache.cordova.media": { + "source": { + "type": "git", + "url": "https://github.com/pliablepixels/cordova-plugin-media", + "subdir": ".", + "ref": "playback-only" + }, + "is_top_level": true, + "variables": {} } }
\ No newline at end of file diff --git a/www/js/LogCtrl.js b/www/js/LogCtrl.js index 6a366902..f7c2f66a 100644 --- a/www/js/LogCtrl.js +++ b/www/js/LogCtrl.js @@ -2,7 +2,7 @@ /* jslint browser: true*/ /* global saveAs, cordova,StatusBar,angular,console,moment */ -angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$rootScope','zm', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$fileLogger', '$cordovaEmailComposer', '$ionicPopup', '$timeout', '$ionicHistory', '$state', '$interval', '$ionicLoading', '$tranaslate', function ($scope, $rootScope,zm, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $fileLogger, $cordovaEmailComposer, $ionicPopup, $timeout, $ionicHistory, $state, $interval, $ionicLoading, $translate) { +angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$rootScope','zm', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$fileLogger', '$cordovaEmailComposer', '$ionicPopup', '$timeout', '$ionicHistory', '$state', '$interval', '$ionicLoading', '$translate', function ($scope, $rootScope,zm, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $fileLogger, $cordovaEmailComposer, $ionicPopup, $timeout, $ionicHistory, $state, $interval, $ionicLoading, $translate) { $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); }; @@ -88,8 +88,11 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo //-------------------------------------------------------------------------- function sendEmailReally(logstring) { if (window.cordova) { + + + - $cordovaEmailComposer.isAvailable().then(function () { + // do my best to replace sensitive information var loginData = ZMDataModel.getLogin(); @@ -122,21 +125,11 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo logstring = logstring.replace(re4, "<server>"); } - var email = { - to: zm.authoremail, - subject: $rootScope.appName + ' Logs', - body: logstring, - isHtml: false - }; - $cordovaEmailComposer.open(email) - .then(null, function () { - // user cancelled email - }); - }, function () { - ZMDataModel.zmLog("Email plugin not found", "error"); - }); + window.plugins.emailComposer.showEmailComposerWithCallback(callback,$rootScope.appName+' logs',logstring,[zm.authoremail]); + + } else { - console.log("Using default email client to send data"); + // console.log("Using default email client to send data"); var fname = $rootScope.appName+"-logs-" + moment().format('MMM-DD-YY_HH-mm-ss') + ".txt"; @@ -148,6 +141,11 @@ saveAs(blob, fname); } + function callback () + { + console.log ("EMAIL SENT"); + } + function loadLogs() { //console.log ("GETTING LOGS"); diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js index ddc2f3e2..ebdc5326 100644 --- a/www/js/MonitorModalCtrl.js +++ b/www/js/MonitorModalCtrl.js @@ -1,7 +1,7 @@ // Common Controller for the montage view /* jshint -W041 */ /* jslint browser: true*/ -/* global saveAs, cordova,StatusBar,angular,console,ionic, moment, imagesLoaded */ +/* global saveAs, cordova,StatusBar,angular,console,ionic, moment, imagesLoaded, ConnectSDK */ @@ -192,6 +192,55 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ }); + + $scope.cast = function(mid, mon) + { + + console.log ("PASSED WITH " + JSON.stringify(mon)); + //ConnectSDK.discoveryManager.startDiscovery(); + ConnectSDK.discoveryManager.startDiscovery(); + ConnectSDK.discoveryManager.pickDevice() + .success(function (device) { + //device.disconnect(); + function sendVideo (mid,mon) { + //device.getMediaPlayer().playMedia("http://media.w3.org/2010/05/sintel/trailer.mp4", "video/mp4"); + + // var url = "http://www.connectsdk.com/files/9613/9656/8539/test_image.jpg"; + + //var url = mon.Monitor.streamingURL+"/nph-zms?mode=jpeg&monitor="+mid+$rootScope.authSession+"&rand="+$rootScope.modalRand; + + var ld = ZMDataModel.getLogin(); + var url = mon.Monitor.streamingURL+"/nph-zms?mode=jpeg&monitor="+mid+"&user="+ld.username+"&pass="+ld.password+"&rand="+$rootScope.modalRand; + + console.log ("URL: " + url); + var iconUrl = "http://www.connectsdk.com/files/9613/9656/8539/test_image.jpg"; + var mimeType = "image/jpeg"; + + device.getMediaPlayer().displayImage(url, mimeType, { + title: "Monitor: "+mid, + description: "Monitor feed", + }).success(function (launchSession, mediaControl) { + console.log("Image launch successful"); + }).error(function (err) { + console.log("error: " + err.message); + }); + } + + if (device.isReady()) { // already connected + console.log (">>> device ready sending video"); + sendVideo(mid,mon); + } else { + device.on("ready", function() {sendVideo(mid,mon);}); + console.log (">>> device not ready connecting"); + device.connect(); + } + }) + .error ( + function (error) { + console.log ("ERROR"); + }); + }; + //------------------------------------------------------------- // PTZ enable/disable //------------------------------------------------------------- diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index e58af3c5..54ab982c 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -1,7 +1,7 @@ // Controller for the montage view /* jshint -W041 */ /* jslint browser: true*/ -/* global cordova,StatusBar,angular,console,ionic,Packery, Draggabilly, imagesLoaded */ +/* global cordova,StatusBar,angular,console,ionic,Packery, Draggabilly, imagesLoaded, ConnectSDK */ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '$rootScope', 'ZMDataModel', 'message', '$ionicSideMenuDelegate', '$timeout', '$interval', '$ionicModal', '$ionicLoading', '$http', '$state', '$ionicPopup', '$stateParams', '$ionicHistory', '$ionicScrollDelegate', '$ionicPlatform', 'zm', '$ionicPopover', '$controller', 'imageLoadingDataShare', '$window', '$localstorage', '$translate', function ($scope, $rootScope, ZMDataModel, message, $ionicSideMenuDelegate, $timeout, $interval, $ionicModal, $ionicLoading, $http, $state, $ionicPopup, $stateParams, $ionicHistory, $ionicScrollDelegate, $ionicPlatform, zm, $ionicPopover, $controller, imageLoadingDataShare, $window, $localstorage, $translate) { @@ -28,6 +28,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' // Handling of back button in case modal is open should // close the modal // -------------------------------------------------------- + $ionicPlatform.registerBackButtonAction(function (e) { e.preventDefault(); diff --git a/www/js/TimelineCtrl.js b/www/js/TimelineCtrl.js index 9261130d..b7a11c98 100644 --- a/www/js/TimelineCtrl.js +++ b/www/js/TimelineCtrl.js @@ -881,6 +881,7 @@ angular.module('zmApp.controllers').controller('zmApp.TimelineCtrl', ['$ionicPla empty: false, onclick: function () { + move(0.2); } diff --git a/www/templates/monitors-modal.html b/www/templates/monitors-modal.html index 064b2ff8..dc16a223 100644 --- a/www/templates/monitors-modal.html +++ b/www/templates/monitors-modal.html @@ -111,6 +111,11 @@ <li> <a href="" ng-click="enableAlarm(monitorId,false)"> <i class="icon ion-flash-off"></i></a> </li> + + <li> + <a href="" ng-click="cast(monitorId, monitor)"> <i class="icon ion-android-funnel"></i></a> + </li> + |
