add config
This commit is contained in:
parent
70441e0aad
commit
eb2270a2d1
4 changed files with 18 additions and 12 deletions
|
|
@ -73,6 +73,8 @@ var defaultConfig = {
|
||||||
salt: 'jBbYTj8zTrOt6V',
|
salt: 'jBbYTj8zTrOt6V',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
minPasswordStrength: 4,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
GoogleDrive: {
|
GoogleDrive: {
|
||||||
home: 'copay',
|
home: 'copay',
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ angular.module('copayApp.controllers').controller('CreateProfileController', fun
|
||||||
|
|
||||||
$scope.createStep = 'storage';
|
$scope.createStep = 'storage';
|
||||||
$scope.useLocalstorage = false;
|
$scope.useLocalstorage = false;
|
||||||
|
$scope.minPasswordStrength = _.isUndefined(config.minPasswordStrength) ?
|
||||||
|
4 : config.minPasswordStrength;
|
||||||
|
|
||||||
pinService.makePinInput($scope, 'newpin', function(newValue) {
|
pinService.makePinInput($scope, 'newpin', function(newValue) {
|
||||||
_firstpin = newValue;
|
_firstpin = newValue;
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ angular.module('copayApp.directives')
|
||||||
|
|
||||||
var MIN_LENGTH = 8;
|
var MIN_LENGTH = 8;
|
||||||
var MESSAGES = ['Very Weak', 'Very Weak', 'Weak', 'Medium', 'Strong', 'Very Strong'];
|
var MESSAGES = ['Very Weak', 'Very Weak', 'Weak', 'Medium', 'Strong', 'Very Strong'];
|
||||||
var COLOR = ['#dd514c', '#dd514c', '#faa732', '#faa732', '#5eb95e', '#5eb95e'];
|
var COLOR = ['#dd514c', '#dd514c', '#faa732', '#faa732', '#16A085', '#16A085'];
|
||||||
|
|
||||||
function evaluateMeter(password) {
|
function evaluateMeter(password) {
|
||||||
var passwordStrength = 0;
|
var passwordStrength = 0;
|
||||||
|
|
|
||||||
|
|
@ -147,21 +147,23 @@
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form ng-show="createStep == 'pass'" name="passForm" ng-submit="createProfile(passForm)" novalidate>
|
<form ng-show="createStep == 'pass'" name="passForm" ng-submit="createProfile(passForm)" novalidate>
|
||||||
|
|
||||||
|
<div class="box-notification" ng-show="passwordStrength">
|
||||||
|
<div class="box-icon" style="background-color:{{passwordStrength.color}}">
|
||||||
|
<i class="fi-x size-24" ng-if="passwordStrength.strength< minPasswordStrength"></i>
|
||||||
|
<i class="fi-check size-24" ng-if="passwordStrength.strength >= minPasswordStrength"></i>
|
||||||
|
</div>
|
||||||
|
<span class="size-14" >
|
||||||
|
Password Strength: {{passwordStrength.message}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input id="password" type="password" ng-model="$parent.password" class="form-control" name="password" placeholder="{{'Choose a password'|translate}}" check-strength="passwordStrength" >
|
<input id="password" type="password" ng-model="$parent.password" class="form-control" name="password" placeholder="{{'Choose a password'|translate}}" check-strength="passwordStrength" >
|
||||||
<i class="icon-locked"></i>
|
<i class="icon-locked"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="box-notification" ng-show="passwordStrength">
|
|
||||||
<div class="box-icon" style="background-color:{{passwordStrength.color}}">
|
|
||||||
<i class="fi-x size-24" ng-if="passwordStrength.strength<4"></i>
|
|
||||||
<i class="fi-check size-24" ng-if="passwordStrength.strength>3"></i>
|
|
||||||
</div>
|
|
||||||
<span class="size-14" >
|
|
||||||
Password Strength: {{passwordStrength.message}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<input type="password" ng-model="repeatpassword" class="input form-control" name="repeatpassword" placeholder="{{'Repeat password'|translate}}" match="password" required>
|
<input type="password" ng-model="repeatpassword" class="input form-control" name="repeatpassword" placeholder="{{'Repeat password'|translate}}" match="password" required>
|
||||||
|
|
@ -178,7 +180,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button translate type="submit" class="button primary radius expand m0" ng-disabled="passForm.$invalid">
|
<button translate type="submit" class="button primary radius expand m0" ng-disabled="passForm.$invalid || passwordStrength.strength < minPasswordStrength">
|
||||||
Create Profile
|
Create Profile
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue