mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #5506 from JDonadio/ref/match-passwords-03
Export wallet - password hinting
This commit is contained in:
commit
b896c75f3d
|
@ -16,6 +16,17 @@ angular.module('copayApp.controllers').controller('exportController',
|
||||||
}, 10);
|
}, 10);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.checkPassword = function(pw1, pw2) {
|
||||||
|
if (pw1.length > 0) {
|
||||||
|
if (pw2.length > 0) {
|
||||||
|
if (pw1 == pw2) $scope.result = 'correct';
|
||||||
|
else $scope.result = 'incorrect';
|
||||||
|
} else
|
||||||
|
$scope.result = null;
|
||||||
|
} else
|
||||||
|
$scope.result = null;
|
||||||
|
};
|
||||||
|
|
||||||
function getPassword(cb) {
|
function getPassword(cb) {
|
||||||
if ($scope.password) return cb(null, $scope.password);
|
if ($scope.password) return cb(null, $scope.password);
|
||||||
|
|
||||||
|
@ -57,6 +68,7 @@ angular.module('copayApp.controllers').controller('exportController',
|
||||||
|
|
||||||
var init = function() {
|
var init = function() {
|
||||||
$scope.formData = {};
|
$scope.formData = {};
|
||||||
|
$scope.formData.password = $scope.formData.repeatpassword = '';
|
||||||
$scope.isEncrypted = wallet.isPrivKeyEncrypted();
|
$scope.isEncrypted = wallet.isPrivKeyEncrypted();
|
||||||
$scope.isCordova = platformInfo.isCordova;
|
$scope.isCordova = platformInfo.isCordova;
|
||||||
$scope.isSafari = platformInfo.isSafari;
|
$scope.isSafari = platformInfo.isSafari;
|
||||||
|
@ -214,6 +226,7 @@ angular.module('copayApp.controllers').controller('exportController',
|
||||||
};
|
};
|
||||||
$scope.formData.exportWalletInfo = null;
|
$scope.formData.exportWalletInfo = null;
|
||||||
$scope.password = null;
|
$scope.password = null;
|
||||||
|
$scope.result = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,4 +12,19 @@
|
||||||
border-bottom-width: 2px;
|
border-bottom-width: 2px;
|
||||||
border-bottom-color: #172565;
|
border-bottom-color: #172565;
|
||||||
}
|
}
|
||||||
|
input[type="password"] {
|
||||||
|
border: none;
|
||||||
|
margin-left: -5px;
|
||||||
|
padding-left: 4px;
|
||||||
|
&.incorrect {
|
||||||
|
padding-left: 3px;
|
||||||
|
border: 1px solid;
|
||||||
|
color: #C90505;
|
||||||
|
}
|
||||||
|
&.correct {
|
||||||
|
padding-left: 3px;
|
||||||
|
border: 1px solid;
|
||||||
|
color: #00901B;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,14 @@
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<label class="item item-input item-stacked-label">
|
<label class="item item-input item-stacked-label">
|
||||||
<span class="input-label" translate>Set up a password</span>
|
<span class="input-label" translate>Set up a password</span>
|
||||||
<input type="password" placeholder="{{'Your password'|translate}}" ng-model="formData.password">
|
<input type="password" placeholder="{{'Your password'|translate}}" ng-model="formData.password" ng-change="checkPassword(formData.password, formData.repeatpassword)"
|
||||||
|
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="item item-input item-stacked-label">
|
<label class="item item-input item-stacked-label">
|
||||||
<span class="input-label" translate>Repeat the password</span>
|
<span class="input-label" translate>Repeat the password</span>
|
||||||
<input type="password" placeholder="{{'Repeat password'|translate}}" ng-model="formData.repeatpassword">
|
<input type="password" placeholder="{{'Repeat password'|translate}}" ng-model="formData.repeatpassword" ng-change="checkPassword(formData.repeatpassword, formData.password)"
|
||||||
|
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div ng-show="canSign">
|
<div ng-show="canSign">
|
||||||
|
|
Loading…
Reference in New Issue