summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/index.html1
-rw-r--r--www/js/ImportantMessageCtrl.js33
-rw-r--r--www/js/PortalLoginCtrl.js9
-rw-r--r--www/js/app.js12
-rw-r--r--www/templates/important_message.html41
5 files changed, 95 insertions, 1 deletions
diff --git a/www/index.html b/www/index.html
index 13f2076d..f844c9f2 100644
--- a/www/index.html
+++ b/www/index.html
@@ -93,6 +93,7 @@
<script src="js/TimelineCtrl.js"></script>
<script src="js/PortalLoginCtrl.js"></script>
<script src="js/LowVersionCtrl.js"></script>
+ <script src="js/ImportantMessageCtrl.js"></script>
<script src="js/EventServer.js"></script>
<script src="js/EventServerSettingsCtrl.js"></script>
<script src="js/FirstUseCtrl.js"></script>
diff --git a/www/js/ImportantMessageCtrl.js b/www/js/ImportantMessageCtrl.js
new file mode 100644
index 00000000..ae53dc06
--- /dev/null
+++ b/www/js/ImportantMessageCtrl.js
@@ -0,0 +1,33 @@
+/* jshint -W041 */
+/* jslint browser: true*/
+/* global cordova,StatusBar,angular,console */
+
+angular.module('zmApp.controllers').controller('zmApp.ImportantMessageCtrl', ['$scope','$ionicSideMenuDelegate', 'zm', '$stateParams', '$timeout','$rootScope', function ($scope,$ionicSideMenuDelegate,zm, $stateParams, $timeout, $rootScope) {
+$scope.openMenu = function () {
+ $ionicSideMenuDelegate.toggleLeft();
+ };
+
+
+
+
+ //-------------------------------------------------------------------------
+ // Controller Main
+ //------------------------------------------------------------------------
+ $scope.$on('$ionicView.enter', function () {
+ console.log("**VIEW ** LowVersion Ctrl Entered");
+ $ionicSideMenuDelegate.canDragContent(true);
+ $scope.requiredVersion = zm.minAppVersion;
+ $scope.currentVersion = $stateParams.ver;
+ $scope.recommendedVersion = zm.recommendedAppVersion;
+
+ });
+
+ $scope.openMenu = function () {
+ $timeout(function () {
+ $rootScope.stateofSlide = $ionicSideMenuDelegate.isOpen();
+ }, 500);
+
+ $ionicSideMenuDelegate.toggleLeft();
+ };
+
+}]);
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js
index d5458169..b31d07c4 100644
--- a/www/js/PortalLoginCtrl.js
+++ b/www/js/PortalLoginCtrl.js
@@ -81,12 +81,19 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
.then (function(data) {
ZMDataModel.zmLog("Got API version: " + data);
var ld = ZMDataModel.getLogin();
- if (versionCompare(data,zm.minAppVersion)==-1 && (ld.url.indexOf("arjunrc.") == -1) && data !="0.0.0")
+ if (versionCompare(data,zm.minAppVersion)==-1 && data !="0.0.0")
//if (versionCompare(data,zm.minAppVersion))
{
$state.go('lowversion', {"ver":data});
}
+
+ if (versionCompare(data,zm.recommendedAppVersion)==-1 && data !="0.0.0")
+ //if (versionCompare(data,zm.minAppVersion))
+ {
+
+ $state.go('importantmessage', {"ver":data});
+ }
});
EventServer.refresh();
diff --git a/www/js/app.js b/www/js/app.js
index 071f2783..b74c3ed4 100644
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -31,6 +31,7 @@ angular.module('zmApp', [
.constant('zm', {
minAppVersion: '1.28.107', // if ZM is less than this, the app won't work
+ recommendedAppVersion: '1.30',
minEventServerVersion: '0.5',
alarmFlashTimer: 20000, // time to flash alarm
gcmSenderId: '710936220256',
@@ -1119,6 +1120,17 @@ angular.module('zmApp', [
controller: 'zmApp.LowVersionCtrl',
})
+
+ .state('importantmessage', {
+ data: {
+ requireLogin: false
+ },
+
+ url: "/importantmessage/:ver",
+ templateUrl: "templates/important_message.html",
+ controller: 'zmApp.ImportantMessageCtrl',
+
+ })
diff --git a/www/templates/important_message.html b/www/templates/important_message.html
new file mode 100644
index 00000000..5ad922e5
--- /dev/null
+++ b/www/templates/important_message.html
@@ -0,0 +1,41 @@
+<ion-view view-title="zmNinja" hide-nav-bar="false" hide-back-button="false" cache-view="false">
+ <ion-nav-buttons side="left">
+ <button class="button button-icon button-clear ion-navicon" ng-click="openMenu()"></button>
+
+ </ion-nav-buttons>
+ <ion-content class="pin-background">
+ <div style="margin-left:20px; margin-right:20px">
+ <center>
+ <br/>
+ <br/>
+ <div id="responsive-image">
+ <img src="img/authlogo.png">
+ </div>
+
+
+ <br/>
+ <span style="color:white">
+ <h2 style="color:white" class="animated bounce">Important Message</h2>
+ <br/>
+ <h4 style="color:white">I'd appreciate if you upgraded ZoneMinder</h4>
+ <br/>
+ You are running v{{currentVersion}}.<br/> v{{recommendedVersion}} has an important fix that eliminates a bug related to network data consumption build up of zmNinja. While your version will work, I'd recommend you upgrade ZoneMinder. Till you do, please make sure you don't keep zmNinja running in the background (for Android). Thank you.
+ <br/>
+ Reported Version: <b>v{{currentVersion}}</b><br/>
+ Recommended Version:<b>v{{recommendedVersion}}</b><br/><br/>
+
+ <button class="button button-stable animated bounceInUp" ng-click="openMenu()">
+ Ok, got it
+ </button>
+
+
+ </span>
+ </center>
+ <br/>
+
+
+
+ </div>
+
+ </ion-content>
+</ion-view> \ No newline at end of file