From f6ff80802debe55c522ab1c4f0212022ada48ceb Mon Sep 17 00:00:00 2001 From: pliablepixels Date: Sat, 30 Jan 2016 06:54:06 -0500 Subject: #155 - added a screen to show relevant messages (such as this issue) Former-commit-id: dc9c94c6cbf491ca6b29f514acb0cfebe9f8b187 --- www/index.html | 1 + www/js/ImportantMessageCtrl.js | 33 +++++++++++++++++++++++++++++ www/js/PortalLoginCtrl.js | 9 +++++++- www/js/app.js | 12 +++++++++++ www/templates/important_message.html | 41 ++++++++++++++++++++++++++++++++++++ 5 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 www/js/ImportantMessageCtrl.js create mode 100644 www/templates/important_message.html (limited to 'www') 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 @@ + 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 @@ + + + + + + +
+
+
+
+
+ +
+ + +
+ +

Important Message

+
+

I'd appreciate if you upgraded ZoneMinder

+
+ You are running v{{currentVersion}}.
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. +
+ Reported Version: v{{currentVersion}}
+ Recommended Version:v{{recommendedVersion}}

+ + + + +
+
+
+ + + +
+ +
+
\ No newline at end of file -- cgit v1.2.3