From 37f7c4d1a354e3fdd6e1172d3955abafe1e0808f Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Thu, 9 Apr 2015 11:19:37 -0400 Subject: [PATCH] remove pwdmeter --- awx/ui/static/js/shared/directives.js | 31 --------- awx/ui/static/js/shared/form-generator.js | 76 +---------------------- 2 files changed, 1 insertion(+), 106 deletions(-) diff --git a/awx/ui/static/js/shared/directives.js b/awx/ui/static/js/shared/directives.js index 93b27bdd51..b176fa1fe6 100644 --- a/awx/ui/static/js/shared/directives.js +++ b/awx/ui/static/js/shared/directives.js @@ -9,12 +9,6 @@ * */ - - -/* global chkPass:false */ - -import {chkPass} from './pwdmeter'; - export default angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'JobsHelper']) @@ -698,31 +692,6 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job }; }]) - // - // chkPass - // - // Enables use of js/shared/pwdmeter.js to check strengh of passwords. - // See controllers/Users.js for example. - // - .directive('chkPass', [ function() { - return { - require: 'ngModel', - link: function(scope, elm, attrs, ctrl) { - $(elm).keyup(function() { - var validity = true, - score = chkPass(elm.val()); - if (elm.val()) { - validity = (score > $AnsibleConfig.password_strength) ? true : false; - } - ctrl.$setValidity('complexity', validity); - if (!scope.$$phase) { - scope.$digest(); - } - }); - } - }; - }]) - // // awRefresh // diff --git a/awx/ui/static/js/shared/form-generator.js b/awx/ui/static/js/shared/form-generator.js index b144c33714..9956f610f4 100644 --- a/awx/ui/static/js/shared/form-generator.js +++ b/awx/ui/static/js/shared/form-generator.js @@ -393,12 +393,6 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat scope[form.name + '_form'][fld].$setPristine(); scope[form.name + '_form'][fld].$setValidity('apiError', true); } - if (f.chkPass && scope[form.name + '_form'][fld]) { - scope[form.name + '_form'][fld].$setValidity('complexity', true); - $('#progbar').css({ - width: 0 - }); - } if (f.awPassMatch && scope[form.name + '_form'][fld]) { scope[form.name + '_form'][fld].$setValidity('awpassmatch', true); } @@ -779,7 +773,6 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "ng-model=\"" + fld + '" '; html += 'name="' + fld + '" '; html += (field.ngChange) ? this.attr(field, 'ngChange') : ""; - html += (field.chkPass) ? "chk-pass " : ""; html += buildId(field, fld, this.form); html += (field.controlNGClass) ? "ng-class=\"" + field.controlNGClass + "\" " : ""; html += "class=\"form-control"; @@ -848,39 +841,6 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "
\n"; - if (field.chkPass) { - // complexity error - html += "
Please enter a stronger password (see strength bar below).
\n"; - - // progress bar - html += "
\n"; - html += "
\n"; - html += "
\n"; - html += "
\n"; - - // help panel - html += HelpCollapse({ - hdr: 'Password Complexity', - content: "

A password with reasonable strength is required. As you type the password " + - "a progress bar will measure the strength. Sufficient strength is reached when the bar turns green.

" + - "

Password strength is judged using the following:

" + - "\n", - idx: this.accordion_count++, - show: null - }); - html += "
\n"; - } - // Add help panel(s) html += (field.helpCollapse) ? this.buildHelpCollapse(field.helpCollapse) : ''; @@ -933,7 +893,6 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += 'name="' + fld + '" '; html += (field.ngChange) ? this.attr(field, 'ngChange') : ""; - html += (field.chkPass) ? "chk-pass " : ""; html += buildId(field, fld, this.form); html += (field.controlNGClass) ? "ng-class='" + field.controlNGClass + "' " : ""; @@ -1010,39 +969,6 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += "
\n
\n"; - if (field.chkPass) { - // complexity error - html += "
Please enter a stronger password (see strength bar below).
\n"; - - // progress bar - html += "
\n"; - html += "
\n"; - html += "
\n"; - html += "
\n"; - - // help panel - html += HelpCollapse({ - hdr: 'Password Complexity', - content: "

A password with reasonable strength is required. As you type the password " + - "a progress bar will measure the strength. Sufficient strength is reached when the bar turns green.

" + - "

Password strength is judged using the following:

" + - "\n", - idx: this.accordion_count++, - show: null - }); - html += "
\n"; - } - // Add help panel(s) html += (field.helpCollapse) ? this.buildHelpCollapse(field.helpCollapse) : ''; } @@ -1115,7 +1041,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat html += this.attr(field, 'ngOptions'); html += (field.ngChange) ? this.attr(field, 'ngChange') : ""; html += (field.ngDisabled) ? this.attr(field, 'ngDisabled'): ""; - html += (field.ngRequired) ? this.attr(field, 'ngRequired') : ""; + html += (field.ngRequired) ? this.attr(field, 'ngRequired') : ""; html += buildId(field, fld, this.form); html += (options.mode === 'edit' && field.editRequired) ? "required " : ""; html += (options.mode === 'add' && field.addRequired) ? "required " : "";