summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorpliablepixels <pliablepixels@gmail.com>2016-05-05 16:19:30 -0400
committerpliablepixels <pliablepixels@gmail.com>2016-05-05 16:19:30 -0400
commit14bf9a2f52ec3bee4286e2c40d09364e3fcea978 (patch)
treec836e0d1cc14ab3e8f76f162e269ce306be17373 /www/js
parentc1e3efd55c3d36d0b9e076f5a595713cc31e34f7 (diff)
#234 - auto populate protocol, but wait for user to press next again so they can validate
Former-commit-id: 5b5dd1c88b4d4a30e5f49313559ae190ee12c0f2
Diffstat (limited to 'www/js')
-rw-r--r--www/js/WizardCtrl.js33
1 files changed, 29 insertions, 4 deletions
diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js
index ee95bf39..dd06fa91 100644
--- a/www/js/WizardCtrl.js
+++ b/www/js/WizardCtrl.js
@@ -135,6 +135,18 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
}
//--------------------------------------------------------------------------
+ // removes proto scheme from string
+ //--------------------------------------------------------------------------
+
+ function stripProto(u)
+ {
+ if (u.indexOf('://'))
+ return u.substr(u.indexOf('://')+3);
+ else
+ return u;
+ }
+
+ //--------------------------------------------------------------------------
// tries to detect cgi-bin
//--------------------------------------------------------------------------
@@ -551,11 +563,24 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
}
if (!checkscheme($scope.wizard.portalurl)) {
- $rootScope.zmPopup = SecuredPopups.show('show', {
- title: 'Whoops!',
- template: 'Please specify http:// or https:// in the url',
+
+ $scope.portalproto = [ {text:"http",value:"http://"}, {text:"https",value:"https://"}];
+ $scope.myproto = {proto:""};
+
+
+
+ $rootScope.zmPopup = $ionicPopup.show({
+ title: 'No protocol specified',
+ scope: $scope,
+ template: 'Please select: <ion-radio-fix ng-repeat="item in portalproto" ng-value="item.value" ng-model="myproto.proto">{{item.text}}</ion-radio-fix>',
buttons: [{
- text: 'Ok'
+ text: 'Ok',
+ onTap: function(e)
+ {
+ ZMDataModel.zmDebug ("Protocol selected:" + $scope.myproto.proto);
+ $scope.wizard.portalurl = $scope.myproto.proto+stripProto($scope.wizard.portalurl);
+ }
+
}]
});