summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/ImportantMessageCtrl.js33
-rw-r--r--www/js/PortalLoginCtrl.js9
-rw-r--r--www/js/app.js12
3 files changed, 53 insertions, 1 deletions
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',
+
+ })