mirror of https://github.com/BTCPrivate/copay.git
Add password strenght tooltip
This commit is contained in:
parent
e2bb071631
commit
1a15519903
|
@ -209,7 +209,7 @@
|
|||
<h3>Join a Wallet in Creation</h3>
|
||||
<form name="joinForm" ng-submit="join(joinForm)" novalidate>
|
||||
<input type="text" class="form-control" placeholder="Paste wallet secret here" name="connectionId" ng-model="connectionId" wallet-secret required>
|
||||
<input type="password" class="form-control" placeholder="Choose your password" name="joinPassword" ng-model="joinPassword" check-strength="joinPassword" required>
|
||||
<input type="password" class="form-control" placeholder="Choose your password" name="joinPassword" ng-model="joinPassword" check-strength="passwordStrength" tooltip="Password strength: {{passwordStrength}}" tooltip-trigger="focus" required>
|
||||
<input type="text" class="form-control" placeholder="Your name (optional)" name="nickname" ng-model="nickname">
|
||||
<button type="submit" class="button primary radius" ng-disabled="joinForm.$invalid || loading" loading="Joining">Join</button>
|
||||
</form>
|
||||
|
@ -300,7 +300,7 @@
|
|||
<div class="small-12 medium-6 medium-centered large-6 large-centered columns m30v">
|
||||
<h6>Your Wallet Password<small>(doesn't need to be shared) Required</small></h6>
|
||||
<input type="password" placeholder="Choose your password" class="form-control"
|
||||
ng-model="walletPassword" check-strength="walletPassword" required>
|
||||
ng-model="walletPassword" check-strength="passwordStrength" tooltip="Password strength: {{passwordStrength}}" tooltip-trigger="focus" required>
|
||||
</div>
|
||||
<div class="small-12 medium-6 medium-centered large-6 large-centered columns m30v">
|
||||
<h6>Wallet name <small>Optional</small></h6>
|
||||
|
|
|
@ -124,7 +124,7 @@ angular.module('copay.directives')
|
|||
return {
|
||||
replace: false,
|
||||
restrict: 'EACM',
|
||||
scope: { model: '=checkStrength' },
|
||||
require: 'ngModel',
|
||||
link: function(scope, element, attrs) {
|
||||
var _grep = function(elems, callback, invert) {
|
||||
var callbackInverse,
|
||||
|
@ -146,6 +146,7 @@ angular.module('copay.directives')
|
|||
};
|
||||
|
||||
var strength = {
|
||||
messages: ['too weak', 'weak', 'weak', 'medium', 'strong'],
|
||||
colors: ['#c0392b', '#e74c3c', '#d35400', '#f39c12', '#27ae60'],
|
||||
mesureStrength: function (p) {
|
||||
var _force = 0;
|
||||
|
@ -178,14 +179,15 @@ angular.module('copay.directives')
|
|||
else if (s <= 40) { idx = 3; }
|
||||
else { idx = 4; }
|
||||
|
||||
return { idx: idx + 1, col: this.colors[idx] };
|
||||
return { idx: idx + 1, col: this.colors[idx], message: this.messages[idx] };
|
||||
}
|
||||
};
|
||||
|
||||
scope.$watch('model', function (newValue, oldValue) {
|
||||
scope.$watch(attrs.ngModel, function (newValue, oldValue) {
|
||||
if (newValue && newValue !== '') {
|
||||
var c = strength.getColor(strength.mesureStrength(newValue));
|
||||
element.css({ 'border-color': c.col })
|
||||
element.css({ 'border-color': c.col });
|
||||
scope[attrs.checkStrength] = c.message;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue