Commit fe2e7c3f authored by catch's avatar catch
Browse files

Issue #3228351 by nod_, Phil Wolstenholme: Add loadjs library

parent 8c358672
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
"Cookies": true, "Cookies": true,
"Backbone": true, "Backbone": true,
"Modernizr": true, "Modernizr": true,
"loadjs": true,
"Popper": true, "Popper": true,
"Shepherd": true, "Shepherd": true,
"Sortable": true, "Sortable": true,
......
loadjs=function(){var h=function(){},c={},u={},f={};function o(e,n){if(e){var r=f[e];if(u[e]=n,r)for(;r.length;)r[0](e,n),r.splice(0,1)}}function l(e,n){e.call&&(e={success:e}),n.length?(e.error||h)(n):(e.success||h)(e)}function d(r,t,s,i){var c,o,e=document,n=s.async,u=(s.numRetries||0)+1,f=s.before||h,l=r.replace(/[\?|#].*$/,""),a=r.replace(/^(css|img)!/,"");i=i||0,/(^css!|\.css$)/.test(l)?((o=e.createElement("link")).rel="stylesheet",o.href=a,(c="hideFocus"in o)&&o.relList&&(c=0,o.rel="preload",o.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(l)?(o=e.createElement("img")).src=a:((o=e.createElement("script")).src=r,o.async=void 0===n||n),!(o.onload=o.onerror=o.onbeforeload=function(e){var n=e.type[0];if(c)try{o.sheet.cssText.length||(n="e")}catch(e){18!=e.code&&(n="e")}if("e"==n){if((i+=1)<u)return d(r,t,s,i)}else if("preload"==o.rel&&"style"==o.as)return o.rel="stylesheet";t(r,n,e.defaultPrevented)})!==f(r,o)&&e.head.appendChild(o)}function r(e,n,r){var t,s;if(n&&n.trim&&(t=n),s=(t?r:n)||{},t){if(t in c)throw"LoadJS";c[t]=!0}function i(n,r){!function(e,t,n){var r,s,i=(e=e.push?e:[e]).length,c=i,o=[];for(r=function(e,n,r){if("e"==n&&o.push(e),"b"==n){if(!r)return;o.push(e)}--i||t(o)},s=0;s<c;s++)d(e[s],r,n)}(e,function(e){l(s,e),n&&l({success:n,error:r},e),o(t,e)},s)}if(s.returnPromise)return new Promise(i);i()}return r.ready=function(e,n){return function(e,r){e=e.push?e:[e];var n,t,s,i=[],c=e.length,o=c;for(n=function(e,n){n.length&&i.push(e),--o||r(i)};c--;)t=e[c],(s=u[t])?n(t,s):(f[t]=f[t]||[]).push(n)}(e,function(e){l(n,e)}),r},r.done=function(e){o(e,[])},r.reset=function(){c={},u={},f={}},r.isDefined=function(e){return e in c},r}();
\ No newline at end of file
...@@ -95,6 +95,16 @@ drupal.announce: ...@@ -95,6 +95,16 @@ drupal.announce:
- core/drupal - core/drupal
- core/drupal.debounce - core/drupal.debounce
loadjs:
remote: https://github.com/muicss/loadjs
version: "4.2.0"
license:
name: MIT
url: https://raw.githubusercontent.com/muicss/loadjs/4.2.0/LICENSE.txt
gpl-compatible: true
js:
assets/vendor/loadjs/loadjs.min.js: { minified: true }
drupal.autocomplete: drupal.autocomplete:
version: VERSION version: VERSION
js: js:
......
...@@ -840,6 +840,7 @@ llamasarelame ...@@ -840,6 +840,7 @@ llamasarelame
llame llame
llamma llamma
lnumber lnumber
loadjs
localemark localemark
localetranslatedirty localetranslatedirty
localizable localizable
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
"jquery-form": "^4.3.0", "jquery-form": "^4.3.0",
"jquery-once": "^2.2.3", "jquery-once": "^2.2.3",
"js-cookie": "3.0.0-rc.0", "js-cookie": "3.0.0-rc.0",
"loadjs": "^4.2.0",
"minimist": "^1.2.2", "minimist": "^1.2.2",
"mkdirp": "^1.0.4", "mkdirp": "^1.0.4",
"nightwatch": "^1.6.3", "nightwatch": "^1.6.3",
......
...@@ -167,6 +167,10 @@ const assetsFolder = `${coreFolder}/assets/vendor`; ...@@ -167,6 +167,10 @@ const assetsFolder = `${coreFolder}/assets/vendor`;
pack: 'underscore', pack: 'underscore',
files: ['underscore-min.js', 'underscore-min.js.map'], files: ['underscore-min.js', 'underscore-min.js.map'],
}, },
{
pack: 'loadjs',
files: [{ from: 'dist/loadjs.min.js', to: 'loadjs.min.js' }],
},
].map(async ({ pack, files = [], folder = false, library = false }) => { ].map(async ({ pack, files = [], folder = false, library = false }) => {
const sourceFolder = pack; const sourceFolder = pack;
const libraryName = library || folder || pack; const libraryName = library || folder || pack;
......
...@@ -3610,6 +3610,11 @@ load-json-file@^4.0.0: ...@@ -3610,6 +3610,11 @@ load-json-file@^4.0.0:
pify "^3.0.0" pify "^3.0.0"
strip-bom "^3.0.0" strip-bom "^3.0.0"
loadjs@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/loadjs/-/loadjs-4.2.0.tgz#2a0336376397a6a43edf98c9ec3229ddd5abb6f6"
integrity sha512-AgQGZisAlTPbTEzrHPb6q+NYBMD+DP9uvGSIjSUM5uG+0jG15cb8axWpxuOIqrmQjn6scaaH8JwloiP27b2KXA==
locate-path@^2.0.0: locate-path@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment