diff --git a/src/js/controller/app/set-passphrase.js b/src/js/controller/app/set-passphrase.js index ad2fb1d..5224668 100644 --- a/src/js/controller/app/set-passphrase.js +++ b/src/js/controller/app/set-passphrase.js @@ -21,59 +21,6 @@ var SetPassphraseCtrl = function($scope, $q, pgp, keychain, dialog) { // scope functions // - /* - * Taken from jQuery validate.password plug-in 1.0 - * http://bassistance.de/jquery-plugins/jquery-plugin-validate.password/ - * - * Copyright (c) 2009 Jörn Zaefferer - * - * Licensed under the MIT - * http://www.opensource.org/licenses/mit-license.php - */ - $scope.checkPassphraseQuality = function() { - var passphrase = $scope.newPassphrase; - $scope.passphraseRating = 0; - - var LOWER = /[a-z]/, - UPPER = /[A-Z]/, - DIGIT = /[0-9]/, - DIGITS = /[0-9].*[0-9]/, - SPECIAL = /[^a-zA-Z0-9]/, - SAME = /^(.)\1+$/; - - function uncapitalize(str) { - return str.substring(0, 1).toLowerCase() + str.substring(1); - } - - if (!passphrase) { - // no rating for empty passphrase - $scope.passphraseMsg = ''; - return; - } - - if (passphrase.length < 8 || SAME.test(passphrase)) { - $scope.passphraseMsg = 'Very weak'; - return; - } - - var lower = LOWER.test(passphrase), - upper = UPPER.test(uncapitalize(passphrase)), - digit = DIGIT.test(passphrase), - digits = DIGITS.test(passphrase), - special = SPECIAL.test(passphrase); - - if (lower && upper && digit || lower && digits || upper && digits || special) { - $scope.passphraseMsg = 'Strong'; - $scope.passphraseRating = 3; - } else if (lower && upper || lower && digit || upper && digit) { - $scope.passphraseMsg = 'Good'; - $scope.passphraseRating = 2; - } else { - $scope.passphraseMsg = 'Weak'; - $scope.passphraseRating = 1; - } - }; - $scope.setPassphrase = function() { var keyId = pgp.getKeyParams()._id; diff --git a/src/sass/blocks/basics/_form.scss b/src/sass/blocks/basics/_form.scss index a8a3de8..cf69b0b 100644 --- a/src/sass/blocks/basics/_form.scss +++ b/src/sass/blocks/basics/_form.scss @@ -10,10 +10,6 @@ margin-bottom: 10px; color: $color-error; } - &__password-strong-message { - margin-bottom: 10px; - color: green; - } &__row { margin-bottom: 10px; diff --git a/src/tpl/set-passphrase.html b/src/tpl/set-passphrase.html index da781cf..175c5e1 100644 --- a/src/tpl/set-passphrase.html +++ b/src/tpl/set-passphrase.html @@ -16,12 +16,11 @@ -
- +