Skip to content

Commit

Permalink
UI-243: Added a control to display the password strength on a passwor…
Browse files Browse the repository at this point in the history
…d input.
  • Loading branch information
mroux committed Apr 20, 2015
1 parent ed89e17 commit 35f81aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 4 additions & 0 deletions submodules/users/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ define(function(require){
}
});

monster.ui.showPasswordStrength(userTemplate.find('#password'));

userTemplate.find('#create_user').on('click', function() {
if(monster.ui.valid(userTemplate.find('#form_user_creation'))) {
var dataForm = monster.ui.getFormData('form_user_creation'),
Expand Down Expand Up @@ -775,6 +777,8 @@ define(function(require){
var passwordTemplate = $(monster.template(self, 'users-changePassword', currentUser)),
form = passwordTemplate.find('#form_new_username');

monster.ui.showPasswordStrength(passwordTemplate.find('#inputPassword'));

passwordTemplate.find('.save-new-username').on('click', function() {
var formData = monster.ui.getFormData('form_new_username'),
userToSave = $.extend(true, {}, currentUser, formData);
Expand Down
3 changes: 1 addition & 2 deletions views/users-changePassword.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
<div class="control-group">
<label class="control-label" for="inputPassword">{{ i18n.users.dialogChangePassword.password }}</label>
<div class="controls">
<input required minlength="8" name="password" type="password" id="inputPassword" placeholder="{{ i18n.users.dialogChangePassword.passwordPlaceholder }}">
<input name="password" type="password" id="inputPassword" placeholder="{{ i18n.users.dialogChangePassword.passwordPlaceholder }}">
</div>
</div>
</form>

{{#monsterText}}
{{i18n.users.dialogChangePassword.help}}
{{/monsterText}}
Expand Down
2 changes: 1 addition & 1 deletion views/users-creation.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="control-group">
<label class="control-label" for="password"><i class="icon-unlock"></i></label>
<div class="controls">
<input required minlength="8" type="password" name="user.password" id="password" placeholder="{{i18n.users.dialogCreationUser.password}}"/>
<input type="password" name="user.password" id="password" placeholder="{{i18n.users.dialogCreationUser.password}}"/>
</div>
</div>
</div>
Expand Down

0 comments on commit 35f81aa

Please sign in to comment.