Skip to content

Commit 060bada

Browse files
committed
updating new build
1 parent 5795aba commit 060bada

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

dist/script.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
, delay = {}
2222
, scripts = {}
2323
, scriptpath
24+
, urlArgs
2425

2526
function every(ar, fn) {
2627
for (var i = 0, j = ar.length; i < j; ++i) if (!fn(ar[i])) return f
@@ -53,7 +54,7 @@
5354
setTimeout(function () {
5455
each(paths, function loading(path, force) {
5556
if (path === null) return callback()
56-
path = !force && !/^https?:\/\//.test(path) && scriptpath ? scriptpath + path + '.js' : path
57+
path = !force && path.indexOf('.js') === -1 && !/^https?:\/\//.test(path) && scriptpath ? scriptpath + path + '.js' : path
5758
if (scripts[path]) {
5859
if (id) ids[id] = 1
5960
if (scripts[path] == 2) callback()
@@ -79,7 +80,7 @@
7980
fn()
8081
}
8182
el.async = 1
82-
el.src = path
83+
el.src = urlArgs ? path + (path.indexOf('?') === -1 ? '?' : '&') + urlArgs : path;
8384
head.insertBefore(el, head.lastChild)
8485
}
8586

@@ -95,6 +96,9 @@
9596
$script.path = function (p) {
9697
scriptpath = p
9798
}
99+
$script.urlArgs = function (str) {
100+
urlArgs = str;
101+
}
98102
$script.ready = function (deps, ready, req) {
99103
deps = deps[push] ? deps : [deps]
100104
var missing = [];

dist/script.min.js

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"jsonp",
1010
"loader"
1111
],
12-
"version": "2.5.3",
12+
"version": "2.5.4",
1313
"homepage": "https://github.com/ded/script.js",
1414
"author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)",
1515
"contributors": [

0 commit comments

Comments
 (0)