summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/android.json7
-rw-r--r--plugins/fetch.json9
-rw-r--r--plugins/ios.json7
-rw-r--r--www/js/DataModel.js12
-rw-r--r--www/js/LogCtrl.js5
-rw-r--r--www/js/MontageCtrl.js27
-rw-r--r--www/templates/montage.html4
7 files changed, 57 insertions, 14 deletions
diff --git a/plugins/android.json b/plugins/android.json
index f7dfb126..73a49662 100644
--- a/plugins/android.json
+++ b/plugins/android.json
@@ -47,6 +47,10 @@
{
"xml": "<feature name=\"EmailComposer\"><param name=\"android-package\" value=\"de.appplant.cordova.emailcomposer.EmailComposer\" /></feature>",
"count": 1
+ },
+ {
+ "xml": "<feature name=\"AppVersion\"><param name=\"android-package\" value=\"uk.co.whiteoctober.cordova.AppVersion\" /></feature>",
+ "count": 1
}
]
}
@@ -96,6 +100,9 @@
},
"de.appplant.cordova.plugin.email-composer": {
"PACKAGE_NAME": "com.pliablepixels.zmninja"
+ },
+ "uk.co.whiteoctober.cordova.appversion": {
+ "PACKAGE_NAME": "com.pliablepixels.zmninja"
}
},
"dependent_plugins": {}
diff --git a/plugins/fetch.json b/plugins/fetch.json
index c8047072..ef371f01 100644
--- a/plugins/fetch.json
+++ b/plugins/fetch.json
@@ -92,5 +92,14 @@
},
"is_top_level": true,
"variables": {}
+ },
+ "uk.co.whiteoctober.cordova.appversion": {
+ "source": {
+ "type": "git",
+ "url": "https://github.com/whiteoctober/cordova-plugin-app-version.git",
+ "subdir": "."
+ },
+ "is_top_level": true,
+ "variables": {}
}
}
diff --git a/plugins/ios.json b/plugins/ios.json
index 4cb3e0ad..54dfadfc 100644
--- a/plugins/ios.json
+++ b/plugins/ios.json
@@ -51,6 +51,10 @@
{
"xml": "<feature name=\"EmailComposer\"><param name=\"ios-package\" value=\"APPEmailComposer\" /></feature>",
"count": 1
+ },
+ {
+ "xml": "<feature name=\"AppVersion\"><param name=\"ios-package\" value=\"AppVersion\" /></feature>",
+ "count": 1
}
]
}
@@ -118,6 +122,9 @@
},
"de.appplant.cordova.plugin.email-composer": {
"PACKAGE_NAME": "com.pliablepixels.zmninja"
+ },
+ "uk.co.whiteoctober.cordova.appversion": {
+ "PACKAGE_NAME": "com.pliablepixels.zmninja"
}
},
"dependent_plugins": {}
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index 3de0f781..4ebd9ed6 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -9,6 +9,7 @@
angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ionicLoading', '$ionicBackdrop', '$fileLogger', function ($http, $q, $ionicLoading, $ionicBackdrop,$fileLogger) {
+ var zmAppVersion="unknown";
var monitorsLoaded = 0;
var montageSize = 3;
var monitors = [];
@@ -144,7 +145,6 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion
return 0; {}
},
-
getLogin: function () {
return loginData;
},
@@ -153,6 +153,16 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion
return (loginData.keepAwake == '1') ? true:false;
},
+ setAppVersion:function(ver) {
+ zmAppVersion = ver;
+ },
+
+ getAppVersion:function() {
+ return(zmAppVersion);
+ },
+
+
+
//------------------------------------------------------------------
// switches screen to 'always on' or 'auto'
//------------------------------------------------------------------
diff --git a/www/js/LogCtrl.js b/www/js/LogCtrl.js
index 92b0aaad..942bd8da 100644
--- a/www/js/LogCtrl.js
+++ b/www/js/LogCtrl.js
@@ -7,7 +7,10 @@ angular.module('zmApp.controllers').controller('zmApp.LogCtrl', ['$scope', '$roo
$ionicSideMenuDelegate.toggleLeft();
};
-
+ //---------------------------------------------------------------
+ // Controller main
+ //---------------------------------------------------------------
+ $scope.zmAppVersion = ZMDataModel.getAppVersion();
//--------------------------------------------------------------------------
diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js
index 1c0c7b90..9bee1a89 100644
--- a/www/js/MontageCtrl.js
+++ b/www/js/MontageCtrl.js
@@ -17,6 +17,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '
var timestamp = new Date().getUTCMilliseconds();
$scope.minimal = $stateParams.minimal;
$scope.isRefresh = $stateParams.isRefresh;
+ var sizeInProgress = false;
var isLongPressActive = false;
var intervalHandleMontage; // will hold image resize timer on long press
@@ -291,11 +292,14 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '
// and stores current size to persistent memory
//---------------------------------------------------------
- function processSliderChanged()
+ function processSliderChanged(val)
{
- console.log('Slider has changed');
- ZMDataModel.setMontageSize($scope.slider.monsize);
- console.log("Rootscope Montage is " + ZMDataModel.getMontageSize() +
+ if (sizeInProgress) return;
+
+ sizeInProgress = true;
+ console.log('Size has changed');
+ ZMDataModel.setMontageSize(val);
+ console.log("ZMData Montage is " + ZMDataModel.getMontageSize() +
" and slider montage is " + $scope.slider.monsize);
// Now go ahead and reset sizes of entire monitor array
var monsizestring="";
@@ -311,6 +315,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '
monsizestring = monsizestring.slice(0,-1); // kill last :
console.log ("Setting monsize string:"+monsizestring);
window.localStorage.setItem("montageArraySize", monsizestring);
+ sizeInProgress = false;
}
//---------------------------------------------------------
@@ -320,10 +325,13 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '
$scope.changeSize = function (val)
{
- $scope.slider.monsize += val;
- if ($scope.slider.monsize < 1) $scope.slider.monsize = 1;
- if ($scope.slider.monsize > 6) $scope.slider.monsize = 6;
- processSliderChanged();
+ var newSize = parseInt($scope.slider.monsize) + val;
+
+ $scope.slider.monsize = newSize;
+ if ($scope.slider.monsize < "1") $scope.slider.monsize = "1";
+ if ($scope.slider.monsize > "6") $scope.slider.monsize = "6";
+ processSliderChanged($scope.slider.monsize);
+
};
//---------------------------------------------------------
@@ -335,8 +343,7 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', '
$scope.sliderChanged = function ()
{
- processSliderChanged();
-
+ processSliderChanged($scope.slider.monsize);
};
$scope.$on('$ionicView.afterEnter', function () {
diff --git a/www/templates/montage.html b/www/templates/montage.html
index e1403aa7..213eeda6 100644
--- a/www/templates/montage.html
+++ b/www/templates/montage.html
@@ -17,7 +17,7 @@
<div class=" range range-positive">
<i class="icon ion-arrow-shrink"></i>
- <input type="range" ng-model="slider.monsize" min="1" max="6" ng-change="sliderChanged()">
+ <input type="range" ng-model="slider.monsize" min="1" max="6" ng-change="sliderChanged(slider.monsize)">
<i class="icon ion-arrow-expand"></i>
</div>
@@ -32,7 +32,7 @@
</span>
<article class="main">
<!-- FIXME: Scale is 50% hardcoded -->
- <img ng-src="{{LoginData.streamingurl}}/cgi-bin/zms?mode=single&monitor={{monitor.Monitor.Id}}&maxfps={{LoginData.maxFPS}}&scale=50&user={{LoginData.username}}&pass={{LoginData.password}}&rand={{randomval}}" width="{{((devWidth-30)/(7-monitorSize[$index]))}}px;" ng-click="openModal(monitor.Monitor.Id, monitor.Monitor.Controllable, monitor.Monitor.ControlId)" on-hold="onHold($index)" on-release="onRelease($index)" />
+ <img ng-src="{{LoginData.streamingurl}}/cgi-bin/zms?mode=single&monitor={{monitor.Monitor.Id}}&maxfps={{LoginData.maxFPS}}&scale=50&user={{LoginData.username}}&pass={{LoginData.password}}&rand={{randomval}}" width="{{((devWidth)/(7-monitorSize[$index]))}}px;" ng-click="openModal(monitor.Monitor.Id, monitor.Monitor.Controllable, monitor.Monitor.ControlId)" on-hold="onHold($index)" on-release="onRelease($index)" />
</article>