cooolar-base
Advanced tools
Comparing version 0.0.1 to 0.0.11
@@ -1634,2 +1634,62 @@ /** | ||
var ScriptHandler = function () { | ||
function ScriptHandler() { | ||
} | ||
ScriptHandler._push = function _push(Type) {}; | ||
var _proto = ScriptHandler.prototype; | ||
_proto.load = function load(url, options, callback) { | ||
if (typeof url === 'string') { | ||
url = { | ||
load: url, | ||
original: url | ||
}; | ||
} | ||
if (typeof options === 'function') { | ||
callback = options; | ||
options = {}; | ||
} | ||
this._loadScript(url.load, options, function (err, extra) { | ||
if (!err) { | ||
callback(null, extra); | ||
} else { | ||
callback(err); | ||
} | ||
}); | ||
}; | ||
_proto._loadScript = function _loadScript(url, options, callback) { | ||
var head = document.head; | ||
var element = document.createElement('script'); | ||
if (options.async == null) { | ||
options.async = true; | ||
} | ||
element.async = options.async; | ||
element.addEventListener('error', function (e) { | ||
callback("Script: " + e.target.src + " failed to load"); | ||
}, false); | ||
var done = false; | ||
element.onload = element.onreadystatechange = function () { | ||
if (!done && (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete')) { | ||
done = true; | ||
callback(null, element); | ||
} | ||
}; | ||
element.src = url; | ||
head.appendChild(element); | ||
}; | ||
return ScriptHandler; | ||
}(); | ||
var scriptHandler = new ScriptHandler(); | ||
exports.EventHandler = EventHandler; | ||
@@ -1639,2 +1699,3 @@ exports.Http = Http; | ||
exports.ReadStream = ReadStream; | ||
exports.ScriptHandler = ScriptHandler; | ||
exports.SortedLoopArray = SortedLoopArray; | ||
@@ -1659,2 +1720,3 @@ exports.Tags = Tags; | ||
exports.revision = revision; | ||
exports.scriptHandler = scriptHandler; | ||
exports.string = string; | ||
@@ -1661,0 +1723,0 @@ exports.type = type; |
{ | ||
"name": "cooolar-base", | ||
"version": "0.0.1", | ||
"version": "0.0.11", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -0,0 +0,0 @@ >CooolAR Base |
@@ -0,0 +0,0 @@ import babel from '@rollup/plugin-babel'; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
32
174414
4956
2