vue-script2
Advanced tools
Comparing version 1.1.0 to 1.1.1
/*! | ||
* vue-script2 v1.1.0 | ||
* vue-script2 v1.1.1 | ||
* (c) 2016 Greg Slepak | ||
@@ -20,3 +20,3 @@ * @license MIT License | ||
p: Promise.resolve(), | ||
version: '1.1.0', // grunt will over write to match package.json | ||
version: '1.1.1', // grunt will over write to match package.json | ||
loaded: {} // keys are the scripts that have been loaded | ||
@@ -23,0 +23,0 @@ }; |
/*! | ||
* vue-script2 v1.1.0 | ||
* vue-script2 v1.1.1 | ||
* (c) 2016 Greg Slepak | ||
* @license MIT License | ||
*/ | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.VueScript2=n()}(this,function(){"use strict";function e(e,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return new Promise(function(o,r){function c(){o(n)}var a=this,d=document.createElement("script");t.defaults2(d,t.omit(i,["unload"]),{type:"text/javascript"}),d.async=!1,d.src=n,d.onload=c,d.onreadystatechange=function(){return"complete"===a.readyState&&c()},d.onerror=function(){return r(new Error("failed to load:"+n))},e.appendChild(d)})}var n={installed:!1,p:Promise.resolve(),version:"1.1.0",loaded:{}};n.install=function(i){arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(!n.installed){var o=["unload"],r=o.concat(["src","type","async","integrity","text","crossorigin"]);i.component("script2",{props:r,template:'<div style="display:none"><slot></slot></div>',ready:function(){var o=this,c=this.$el.parentElement;if(this.src){if(!n.loaded[this.src]){var a=t.omitBy(t.pick(this,r),t.isUndefined),d=function(){return e(c,o.src,a).then(function(){return n.loaded[o.src]=1})};t.isUndefined(this.async)?n.p=n.p.then(d):d()}}else n.p=n.p.then(function(){var e=document.createElement("script");e.type="text/javascript",e.appendChild(document.createTextNode(o.$el.innerHTML)),c.appendChild(e)});i.util.remove(this.$el)},destroyed:function(){this.unload&&(new Function(this.unload)(),delete n.loaded[this.src])}}),n.installed=!0}};var t={isUndefined:function(e){return void 0===e},pick:function(e,n){var t={};return n.forEach(function(n){return t[n]=e[n]}),t},omit:function(e,n){var t={};return Object.keys(e).forEach(function(i){-1===n.indexOf(i)&&(t[i]=e[i])}),t},omitBy:function(e,n){var t={};return Object.keys(e).forEach(function(i){n(e[i])||(t[i]=e[i])}),t},defaults2:function(e){for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;n>o;o++)i[o-1]=arguments[o];i.forEach(function(n){Object.keys(n).forEach(function(i){!t.isUndefined(e[i])&&""!==e[i]||""===n[i]||(e[i]=n[i])})})}};return n}); | ||
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.VueScript2=n()}(this,function(){"use strict";function e(e,n){var i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];return new Promise(function(o,r){function c(){o(n)}var a=this,d=document.createElement("script");t.defaults2(d,t.omit(i,["unload"]),{type:"text/javascript"}),d.async=!1,d.src=n,d.onload=c,d.onreadystatechange=function(){return"complete"===a.readyState&&c()},d.onerror=function(){return r(new Error("failed to load:"+n))},e.appendChild(d)})}var n={installed:!1,p:Promise.resolve(),version:"1.1.1",loaded:{}};n.install=function(i){arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(!n.installed){var o=["unload"],r=o.concat(["src","type","async","integrity","text","crossorigin"]);i.component("script2",{props:r,template:'<div style="display:none"><slot></slot></div>',ready:function(){var o=this,c=this.$el.parentElement;if(this.src){if(!n.loaded[this.src]){var a=t.omitBy(t.pick(this,r),t.isUndefined),d=function(){return e(c,o.src,a).then(function(){return n.loaded[o.src]=1})};t.isUndefined(this.async)?n.p=n.p.then(d):d()}}else n.p=n.p.then(function(){var e=document.createElement("script");e.type="text/javascript",e.appendChild(document.createTextNode(o.$el.innerHTML)),c.appendChild(e)});i.util.remove(this.$el)},destroyed:function(){this.unload&&(new Function(this.unload)(),delete n.loaded[this.src])}}),n.installed=!0}};var t={isUndefined:function(e){return void 0===e},pick:function(e,n){var t={};return n.forEach(function(n){return t[n]=e[n]}),t},omit:function(e,n){var t={};return Object.keys(e).forEach(function(i){-1===n.indexOf(i)&&(t[i]=e[i])}),t},omitBy:function(e,n){var t={};return Object.keys(e).forEach(function(i){n(e[i])||(t[i]=e[i])}),t},defaults2:function(e){for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;n>o;o++)i[o-1]=arguments[o];i.forEach(function(n){Object.keys(n).forEach(function(i){!t.isUndefined(e[i])&&""!==e[i]||""===n[i]||(e[i]=n[i])})})}};return n}); |
{ | ||
"name": "vue-script2", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Standardized, designer-friendly <script> behavior for your Single Page App", | ||
@@ -15,2 +15,6 @@ "main": "dist/vue-script2.js", | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/taoeffect/vue-script2.git" | ||
}, | ||
"keywords": [ | ||
@@ -17,0 +21,0 @@ "script", |
@@ -89,2 +89,3 @@ # vue-script2 | ||
- __1.1.1__ - Identical to `1.1.0`, just adds needed package.json info. | ||
- __1.1.0__ - Adds special support for `async` attribute. | ||
@@ -91,0 +92,0 @@ - __1.0.0__ - Initial release. |
@@ -9,3 +9,3 @@ // To use, just: | ||
p: Promise.resolve(), | ||
version: '1.1.0', // grunt will over write to match package.json | ||
version: '1.1.1', // grunt will over write to match package.json | ||
loaded: {} // keys are the scripts that have been loaded | ||
@@ -12,0 +12,0 @@ } |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
17468
97
1