From 2ba9bdb3d81026c7d1984b1ca4a2af37478f56b3 Mon Sep 17 00:00:00 2001 From: Lubber Date: Mon, 16 Oct 2017 09:24:43 +0200 Subject: [PATCH] updated minified version --- stackload.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stackload.min.js b/stackload.min.js index 20754a2..0b12e69 100644 --- a/stackload.min.js +++ b/stackload.min.js @@ -6,4 +6,4 @@ * @license GPLv3 https://gitlab.com/lubber/stackload/blob/master/LICENSE */ -!function(window,document){var registry=[],fullStack=[],currentLoadIndex=0,callBacks=[],stopAll=!1,stackLoadError=function(e){window.console&&console.error("[StackLoad Error] Missing file: "+(e.target.src?e.target.src:e.target.href)),!1===callBacks[0].error(e)&&(stopAll=!0);var t=e.target;t.parentNode.removeChild(t),stackLoadDone(e)},stackLoadDone=function(e){var t=e.target;if(t.removeEventListener("error",stackLoadError),t.removeEventListener("load",stackLoadDone),currentLoadIndex++,stopAll){var r=callBacks[0].doneIndex-currentLoadIndex;r>0&&(fullStack.splice(currentLoadIndex,r),callBacks.shift(),callBacks.forEach(function(e,t,n){n[t].doneIndex-=r}))}else currentLoadIndex===callBacks[0].doneIndex&&(callBacks[0].success(),callBacks.shift()),currentLoadIndex===fullStack.length||stopAll||loadSingle()},loadSingle=function(){var o=fullStack[currentLoadIndex];try{if(!o.check||void 0===eval(o.check)){var element;o.type&&"css"===o.type?(element=document.createElement("link"),element.type="text/css",element.rel="stylesheet",element.href=o.url):(element=document.createElement("script"),element.type="text/javascript",element.src=o.url,element.async=!1),document.head.appendChild(element),element.addEventListener("load",stackLoadDone),element.addEventListener("error",stackLoadError)}}catch(e){}},setup=function(e){if("string"==typeof e||e.url?e={files:[e]}:Array.isArray(e)&&(e={files:e}),e.files){var t=[];("string"==typeof e.files||e.files.url)&&(e.files=[e.files]),e.files.forEach(function(e){if("string"==typeof e&&(e={url:e}),e.url&&-1===registry.indexOf(e.url)){if(!e.type){var r=e.url.match(/\.([0-9a-zA-Z]+)(?:[?#]|$)/i);r&&(e.type=r[1].toLowerCase())}t.push(e),registry.push(e.url)}});var r=t.length;if(r>0){var n=(fullStack=fullStack.concat(t)).length;"function"!=typeof e.success&&(e.success=function(){}),"function"!=typeof e.error&&(e.error=function(){}),callBacks.push({doneIndex:n,success:e.success,error:e.error}),currentLoadIndex===n-r&&loadSingle()}}};window.stackLoad=function(e){return stopAll=!1,setup(e),{then:function(e){return setup(e),this}}}}(window,document); \ No newline at end of file +!function(window,document){var registry=[],fullStack=[],currentLoadIndex=0,callBacks=[],stopAll=!1,stackLoadError=function(e){window.console&&console.error("[StackLoad Error] Missing file: "+(e.target.src?e.target.src:e.target.href)),!1===callBacks[0].error(e)&&(stopAll=!0);var t=e.target;t.parentNode.removeChild(t),stackLoadDone(e)},stackLoadDone=function(e){var t=e.target;if(t.removeEventListener("error",stackLoadError),t.removeEventListener("load",stackLoadDone),currentLoadIndex++,t.jsonp&&t.parentNode.removeChild(t),stopAll){var r=callBacks[0].doneIndex-currentLoadIndex;r>0&&(fullStack.splice(currentLoadIndex,r),callBacks.shift(),callBacks.forEach(function(e,t,n){n[t].doneIndex-=r}))}else currentLoadIndex===callBacks[0].doneIndex&&(callBacks[0].success(),callBacks.shift()),currentLoadIndex===fullStack.length||stopAll||loadSingle()},loadSingle=function(){var o=fullStack[currentLoadIndex];try{if(!o.check||void 0===eval(o.check)){var element;o.type&&"css"===o.type?(element=document.createElement("link"),element.type="text/css",element.rel="stylesheet",element.href=o.url):(element=document.createElement("script"),element.type="text/javascript",element.src=o.url,element.async=!1,o.type&&"jsonp"===o.type&&(element.jsonp=!0)),document.head.appendChild(element),element.addEventListener("load",stackLoadDone),element.addEventListener("error",stackLoadError)}}catch(e){}},setup=function(e){if("string"==typeof e||e.url?e={files:[e]}:Array.isArray(e)&&(e={files:e}),e.files){var t=[];("string"==typeof e.files||e.files.url)&&(e.files=[e.files]),e.files.forEach(function(e){if("string"==typeof e&&(e={url:e}),e.url&&-1===registry.indexOf(e.url)){if(!e.type){var r=e.url.match(/\.([0-9a-zA-Z]+)(?:[?#]|$)/i);r&&(e.type=r[1].toLowerCase())}if("jsonp"===e.type.toLowerCase()){var n=(new Date).getTime();e.url.match(/\?/)?e.url+="&_="+n:e.url+="?_="+n}t.push(e),registry.push(e.url)}});var r=t.length;if(r>0){var n=(fullStack=fullStack.concat(t)).length;"function"!=typeof e.success&&(e.success=function(){}),"function"!=typeof e.error&&(e.error=function(){}),callBacks.push({doneIndex:n,success:e.success,error:e.error}),currentLoadIndex===n-r&&loadSingle()}}};window.stackLoad=function(e){return stopAll=!1,setup(e),{then:function(e){return setup(e),this}}}}(window,document); \ No newline at end of file