=== warnings

This commit is contained in:
Kyle Spearrin 2016-09-02 01:21:01 -04:00
parent 92e0537bed
commit 2f363c3e3a
4 changed files with 10 additions and 9 deletions

View File

@ -3,7 +3,9 @@ angular
.directive('passwordMeter', function () {
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',
scope: {
password: '=passwordMeter',
@ -12,15 +14,15 @@ angular
},
link: function (scope) {
var measureStrength = function (username, password) {
if (!password || password == username) {
if (!password || password === username) {
return 0;
}
var strength = password.length;
if (username && username !== '') {
if (username.indexOf(password) != -1) strength -= 15;
if (password.indexOf(username) != -1) strength -= username.length;
if (username.indexOf(password) !== -1) strength -= 15;
if (password.indexOf(username) !== -1) strength -= username.length;
}
if (password.length > 0 && password.length <= 4) strength += password.length;
@ -47,7 +49,6 @@ angular
case 0:
case 1:
return 'danger';
case 2:
return 'warning';
case 3:

View File

@ -13,11 +13,11 @@ angular
element.onclick = function (event) { };
element.on('click', function (event) {
var passwordElement = $(passwordViewer);
if (passwordElement && passwordElement.attr('type') == 'password') {
if (passwordElement && passwordElement.attr('type') === 'password') {
element.removeClass('fa-eye').addClass('fa-eye-slash');
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');
passwordElement.attr('type', 'password');
}

View File

@ -75,7 +75,7 @@ angular
}
var decodedToken = jwtHelper.decodeToken(token);
var twoFactor = decodedToken.authmethod == "TwoFactor";
var twoFactor = decodedToken.authmethod === "TwoFactor";
_userProfile = {
id: decodedToken.nameid,

View File

@ -99,7 +99,7 @@ angular
}
var encPieces = encValue.split('|');
if (encPieces.length != 2) {
if (encPieces.length !== 2) {
return '';
}