From 99ff58bdc29fabfd0b1073662b16432d515a6516 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 25 Mar 2019 10:56:32 +0100 Subject: [PATCH] 0.5.8 Signed-off-by: Morris Jobke --- README.md | 6 ++++++ bower.json | 2 +- jquery.strengthify.js | 2 +- jquery.strengthify.min.js | 2 +- package.json | 2 +- strengthify.css | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ea36a61..8b929a8 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,12 @@ Versions --------
+
0.5.8
+
+
    +
  • wait for load of script before binding (#28)
  • +
+
0.5.7
    diff --git a/bower.json b/bower.json index ad887b8..dc515e5 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "strengthify", - "version": "0.5.7", + "version": "0.5.8", "homepage": "https://github.com/MorrisJobke/strengthify", "authors": [ "Eve Ragins "):"";break;case 2:d="warning",c=n.feedback?n.feedback.suggestions.join("
    "):"",o="password-medium";break;case 3:o="password-good",d="info",c="Getting better.";break;case 4:o="password-good",d="success",c="Looks good."}f&&(f.removeAttr("class"),f.addClass("bg-"+d),""===e&&(c=""),f.html(c)),p&&(p.attr("class",o+" strengthify-container").css("width",25*(0===n.score?1:n.score)+"%"),""===e&&p.css("width",0)),a.drawTitles&&(a.tilesOptions.tooltip&&(l.attr("title",a.titles[n.score]).tooltip({placement:"bottom",trigger:"manual"}).tooltip("fixTitle").tooltip("show"),0===i&&l.tooltip("hide")),a.tilesOptions.element&&l.find(".strengthify-tiles").text(a.titles[n.score]))}.bind(this),n=a.$addAfter;n||(n=e),n.after('
    '),a.drawBars&&r(s).append('
    ').append('
    ').append('
    ').append('
    ').append('
    '),a.drawMessage&&r(s).append("
    "),a.drawTitles&&a.tilesOptions&&r(s).append('
    '),e.parent().on("scroll",i);var o=document.createElement("script");o.src=a.zxcvbn,null!==a.nonce&&o.setAttribute("nonce",a.nonce),document.head.appendChild(o),e.bind("keyup input change",i)}.call(this)})}}(jQuery); \ No newline at end of file +!function(t){t.fn.strengthify=function(e){"use strict";var s={zxcvbn:"zxcvbn/zxcvbn.js",userInputs:[],titles:["Weakest","Weak","So-so","Good","Perfect"],tilesOptions:{tooltip:!0,element:!1},drawTitles:!1,drawMessage:!1,drawBars:!0,$addAfter:null,nonce:null};return this.each(function(){var a=t.extend(s,e);function r(e){return t('div[data-strengthifyFor="'+e+'"]')}a.drawTitles||a.drawMessage||a.drawBars||console.warn("expect at least one of 'drawTitles', 'drawMessage', or 'drawBars' to be true"),function(){var e=t(this),s=e.attr("id"),i=function(){var e=t(this).val(),s=t(this).attr("id"),i=""===e?0:1,n=zxcvbn(e,a.userInputs),o="",d="",c="",l=r(s),p=l.find(".strengthify-container"),f=l.find("[data-strengthifyMessage]");switch(l.children().css("opacity",i).css("-ms-filter",'"progid:DXImageTransform.Microsoft.Alpha(Opacity='+100*i+')"'),a.onResult&&a.onResult(n),n.score){case 0:case 1:o="password-bad",d="danger",c=n.feedback?n.feedback.suggestions.join("
    "):"";break;case 2:d="warning",c=n.feedback?n.feedback.suggestions.join("
    "):"",o="password-medium";break;case 3:o="password-good",d="info",c="Getting better.";break;case 4:o="password-good",d="success",c="Looks good."}f&&(f.removeAttr("class"),f.addClass("bg-"+d),""===e&&(c=""),f.html(c)),p&&(p.attr("class",o+" strengthify-container").css("width",25*(0===n.score?1:n.score)+"%"),""===e&&p.css("width",0)),a.drawTitles&&(a.tilesOptions.tooltip&&(l.attr("title",a.titles[n.score]).tooltip({placement:"bottom",trigger:"manual"}).tooltip("fixTitle").tooltip("show"),0===i&&l.tooltip("hide")),a.tilesOptions.element&&l.find(".strengthify-tiles").text(a.titles[n.score]))}.bind(this),n=a.$addAfter;n||(n=e),n.after('
    '),a.drawBars&&r(s).append('
    ').append('
    ').append('
    ').append('
    ').append('
    '),a.drawMessage&&r(s).append("
    "),a.drawTitles&&a.tilesOptions&&r(s).append('
    ');var o=document.createElement("script");o.src=a.zxcvbn,null!==a.nonce&&o.setAttribute("nonce",a.nonce),o.onload=function(){e.parent().on("scroll",i),e.bind("keyup input change",i)},document.head.appendChild(o)}.call(this)})}}(jQuery); \ No newline at end of file diff --git a/package.json b/package.json index f097474..5f9a3d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "strengthify", - "version": "0.5.7", + "version": "0.5.8", "description": "Combine jQuery and zxcvbn to create a password strength meter", "main": "jquery.strengthify.js", "scripts": { diff --git a/strengthify.css b/strengthify.css index 6dee455..836b9b4 100644 --- a/strengthify.css +++ b/strengthify.css @@ -1,7 +1,7 @@ /** * Strengthify - show the weakness of a password (uses zxcvbn for this) * https://github.com/MorrisJobke/strengthify - * Version: 0.5.7 + * Version: 0.5.8 * License: The MIT License (MIT) * Copyright (c) 2013-2019 Morris Jobke */