summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/js/WizardCtrl.js31
-rw-r--r--www/templates/wizard.html7
2 files changed, 24 insertions, 14 deletions
diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js
index 8dacfee7..d1bd9da9 100644
--- a/www/js/WizardCtrl.js
+++ b/www/js/WizardCtrl.js
@@ -9,6 +9,10 @@ $scope.openMenu = function () {
+
+ //--------------------------------------------------------------------------
+ // tags a protocol
+ //--------------------------------------------------------------------------
function addhttp(url) {
if ((!/^(f|ht)tps?:\/\//i.test(url)) && (url != "")) {
@@ -17,16 +21,10 @@ $scope.openMenu = function () {
return url;
}
- function validURL(url)
- {
- if (!url)
-
- return ({status:false, code:"URL cannot be empty"});
- url = addhttp(url);
- return ({status:true, code:""});
-
- }
+ //--------------------------------------------------------------------------
+ // exit validator for auth wizard
+ //--------------------------------------------------------------------------
$scope.exitAuth = function()
{
@@ -75,6 +73,10 @@ $scope.openMenu = function () {
};
+ //--------------------------------------------------------------------------
+ // validator for portal url wizard
+ //--------------------------------------------------------------------------
+
$scope.exitPortal = function()
{
ZMDataModel.zmLog ("Wizard: validating portal url syntax");
@@ -125,6 +127,9 @@ $scope.openMenu = function () {
return true;
};
+ //--------------------------------------------------------------------------
+ // part of auth wizard - toggles display of auth components
+ //--------------------------------------------------------------------------
$scope.toggleAuth = function()
{
$scope.wizard.useauth = !$scope.wizard.useauth;
@@ -136,6 +141,9 @@ $scope.openMenu = function () {
};
+ //--------------------------------------------------------------------------
+ // global tip toggler for all wizard steps
+ //--------------------------------------------------------------------------
$scope.toggleTip = function()
{
$scope.wizard.tipshow = !$scope.wizard.tipshow;
@@ -146,7 +154,10 @@ $scope.openMenu = function () {
};
- $scope.$on('$ionicView.enter', function () {
+ //--------------------------------------------------------------------------
+ // initial
+ //--------------------------------------------------------------------------
+ $scope.$on('$ionicView.beforeEnter', function () {
//console.log("**VIEW ** Help Ctrl Entered");
$scope.wizard = {
diff --git a/www/templates/wizard.html b/www/templates/wizard.html
index ee29fe21..5b491d8c 100644
--- a/www/templates/wizard.html
+++ b/www/templates/wizard.html
@@ -2,8 +2,6 @@
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" ng-click="openMenu()"></button>
-
-
</ion-nav-buttons>
@@ -11,6 +9,7 @@
<wizard on-finish="finishedWizard()">
+ <!-- portal url -->
<wz-step wz-title="1" canexit="exitPortal">
<h4>Welcome to zmWizard</h4>
<p>Configuring ZoneMinder can be a pain. Lets see if zmWizard can help. In the next few screens, I will ask you some simple questions and do my best to guess the settings for you.</p>
@@ -34,7 +33,7 @@
</wz-step>
-
+ <!-- auth mode -->
<wz-step wz-title="2" canexit="exitAuth" >
<h4>Portal Authentication</h4>
<p>Lets talk about how you have configured authentication If you have enabled authentication, toggle this button</p>
@@ -76,7 +75,7 @@
</wz-step>
-
+ <!-- validate url with auth -->
<wz-step wz-title="3">
<h4>Lets try and validate your inputs</h4>
<p>I am now going to try and log into the portal using: