forked from berklee/nbl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nbl.safe.min.js
1 lines (1 loc) · 939 Bytes
/
nbl.safe.min.js
1
(function(){var f=document,g={};function j(){}var k,l,m=f.head||f.body||f.documentElement;function p(a,c){a&&l(a,c||j)}l=function(a,c){var b=typeof a;if("string"==b)k(a,c);else if(a instanceof Array)for(var e=a.length,d=function(){--e||c()},b=0;b<a.length;b++)l(a[b],d);else if("function"==b)a(c);else if("object"==b&&a.load)l(a.load,function(){a.callback&&a.callback();a.then?l(a.then,c):c()});else throw"Bad item type "+a;}; k=function(a,c){function b(){g[n]=!0;c&&c()}var e,d,n=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"}};d=(d=a.match(/\.(cs|j)s($|\?)/i))?d[1]:"i";g[n]?b():(e=f.createElement(h[d].b),e.setAttribute(h[d].a,a),h[d].c?(e.setAttribute("rel",h[d].c),b()):e.onload=e.onreadystatechange=function(){if(!this.readyState||/de|te/.test(this.readyState))this.onload=this.onreadystatechange=j,b()},m.appendChild(e))};window.nbl={l:p}; p();}())