Comparing version 1.0.1 to 1.0.2
# LoadJS Changelog | ||
## 1.0.2 - May 18, 2016 | ||
* Added bower.json | ||
* Removed onload script deletion | ||
## 1.0.1 - March 22, 2016 | ||
@@ -4,0 +9,0 @@ |
@@ -89,9 +89,2 @@ loadjs = (function () { | ||
s.onload = s.onerror = function(ev) { | ||
// remove script | ||
var p = s.parentNode; | ||
if (p) p.removeChild(s); | ||
// de-reference script | ||
s = null; | ||
// execute callback | ||
@@ -98,0 +91,0 @@ callbackFn(path, ev.type); |
@@ -1,1 +0,1 @@ | ||
loadjs=function(){function n(n,r){n=n.push?n:[n];var e,o,t,i,u=[],a=n.length,l=a;for(e=function(n,e){e.length&&u.push(n),l-=1,0===l&&r(u)};a--;)o=n[a],t=f[o],t?e(o,t):(i=c[o]=c[o]||[],i.push(e))}function r(n,r){if(n){var e=c[n];if(f[n]=r,e)for(;e.length;)e[0](n,r),e.splice(0,1)}}function e(n,r){var e=document,o=e.createElement("script");o.src=n,o.onload=o.onerror=function(e){var t=o.parentNode;t&&t.removeChild(o),o=null,r(n,e.type)},e.head.appendChild(o)}function o(n,r){n=n.push?n:[n];var o,t=n.length,i=t,u=[];for(o=function(n,e){"error"===e&&u.push(n),i-=1,0===i&&r(u)};t--;)e(n[t],o)}function t(n,e,t,f){var c,a,l;if(e&&!e.call&&(c=e),a=c?t:e,l=c?f:t,c){if(c in u)throw new Error("LoadJS: Bundle already defined");u[c]=!0}o(n,function(n){n.length?(l||i)(n):(a||i)(),r(c,n)})}var i=function(){},u={},f={},c={};return t.ready=function(r,e,o){return n(r,function(n){n.length?(o||i)(n):(e||i)()}),t},t.done=function(n){r(n,[])},t}(); | ||
loadjs=function(){function n(n,o){n=n.push?n:[n];var r,t,e,i,u=[],a=n.length,l=a;for(r=function(n,r){r.length&&u.push(n),l-=1,0===l&&o(u)};a--;)t=n[a],e=f[t],e?r(t,e):(i=c[t]=c[t]||[],i.push(r))}function o(n,o){if(n){var r=c[n];if(f[n]=o,r)for(;r.length;)r[0](n,o),r.splice(0,1)}}function r(n,o){var r=document,t=r.createElement("script");t.src=n,t.onload=t.onerror=function(r){o(n,r.type)},r.head.appendChild(t)}function t(n,o){n=n.push?n:[n];var t,e=n.length,i=e,u=[];for(t=function(n,r){"error"===r&&u.push(n),i-=1,0===i&&o(u)};e--;)r(n[e],t)}function e(n,r,e,f){var c,a,l;if(r&&!r.call&&(c=r),a=c?e:r,l=c?f:e,c){if(c in u)throw new Error("LoadJS: Bundle already defined");u[c]=!0}t(n,function(n){n.length?(l||i)(n):(a||i)(),o(c,n)})}var i=function(){},u={},f={},c={};return e.ready=function(o,r,t){return n(o,function(n){n.length?(t||i)(n):(r||i)()}),e},e.done=function(n){o(n,[])},e}(); |
@@ -97,9 +97,2 @@ (function(root, factory) { | ||
s.onload = s.onerror = function(ev) { | ||
// remove script | ||
var p = s.parentNode; | ||
if (p) p.removeChild(s); | ||
// de-reference script | ||
s = null; | ||
// execute callback | ||
@@ -106,0 +99,0 @@ callbackFn(path, ev.type); |
@@ -89,9 +89,2 @@ loadjs = (function () { | ||
s.onload = s.onerror = function(ev) { | ||
// remove script | ||
var p = s.parentNode; | ||
if (p) p.removeChild(s); | ||
// de-reference script | ||
s = null; | ||
// execute callback | ||
@@ -98,0 +91,0 @@ callbackFn(path, ev.type); |
@@ -1,1 +0,1 @@ | ||
loadjs=function(){function n(n,r){n=n.push?n:[n];var e,o,t,i,u=[],a=n.length,l=a;for(e=function(n,e){e.length&&u.push(n),l-=1,0===l&&r(u)};a--;)o=n[a],t=f[o],t?e(o,t):(i=c[o]=c[o]||[],i.push(e))}function r(n,r){if(n){var e=c[n];if(f[n]=r,e)for(;e.length;)e[0](n,r),e.splice(0,1)}}function e(n,r){var e=document,o=e.createElement("script");o.src=n,o.onload=o.onerror=function(e){var t=o.parentNode;t&&t.removeChild(o),o=null,r(n,e.type)},e.head.appendChild(o)}function o(n,r){n=n.push?n:[n];var o,t=n.length,i=t,u=[];for(o=function(n,e){"error"===e&&u.push(n),i-=1,0===i&&r(u)};t--;)e(n[t],o)}function t(n,e,t,f){var c,a,l;if(e&&!e.call&&(c=e),a=c?t:e,l=c?f:t,c){if(c in u)throw new Error("LoadJS: Bundle already defined");u[c]=!0}o(n,function(n){n.length?(l||i)(n):(a||i)(),r(c,n)})}var i=function(){},u={},f={},c={};return t.ready=function(r,e,o){return n(r,function(n){n.length?(o||i)(n):(e||i)()}),t},t.done=function(n){r(n,[])},t}(); | ||
loadjs=function(){function n(n,o){n=n.push?n:[n];var r,t,e,i,u=[],a=n.length,l=a;for(r=function(n,r){r.length&&u.push(n),l-=1,0===l&&o(u)};a--;)t=n[a],e=f[t],e?r(t,e):(i=c[t]=c[t]||[],i.push(r))}function o(n,o){if(n){var r=c[n];if(f[n]=o,r)for(;r.length;)r[0](n,o),r.splice(0,1)}}function r(n,o){var r=document,t=r.createElement("script");t.src=n,t.onload=t.onerror=function(r){o(n,r.type)},r.head.appendChild(t)}function t(n,o){n=n.push?n:[n];var t,e=n.length,i=e,u=[];for(t=function(n,r){"error"===r&&u.push(n),i-=1,0===i&&o(u)};e--;)r(n[e],t)}function e(n,r,e,f){var c,a,l;if(r&&!r.call&&(c=r),a=c?e:r,l=c?f:e,c){if(c in u)throw new Error("LoadJS: Bundle already defined");u[c]=!0}t(n,function(n){n.length?(l||i)(n):(a||i)(),o(c,n)})}var i=function(){},u={},f={},c={};return e.ready=function(o,r,t){return n(o,function(n){n.length?(t||i)(n):(r||i)()}),e},e.done=function(n){o(n,[])},e}(); |
{ | ||
"name": "loadjs", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"license": "MIT", | ||
@@ -24,7 +24,8 @@ "description": "Tiny async loader for modern browsers", | ||
"gulp": "git+https://github.com/gulpjs/gulp#c4a7542986107949b049fc81aa081d72d95e98ff", | ||
"gulp-jshint": "2.0.0", | ||
"gulp-jshint": "2.0.1", | ||
"gulp-rename": "1.2.2", | ||
"gulp-uglify": "1.5.3", | ||
"gulp-umd": "^0.2.0" | ||
"gulp-umd": "^0.2.0", | ||
"jshint": "^2.9.2" | ||
} | ||
} |
@@ -5,3 +5,3 @@ # LoadJS | ||
LoadJS is a tiny async loader for modern browsers (534 bytes). | ||
LoadJS is a tiny async loader for modern browsers (506 bytes). | ||
@@ -15,3 +15,3 @@ [![Dependency Status](https://david-dm.org/muicss/loadjs.svg)](https://david-dm.org/muicss/loadjs) | ||
LoadJS is based on the excellent <a href="https://github.com/ded/script.js">$script</a> library by <a href="https://github.com/ded">Dustin Diaz</a>. We kept the behavior of the library the same but we re-wrote the code from scratch to add support for success/failure callbacks and to optimize the library for modern browsers. LoadJS is 534 bytes (minified + gzipped). | ||
LoadJS is based on the excellent <a href="https://github.com/ded/script.js">$script</a> library by <a href="https://github.com/ded">Dustin Diaz</a>. We kept the behavior of the library the same but we re-wrote the code from scratch to add support for success/failure callbacks and to optimize the library for modern browsers. LoadJS is 506 bytes (minified + gzipped). | ||
@@ -22,3 +22,3 @@ Here's an example of what you can do with LoadJS: | ||
// define a dependency bundle | ||
loadjs(['foo.js', 'bar.js'], 'foobar'); | ||
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar'); | ||
@@ -35,4 +35,18 @@ // execute code elsewhere when the bundle has loaded | ||
You can also use it as a CJS or AMD module. | ||
You can also use it as a CJS or AMD module: | ||
```bash | ||
$ npm install --save-dev loadjs | ||
``` | ||
```javascript | ||
var loadjs = require('loadjs'); | ||
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar'); | ||
loadjs.ready('foobar', function() { | ||
// foo.js & bar.js loaded | ||
}); | ||
``` | ||
## Browser Support | ||
@@ -52,3 +66,3 @@ | ||
// load a single file | ||
loadjs('foo.js', function() { | ||
loadjs('/path/to/foo.js', function() { | ||
// foo.js loaded | ||
@@ -59,3 +73,3 @@ }); | ||
// load multiple files (in parallel) | ||
loadjs(['foo.js', 'bar.js'], function() { | ||
loadjs(['/path/to/foo.js', '/path/to/bar.js'], function() { | ||
// foo.js & bar.js loaded | ||
@@ -66,4 +80,4 @@ }); | ||
// load multiple files (in series) | ||
loadjs('foo.js', function() { | ||
loadjs('bar.js', function() { | ||
loadjs('/path/to/foo.js', function() { | ||
loadjs('/path/to/bar.js', function() { | ||
// foo.js loaded then bar.js loaded | ||
@@ -75,3 +89,3 @@ }); | ||
// add a bundle id | ||
loadjs(['foo.js', 'bar.js'], 'foobar', function() { | ||
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', function() { | ||
// foo.js & bar.js loaded | ||
@@ -82,3 +96,3 @@ }); | ||
// add a failure callback | ||
loadjs(['foo.js', 'bar.js'], | ||
loadjs(['/path/to/foo.js', '/path/to/bar.js'], | ||
'foobar', | ||
@@ -90,3 +104,3 @@ function() { /* foo.js & bar.js loaded */ }, | ||
// execute a callback after bundle finishes loading | ||
loadjs(['foo.js', 'bar.js'], 'foobar'); | ||
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar'); | ||
@@ -99,4 +113,4 @@ loadjs.ready('foobar', function() { | ||
// .ready() can be chained together | ||
loadjs('foo.js', 'foo'); | ||
loadjs('bar.js', 'bar'); | ||
loadjs('/path/to/foo.js', 'foo'); | ||
loadjs('/path/to/bar.js', 'bar'); | ||
@@ -113,5 +127,5 @@ loadjs | ||
// compose more complex dependency lists | ||
loadjs('foo.js', 'foo'); | ||
loadjs('bar.js', 'bar'); | ||
loadjs(['thunkor.js', 'thunky.js'], 'thunk'); | ||
loadjs('/path/to/foo.js', 'foo'); | ||
loadjs('/path/to/bar.js', 'bar'); | ||
loadjs(['/path/to/thunkor.js', '/path/to/thunky.js'], 'thunk'); | ||
@@ -118,0 +132,0 @@ |
@@ -13,2 +13,6 @@ # Release Instructions | ||
1. Change version number in bower.json | ||
1. Update README.md (if necessary) | ||
1. Commit changes and tag code | ||
@@ -27,4 +31,3 @@ | ||
```bash | ||
$ cd packages/npm | ||
$ npm publish | ||
``` |
@@ -88,9 +88,2 @@ /** | ||
s.onload = s.onerror = function(ev) { | ||
// remove script | ||
var p = s.parentNode; | ||
if (p) p.removeChild(s); | ||
// de-reference script | ||
s = null; | ||
// execute callback | ||
@@ -97,0 +90,0 @@ callbackFn(path, ev.type); |
@@ -89,9 +89,2 @@ loadjs = (function () { | ||
s.onload = s.onerror = function(ev) { | ||
// remove script | ||
var p = s.parentNode; | ||
if (p) p.removeChild(s); | ||
// de-reference script | ||
s = null; | ||
// execute callback | ||
@@ -98,0 +91,0 @@ callbackFn(path, ev.type); |
@@ -1,1 +0,1 @@ | ||
loadjs=function(){function n(n,r){n=n.push?n:[n];var e,o,t,i,u=[],a=n.length,l=a;for(e=function(n,e){e.length&&u.push(n),l-=1,0===l&&r(u)};a--;)o=n[a],t=f[o],t?e(o,t):(i=c[o]=c[o]||[],i.push(e))}function r(n,r){if(n){var e=c[n];if(f[n]=r,e)for(;e.length;)e[0](n,r),e.splice(0,1)}}function e(n,r){var e=document,o=e.createElement("script");o.src=n,o.onload=o.onerror=function(e){var t=o.parentNode;t&&t.removeChild(o),o=null,r(n,e.type)},e.head.appendChild(o)}function o(n,r){n=n.push?n:[n];var o,t=n.length,i=t,u=[];for(o=function(n,e){"error"===e&&u.push(n),i-=1,0===i&&r(u)};t--;)e(n[t],o)}function t(n,e,t,f){var c,a,l;if(e&&!e.call&&(c=e),a=c?t:e,l=c?f:t,c){if(c in u)throw new Error("LoadJS: Bundle already defined");u[c]=!0}o(n,function(n){n.length?(l||i)(n):(a||i)(),r(c,n)})}var i=function(){},u={},f={},c={};return t.ready=function(r,e,o){return n(r,function(n){n.length?(o||i)(n):(e||i)()}),t},t.done=function(n){r(n,[])},t}(); | ||
loadjs=function(){function n(n,o){n=n.push?n:[n];var r,t,e,i,u=[],a=n.length,l=a;for(r=function(n,r){r.length&&u.push(n),l-=1,0===l&&o(u)};a--;)t=n[a],e=f[t],e?r(t,e):(i=c[t]=c[t]||[],i.push(r))}function o(n,o){if(n){var r=c[n];if(f[n]=o,r)for(;r.length;)r[0](n,o),r.splice(0,1)}}function r(n,o){var r=document,t=r.createElement("script");t.src=n,t.onload=t.onerror=function(r){o(n,r.type)},r.head.appendChild(t)}function t(n,o){n=n.push?n:[n];var t,e=n.length,i=e,u=[];for(t=function(n,r){"error"===r&&u.push(n),i-=1,0===i&&o(u)};e--;)r(n[e],t)}function e(n,r,e,f){var c,a,l;if(r&&!r.call&&(c=r),a=c?e:r,l=c?f:e,c){if(c in u)throw new Error("LoadJS: Bundle already defined");u[c]=!0}t(n,function(n){n.length?(l||i)(n):(a||i)(),o(c,n)})}var i=function(){},u={},f={},c={};return e.ready=function(o,r,t){return n(o,function(n){n.length?(t||i)(n):(r||i)()}),e},e.done=function(n){o(n,[])},e}(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
331020
35
11375
221
7