web-manager 2.1.22 → 2.1.24
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/dom.js +21 -16
- package/package.json +2 -2
package/lib/dom.js
CHANGED
@@ -250,22 +250,27 @@ Dom.prototype.exists = function() {
|
|
250
250
|
}
|
251
251
|
|
252
252
|
Dom.loadScript = function(options, callback) {
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
253
|
+
return new Promise(function(resolve, reject) {
|
254
|
+
options = options || {};
|
255
|
+
options.async = (typeof options.async === 'undefined') ? false : options.async;
|
256
|
+
options.crossorigin = (typeof options.crossorigin === 'undefined') ? false : options.crossorigin;
|
257
|
+
var s = document.createElement('script');
|
258
|
+
s.src = options.src;
|
259
|
+
s.async = options.async;
|
260
|
+
if (options.crossorigin) {
|
261
|
+
s.setAttribute('crossorigin','*');
|
262
|
+
}
|
263
|
+
s.onload = function() {
|
264
|
+
callback();
|
265
|
+
return resolve();
|
266
|
+
};
|
267
|
+
s.onerror = function() {
|
268
|
+
var error = new Error('Failed to load script ' + options.src);
|
269
|
+
callback(error);
|
270
|
+
return reject(error);
|
271
|
+
};
|
272
|
+
document.head.appendChild(s);
|
273
|
+
});
|
269
274
|
}
|
270
275
|
|
271
276
|
Dom.select = function(selector, options) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "web-manager",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.24",
|
4
4
|
"description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -23,7 +23,7 @@
|
|
23
23
|
},
|
24
24
|
"homepage": "https://itwcreativeworks.com",
|
25
25
|
"dependencies": {
|
26
|
-
"@sentry/browser": "^6.
|
26
|
+
"@sentry/browser": "^6.15.0",
|
27
27
|
"cookieconsent": "^3.1.1",
|
28
28
|
"firebase": "^8.10.0",
|
29
29
|
"lazysizes": "^5.3.2"
|