Skip to content

Commit e2fc9c9

Browse files
committed
replaced numTries with numRetries, bumped version number
1 parent 056af79 commit e2fc9c9

File tree

13 files changed

+19
-21
lines changed

13 files changed

+19
-21
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# LoadJS Changelog
22

3-
## 3.0.1 - December 9, 2016
3+
## 3.1.0 - December 9, 2016
44

5-
* Added numTries option
5+
* Added numRetries option
66

77
## 3.0.0 - August 25, 2016
88

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<img src="https://www.muicss.com/static/images/loadjs.svg" width="250px">
44

5-
LoadJS is a tiny async loader for modern browsers (692 bytes).
5+
LoadJS is a tiny async loader for modern browsers (696 bytes).
66

77
[![Dependency Status](https://david-dm.org/muicss/loadjs.svg)](https://david-dm.org/muicss/loadjs)
88
[![devDependency Status](https://david-dm.org/muicss/loadjs/dev-status.svg)](https://david-dm.org/muicss/loadjs#info=devDependencies)
@@ -11,7 +11,7 @@ LoadJS is a tiny async loader for modern browsers (692 bytes).
1111

1212
LoadJS is a tiny async loading library for modern browsers (IE9+). It has a simple yet powerful dependency management system that lets you fetch JavaScript and CSS files in parallel and execute code after the dependencies have been met. The recommended way to use LoadJS is to include the minified source code in your &lt;html&gt; and then use the `loadjs` global to manage JavaScript dependencies after pageload.
1313

14-
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/error callbacks and to optimize the library for modern browsers. LoadJS is 654 bytes (minified + gzipped).
14+
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/error callbacks and to optimize the library for modern browsers. LoadJS is 696 bytes (minified + gzipped).
1515

1616
Here's an example of what you can do with LoadJS:
1717

@@ -116,13 +116,13 @@ Note: LoadJS treats empty CSS files as load failures in IE (to get around lack o
116116
});
117117
```
118118

119-
1. Try loading the files multiple times before calling the error callback
119+
1. Retry files before calling the error callback
120120

121121
```javascript
122122
loadjs(['/path/to/foo.js', '/path/to/bar.js'], 'foobar', {
123123
success: function() { /* foo.js & bar.js loaded */ },
124124
error: function(pathsNotFound) { /* at least one path didn't load */ },
125-
numTries: 3
125+
numRetries: 3
126126
});
127127
```
128128

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loadjs",
3-
"version": "3.0.1",
3+
"version": "3.1.0",
44
"license": "MIT",
55
"authors": [
66
"Andres Morey <[email protected]>"

dist/loadjs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function publish(bundleId, pathsNotFound) {
8383
function loadFile(path, callbackFn, args, numTries) {
8484
var doc = document,
8585
async = args.async,
86-
maxTries = args.numTries || 1,
86+
maxTries = (args.numRetries || 0) + 1,
8787
isCss,
8888
e;
8989

dist/loadjs.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/loadjs.umd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function publish(bundleId, pathsNotFound) {
9191
function loadFile(path, callbackFn, args, numTries) {
9292
var doc = document,
9393
async = args.async,
94-
maxTries = args.numTries || 1,
94+
maxTries = (args.numRetries || 0) + 1,
9595
isCss,
9696
e;
9797

examples/assets/loadjs/loadjs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function publish(bundleId, pathsNotFound) {
8383
function loadFile(path, callbackFn, args, numTries) {
8484
var doc = document,
8585
async = args.async,
86-
maxTries = args.numTries || 1,
86+
maxTries = (args.numRetries || 0) + 1,
8787
isCss,
8888
e;
8989

examples/assets/loadjs/loadjs.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "loadjs",
3-
"version": "3.0.1",
3+
"version": "3.1.0",
44
"license": "MIT",
55
"description": "Tiny async loader for modern browsers",
66
"keywords": [

src/loadjs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function publish(bundleId, pathsNotFound) {
8282
function loadFile(path, callbackFn, args, numTries) {
8383
var doc = document,
8484
async = args.async,
85-
maxTries = args.numTries || 1,
85+
maxTries = (args.numRetries || 0) + 1,
8686
isCss,
8787
e;
8888

test/assets/loadjs/loadjs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function publish(bundleId, pathsNotFound) {
8383
function loadFile(path, callbackFn, args, numTries) {
8484
var doc = document,
8585
async = args.async,
86-
maxTries = args.numTries || 1,
86+
maxTries = (args.numRetries || 0) + 1,
8787
isCss,
8888
e;
8989

test/assets/loadjs/loadjs.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/tests.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,14 @@ describe('LoadJS tests', function() {
121121

122122

123123
it('should support multiple tries', function(done) {
124-
var numTries = 0;
125-
126-
loadjs('assets/file-doesntexist-numtries.js', {
124+
loadjs('assets/file-numretries.js', {
127125
error: function() {
128126
// check number of scripts in document
129-
var selector = 'script[src="assets/file-doesntexist-numtries.js"]',
127+
var selector = 'script[src="assets/file-numretries.js"]',
130128
scripts = document.querySelectorAll(selector);
131129
if (scripts.length === 2) done();
132130
},
133-
numTries: 2
131+
numRetries: 1
134132
});
135133
});
136134

0 commit comments

Comments
 (0)