summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorpliablepixels <pliablepixels@gmail.com>2016-05-02 06:16:17 -0400
committerpliablepixels <pliablepixels@gmail.com>2016-05-02 06:16:17 -0400
commit046444b87be89c1fdd277c6b74ea99b2a46c1a7f (patch)
tree7b343ee594a996b2c14f94aeb95689e50c84d706 /www/js
parenta33f23116f2e06019f6debd492499a1bfe724331 (diff)
#234 - reduced wizard to 3 steps, auto populated server name
Former-commit-id: c7350db27cb0aa8d217c5599fe37b2424e0f3e3b
Diffstat (limited to 'www/js')
-rw-r--r--www/js/LoginCtrl.js1
-rw-r--r--www/js/WizardCtrl.js31
2 files changed, 23 insertions, 9 deletions
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index eb2e5583..b9d26a0a 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -209,6 +209,7 @@ angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$r
{
ZMDataModel.zmLog ("Creating new login entry for wizard");
$scope.loginData = angular.copy(ZMDataModel.getDefaultLoginObject());
+ $scope.loginData.serverName = $rootScope.wizard.serverName;
$scope.loginData.url = $rootScope.wizard.loginURL;
$scope.loginData.apiurl = $rootScope.wizard.apiURL;
$scope.loginData.streamingurl = $rootScope.wizard.streamingURL;
diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js
index 8acedb96..f8a40989 100644
--- a/www/js/WizardCtrl.js
+++ b/www/js/WizardCtrl.js
@@ -2,7 +2,7 @@
/* jslint browser: true*/
/* global cordova,StatusBar,angular,console, Masonry, URI */
-angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$rootScope', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$ionicHistory', '$state', '$ionicPopup', 'SecuredPopups', '$http', '$q', 'zm','$ionicLoading', function ($scope, $rootScope, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $ionicHistory, $state, $ionicPopup, SecuredPopups, $http, $q, zm, $ionicLoading) {
+angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$rootScope', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$ionicHistory', '$state', '$ionicPopup', 'SecuredPopups', '$http', '$q', 'zm','$ionicLoading', 'WizardHandler', function ($scope, $rootScope, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $ionicHistory, $state, $ionicPopup, SecuredPopups, $http, $q, zm, $ionicLoading, WizardHandler) {
$scope.openMenu = function () {
$ionicSideMenuDelegate.toggleLeft();
};
@@ -331,18 +331,26 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
// tries to log into the portal and then discover api and cgi-bin
//--------------------------------------------------------------------------
- $scope.exitValidate = function () {
+ function validateData() {
$rootScope.authSession = 'undefined';
$rootScope.zmCookie = '';
- $scope.portalValidText = "";
- $scope.apiValidateText = "";
- $scope.streamingValidateText = "";
+ $scope.wizard.portalValidText = "";
+ $scope.wizard.apiValidText = "";
+ $scope.wizard.streamingValidText = "";
$scope.wizard.fqportal = "";
-
+ $scope.wizard.loginURL= "";
+ $scope.wizard.apiURL= "";
+ $scope.wizard.streamingURL= "";
+ $scope.wizard.serverName = "";
+
var d = $q.defer();
var c = URI.parse($scope.wizard.portalurl);
+
+ $scope.wizard.serverName = c.host;
+ if (c.port)
+ $scope.wizard.serverName += "-"+c.port;
var b = "";
if ($scope.wizard.useauth && $scope.wizard.usebasicauth) {
@@ -452,7 +460,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
}); //finally
return d.promise;
- };
+ }
//--------------------------------------------------------------------------
@@ -514,7 +522,11 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
}
}
}
- return true;
+ // Coming here means we can go to the next step
+ // load the step
+ WizardHandler.wizard().next();
+ // start discovery;
+ validateData();
};
@@ -589,7 +601,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
// part of auth wizard - toggles display of auth components
//--------------------------------------------------------------------------
$scope.toggleAuth = function () {
- $scope.wizard.useauth = !$scope.wizard.useauth;
+
if (!$scope.wizard.useauth) {
$scope.wizard.usebasicauth = false;
$scope.wizard.usezmauth = false;
@@ -646,6 +658,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
apiColor: "",
streamingValidText: "",
streamingColor: "",
+ serverName: "",
};