password confirmation when joining and creating a wallet

This commit is contained in:
Gustavo Maximiliano Cortez 2014-07-18 17:56:50 -03:00
parent 4f57c3f696
commit b51e8b3539
4 changed files with 36 additions and 0 deletions

View File

@ -540,4 +540,8 @@ button[disabled].warning:focus,
height: 50px;
}
input.ng-invalid-match, input.ng-invalid-match:focus {
border-color: red;
}
/*-----------------------------------------------------------------*/

View File

@ -236,4 +236,20 @@ angular.module('copayApp.directives')
}
])
.directive('match', function () {
return {
require: 'ngModel',
restrict: 'A',
scope: {
match: '='
},
link: function(scope, elem, attrs, ctrl) {
scope.$watch(function() {
return (ctrl.$pristine && angular.isUndefined(ctrl.$modelValue)) || scope.match === ctrl.$modelValue;
}, function(currentValue) {
ctrl.$setValidity('match', currentValue);
});
}
};
})
;

View File

@ -21,12 +21,21 @@
<label>Your Wallet Password <small data-options="disable_for_touch:true" class="has-tip" tooltip="doesn't need to be shared">Required</small>
<input type="password" placeholder="Choose your password" class="form-control"
ng-model="$parent.walletPassword"
name="walletPassword"
check-strength="passwordStrength"
tooltip-html-unsafe="Password strength:
<i>{{passwordStrength}}</i><br/><span
class='size-12'>Tip: Use lower and uppercase, numbers and
symbols</span>"
tooltip-trigger="focus" required>
<input type="password"
placeholder="Repeat password"
name="walletPasswordConfirm"
ng-model="walletPasswordConfirm"
match="walletPassword"
required>
</label>
</div>
</div>

View File

@ -34,6 +34,13 @@
tooltip-html-unsafe="Password strength:
<i>{{passwordStrength}}</i><br/><span class='size-12'>Tip: Use lower and uppercase,
numbers and symbols</span>" tooltip-trigger="focus" required>
<input type="password"
placeholder="Repeat password"
name="joinPasswordConfirm"
ng-model="joinPasswordConfirm"
match="joinPassword" required>
<a class="back-button" ng-click="backWallet()">&laquo; Back</a>
<button type="submit" class="button primary radius" ng-disabled="joinForm.$invalid || loading" loading="Joining">Join</button>
</form>