Skip to content

Commit c443222

Browse files
committed
Release v2.0.6
1 parent ed64f49 commit c443222

File tree

7 files changed

+17
-33
lines changed

7 files changed

+17
-33
lines changed

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CHANGELOG
22

3-
## 2.0.6dev
3+
## 2.0.6
44

55
- Updated development dependencies.
66
- Bootstrap 4 alpha 6 support.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pwstrength-bootstrap",
3-
"version": "2.0.6dev",
3+
"version": "2.0.6",
44
"homepage": "https://github.com/ablanco/jquery.pwstrength.bootstrap",
55
"authors": [
66
"Alejandro Blanco <alejandro.b.e@gmail.com>"

dist/pwstrength-bootstrap.js

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* jQuery Password Strength plugin for Twitter Bootstrap
3-
* Version: 2.0.5
3+
* Version: 2.0.6
44
*
55
* Copyright (c) 2008-2013 Tane Piper
66
* Copyright (c) 2013 Alejandro Blanco
@@ -60,7 +60,7 @@ try {
6060
if (!jQuery && module && module.exports) {
6161
var jQuery = require("jquery"),
6262
jsdom = require("jsdom").jsdom;
63-
jQuery = jQuery(jsdom().parentWindow);
63+
jQuery = jQuery(jsdom().defaultView);
6464
}
6565
} catch (ignore) {}
6666

@@ -354,7 +354,7 @@ var ui = {};
354354
};
355355

356356
ui.getUIElements = function (options, $el) {
357-
var $container, selector, result;
357+
var $container, result;
358358

359359
if (options.instances.viewports) {
360360
return options.instances.viewports;
@@ -363,12 +363,7 @@ var ui = {};
363363
$container = ui.getContainer(options, $el);
364364

365365
result = {};
366-
if (options.ui.bootstrap4) {
367-
selector = "progress.progress";
368-
} else {
369-
selector = "div.progress";
370-
}
371-
result.$progressbar = ui.findElement($container, options.ui.viewports.progress, selector);
366+
result.$progressbar = ui.findElement($container, options.ui.viewports.progress, "div.progress");
372367
if (options.ui.showVerdictsInsideProgressBar) {
373368
result.$verdict = result.$progressbar.find("span.password-verdict");
374369
}
@@ -394,28 +389,18 @@ var ui = {};
394389
// Boostrap 2
395390
progressbar += options.ui.progressBarExtraCssClasses +
396391
"'><div class='";
397-
} else if (!options.ui.bootstrap2 && !options.ui.bootstrap4) {
398-
// Bootstrap 3
392+
} else {
393+
// Bootstrap 3 & 4
399394
progressbar += "'><div class='" +
400395
options.ui.progressBarExtraCssClasses + " progress-";
401396
}
402397
progressbar += "bar'>";
403398

404-
if (options.ui.bootstrap4) {
405-
// Boostrap 4
406-
progressbar = "<progress class='progress " +
407-
options.ui.progressBarExtraCssClasses + "' value='0' max='100'>";
408-
}
409-
410399
if (options.ui.showVerdictsInsideProgressBar) {
411400
progressbar += "<span class='password-verdict'></span>";
412401
}
413402

414-
if (options.ui.bootstrap4) {
415-
progressbar += "</progress>";
416-
} else {
417-
progressbar += "</div></div>";
418-
}
403+
progressbar += "</div></div>";
419404

420405
if (options.ui.viewports.progress) {
421406
$container.find(options.ui.viewports.progress).append(progressbar);
@@ -487,18 +472,17 @@ var ui = {};
487472

488473
$.each(options.ui.colorClasses, function (idx, value) {
489474
if (options.ui.bootstrap4) {
490-
$progressbar.removeClass(cssPrefix + value);
475+
$bar.removeClass("bg-" + value);
491476
} else {
492477
$bar.removeClass(cssPrefix + "bar-" + value);
493478
}
494479
});
495480
if (options.ui.bootstrap4) {
496-
$progressbar.addClass(cssPrefix + options.ui.colorClasses[cssClass]);
497-
$progressbar.val(percentage);
481+
$bar.addClass("bg-" + options.ui.colorClasses[cssClass]);
498482
} else {
499483
$bar.addClass(cssPrefix + "bar-" + options.ui.colorClasses[cssClass]);
500-
$bar.css("width", percentage + '%');
501484
}
485+
$bar.css("width", percentage + '%');
502486
};
503487

504488
ui.updateVerdict = function (options, $el, cssClass, text) {

dist/pwstrength-bootstrap.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pwstrength-bootstrap.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/pwstrength.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* jQuery Password Strength plugin for Twitter Bootstrap
3-
* Version: 2.0.6dev
3+
* Version: 2.0.6
44
*
55
* Copyright (c) 2008-2013 Tane Piper
66
* Copyright (c) 2013 Alejandro Blanco

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pwstrength-bootstrap",
3-
"version": "2.0.6dev",
3+
"version": "2.0.6",
44
"description": "jQuery plugin for Twitter Bootstrap that provides rulesets for visualy displaying the quality of a users typed in password.",
55
"author": "Alejandro Blanco <alejandro.b.e@gmail.com>",
66
"homepage": "https://github.com/ablanco/jquery.pwstrength.bootstrap",

0 commit comments

Comments
 (0)