forked from berklee/nbl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nbl.plus.min.js
1 lines (1 loc) · 1.05 KB
/
nbl.plus.min.js
1
(function(g){function j(a,d){if(!a)for(var b=0,c=g.getElementsByTagName("script");b<c.length;){if(a=eval("("+c[b].getAttribute("data-nbl")+")")){k=c[b].parentNode;break}b++}a&&f(a,d||l)}function l(){}var m={},n,f,k=g.head||g.body||g.documentElement;f=function(a,d){var b=typeof a;if("string"==b)n(a,d);else if(a instanceof Array)for(var c=a.length,e=function(){--c||d()},b=0;b<a.length;b++)f(a[b],e);else if("function"==b)a(d);else if("object"==b&&a.load)f(a.load,function(){a.callback&&a.callback();a.then?f(a.then,d):d()});else throw"Bad item type "+a;};n=function(a,d){function b(){m[f]=!0;d&&d()}var c,e,f=a.replace(/.+\/|\.min\.js|\.js|\?.+|\W/gi,""),h={j:{b:"script",a:"src"},cs:{b:"link",a:"href",c:"stylesheet"},i:{b:"img",a:"src"}};e=(e=a.match(/\.(cs|j)s($|\?)/i))?e[1]:"i";m[f]?b():(c=g.createElement(h[e].b),c.setAttribute(h[e].a,a),h[e].c?(c.setAttribute("rel",h[e].c),b()):c.onload=c.onreadystatechange=function(){if(!this.readyState||/de|te/.test(this.readyState))this.onload=this.onreadystatechange=l,b()},k.appendChild(c))};window.nbl={l:j};j()})(document);