=== warnings
This commit is contained in:
parent
92e0537bed
commit
2f363c3e3a
|
@ -3,7 +3,9 @@ angular
|
||||||
|
|
||||||
.directive('passwordMeter', function () {
|
.directive('passwordMeter', function () {
|
||||||
return {
|
return {
|
||||||
template: '<div class="progress {{outerClass}}"><div class="progress-bar progress-bar-{{valueClass}}" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="100" ng-style="{width : ( value + \'%\' ) }"><span class="sr-only">{{value}}%</span></div></div>',
|
template: '<div class="progress {{outerClass}}"><div class="progress-bar progress-bar-{{valueClass}}" ' +
|
||||||
|
+ 'role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="100" ' +
|
||||||
|
+ 'ng-style="{width : ( value + \'%\' ) }"><span class="sr-only">{{value}}%</span></div></div>',
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
scope: {
|
scope: {
|
||||||
password: '=passwordMeter',
|
password: '=passwordMeter',
|
||||||
|
@ -12,15 +14,15 @@ angular
|
||||||
},
|
},
|
||||||
link: function (scope) {
|
link: function (scope) {
|
||||||
var measureStrength = function (username, password) {
|
var measureStrength = function (username, password) {
|
||||||
if (!password || password == username) {
|
if (!password || password === username) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
var strength = password.length;
|
var strength = password.length;
|
||||||
|
|
||||||
if (username && username !== '') {
|
if (username && username !== '') {
|
||||||
if (username.indexOf(password) != -1) strength -= 15;
|
if (username.indexOf(password) !== -1) strength -= 15;
|
||||||
if (password.indexOf(username) != -1) strength -= username.length;
|
if (password.indexOf(username) !== -1) strength -= username.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (password.length > 0 && password.length <= 4) strength += password.length;
|
if (password.length > 0 && password.length <= 4) strength += password.length;
|
||||||
|
@ -47,7 +49,6 @@ angular
|
||||||
case 0:
|
case 0:
|
||||||
case 1:
|
case 1:
|
||||||
return 'danger';
|
return 'danger';
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
return 'warning';
|
return 'warning';
|
||||||
case 3:
|
case 3:
|
||||||
|
|
|
@ -13,11 +13,11 @@ angular
|
||||||
element.onclick = function (event) { };
|
element.onclick = function (event) { };
|
||||||
element.on('click', function (event) {
|
element.on('click', function (event) {
|
||||||
var passwordElement = $(passwordViewer);
|
var passwordElement = $(passwordViewer);
|
||||||
if (passwordElement && passwordElement.attr('type') == 'password') {
|
if (passwordElement && passwordElement.attr('type') === 'password') {
|
||||||
element.removeClass('fa-eye').addClass('fa-eye-slash');
|
element.removeClass('fa-eye').addClass('fa-eye-slash');
|
||||||
passwordElement.attr('type', 'text');
|
passwordElement.attr('type', 'text');
|
||||||
}
|
}
|
||||||
else if (passwordElement && passwordElement.attr('type') == 'text') {
|
else if (passwordElement && passwordElement.attr('type') === 'text') {
|
||||||
element.removeClass('fa-eye-slash').addClass('fa-eye');
|
element.removeClass('fa-eye-slash').addClass('fa-eye');
|
||||||
passwordElement.attr('type', 'password');
|
passwordElement.attr('type', 'password');
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ angular
|
||||||
}
|
}
|
||||||
|
|
||||||
var decodedToken = jwtHelper.decodeToken(token);
|
var decodedToken = jwtHelper.decodeToken(token);
|
||||||
var twoFactor = decodedToken.authmethod == "TwoFactor";
|
var twoFactor = decodedToken.authmethod === "TwoFactor";
|
||||||
|
|
||||||
_userProfile = {
|
_userProfile = {
|
||||||
id: decodedToken.nameid,
|
id: decodedToken.nameid,
|
||||||
|
|
|
@ -99,7 +99,7 @@ angular
|
||||||
}
|
}
|
||||||
|
|
||||||
var encPieces = encValue.split('|');
|
var encPieces = encValue.split('|');
|
||||||
if (encPieces.length != 2) {
|
if (encPieces.length !== 2) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue