
;(function(u, window, document, undefined) {
	'use strict';

	var pluginName = 'strength',
			defaults = {
				meter: '#password-meter',
				classes: [
					'veryweak',
					'veryweak',
					'weak',
					'medium',
					'strong'
				],
				delay: 0
				specialChars: /[^a-zA-Z0-9]/,
			};

	function Strength(element, options) {
		this.el = element;
		this._el = u(this.el);
		this.options = u.extend({}, defaults, options);
		this._defaults = defaults;
		this._name = pluginName;
		this.init();
	}

	Strength.prototype = {

		init: function() {

			var characters = 0;
			var capitalletters = 0;
			var loweletters = 0;
			var number = 0;
			var special = 0;

			var upperCase = /[A-Z]/;
			var lowerCase = /[a-z]/;
			var numbers = /[0-9]/;
			var specialChars = this.options.specialChars;

			var classes = this.options.classes;
			var meter = u(this.options.meter);
			var checkDelay = this.options.delay;
			var checkTimeout;

			function checkStrength(value, total) {
				characters = value.length > 8 ? 1 : -1;
				capitalletters = +!!value.match(upperCase);
				loweletters = +!!value.match(lowerCase);
				number = +!!value.match(numbers);
				special = +!!value.match(specialChars);

				total = characters + capitalletters + loweletters + number + special;

				!value.length && (total = -1);

				updateMeter(total);
			}

			function updateMeter(total) {
				meter.removeClass(classes.join(' '));
				total >= 0 && meter.addClass(classes[Math.min(total, classes.length -1)]);
			}

			this._el.on('input', function(event) {
				clearTimeout(checkTimeout);
				checkTimeout = setTimeout(checkStrength, checkDelay, this.value);
			});

		}
	};

	// A really lightweight plugin wrapper around the constructor,
	// preventing against multiple instantiations
	u.fn[pluginName] = function(options) {
			return this.each(function() {
					if (!u(this).data(pluginName)) {
							u(this).data(pluginName, new Strength(this, options));
					}
			});
	};

})(u, window, document);

@@ -233,21 +233,8 @@
 %09%5D,%0A
-%09%09%09%09delay: 0%0A
 %09%09%09%09
@@ -263,16 +263,41 @@
 Z0-9%5D/,%0A
+%09%09%09%09delay: 0,%0A%09%09%09%09min: 8%0A
 %09%09%09%7D;%0A%0A%09
@@ -875,16 +875,47 @@
 meter);%0A
+%09%09%09var min = this.options.min;%0A
 %09%09%09var c
@@ -1045,14 +1045,49 @@
 th %3E
- 8 ? 1
+= min ? (value.length %3E= min * 2 ? 2 : 1)
  : -

add a min length option and change scoring for length in strength calculation