Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For a more intuitive installation, remove async.coffee and stop compiling/minifying zxcvbn-async.js. Instead, keep zxcvbn-async.js readable and edit directly. Also add a zxcvbn-async-bower.js variant to fix bower setup.
- Loading branch information
Dan Wheeler
committed
Jul 12, 2015
1 parent
61cc72a
commit d1ceb2d
Showing
5 changed files
with
57 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
*~ | ||
*.js | ||
!zxcvbn.js | ||
!zxcvbn-async.js | ||
!zxcvbn-async-bower.js | ||
test/index_dev.html | ||
node_modules |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(function() { | ||
var ZXCVBN_SRC = 'bower_components/zxcvbn/zxcvbn.js'; | ||
var async_load = function() { | ||
var first, s; | ||
s = document.createElement('script'); | ||
s.src = ZXCVBN_SRC; | ||
s.type = 'text/javascript'; | ||
s.async = true; | ||
first = document.getElementsByTagName('script')[0]; | ||
return first.parentNode.insertBefore(s, first); | ||
}; | ||
if (window.attachEvent != null) { | ||
window.attachEvent('onload', async_load); | ||
} else { | ||
window.addEventListener('load', async_load, false); | ||
} | ||
}).call(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
(function(){var a;a=function(){var a,b;b=document.createElement("script");b.src="zxcvbn.js";b.type="text/javascript";b.async=!0;a=document.getElementsByTagName("script")[0];return a.parentNode.insertBefore(b,a)};null!=window.attachEvent?window.attachEvent("onload",a):window.addEventListener("load",a,!1)}).call(this); | ||
// cross-browser asynchronous script loading for zxcvbn. | ||
// adapted from http://friendlybit.com/js/lazy-loading-asyncronous-javascript/ | ||
|
||
// Suggestion: instead of manually configuring this script, | ||
// follow the bower setup instructions (see README) for easier installation and | ||
// updating. | ||
|
||
// If you do want to manually include zxcvbn, you'll likely only need to change | ||
// ZXCVBN_SRC to point to the correct relative path from your index.html. | ||
// (this script assumes index.html and zxcvbn.js sit next to each other.) | ||
|
||
(function() { | ||
var ZXCVBN_SRC = 'zxcvbn.js'; | ||
|
||
var async_load = function() { | ||
var first, s; | ||
s = document.createElement('script'); | ||
s.src = ZXCVBN_SRC; | ||
s.type = 'text/javascript'; | ||
s.async = true; | ||
first = document.getElementsByTagName('script')[0]; | ||
return first.parentNode.insertBefore(s, first); | ||
}; | ||
|
||
if (window.attachEvent != null) { | ||
window.attachEvent('onload', async_load); | ||
} else { | ||
window.addEventListener('load', async_load, false); | ||
} | ||
|
||
}).call(this); |