From 2109af73f84b4346637bfd00b20af596fa3f8b35 Mon Sep 17 00:00:00 2001 From: Kyle Simpson Date: Thu, 25 Nov 2010 17:10:46 -0600 Subject: [PATCH] v1.0.4 -- updating to fix for FF 4b8pre, using `async=false` functionality --- LAB.min.js | 4 ++-- LAB.src.js | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/LAB.min.js b/LAB.min.js index 76c8d5b..958d4f2 100644 --- a/LAB.min.js +++ b/LAB.min.js @@ -1,5 +1,5 @@ /*! LAB.js (LABjs :: Loading And Blocking JavaScript) - v1.0.3 (c) Kyle Simpson + v1.0.4 (c) Kyle Simpson MIT License */ -(function(p){var q="string",w="head",H="body",Y="script",t="readyState",j="preloaddone",x="loadtrigger",I="srcuri",C="preload",Z="complete",y="done",z="which",J="preserve",D="onreadystatechange",ba="onload",K="hasOwnProperty",bb="script/cache",L="[object ",bv=L+"Function]",bw=L+"Array]",e=null,h=true,i=false,n=p.document,bx=p.location,bc=p.ActiveXObject,A=p.setTimeout,bd=p.clearTimeout,M=function(a){return n.getElementsByTagName(a)},N=Object.prototype.toString,O=function(){},r={},P={},be=/^[^?#]*\//.exec(bx.href)[0],bf=/^\w+\:\/\/\/?[^\/]+/.exec(be)[0],by=M(Y),bg=p.opera&&N.call(p.opera)==L+"Opera]",bh=("MozAppearance"in n.documentElement.style),u={cache:!(bh||bg),order:bh||bg,xhr:h,dupe:h,base:"",which:w};u[J]=i;u[C]=h;r[w]=n.head||M(w);r[H]=M(H);function Q(a){return N.call(a)===bv}function R(a,b){var c=/^\w+\:\/\//,d;if(typeof a!=q)a="";if(typeof b!=q)b="";d=(c.test(a)?"":b)+a;return((c.test(d)?"":(d.charAt(0)==="/"?bf:be))+d)}function bz(a){return(R(a).indexOf(bf)===0)}function bA(a){var b,c=-1;while(b=by[++c]){if(typeof b.src==q&&a===R(b.src)&&b.type!==bb)return h}return i}function E(v,k){v=!(!v);if(k==e)k=u;var bi=i,B=v&&k[C],bj=B&&k.cache,F=B&&k.order,bk=B&&k.xhr,bB=k[J],bC=k.which,bD=k.base,bl=O,S=i,G,s=h,l={},T=[],U=e;B=bj||bk||F;function bm(a,b){if((a[t]&&a[t]!==Z&&a[t]!=="loaded")||b[y]){return i}a[ba]=a[D]=e;return h}function V(a,b,c){c=!(!c);if(!c&&!(bm(a,b)))return;b[y]=h;for(var d in l){if(l[K](d)&&!(l[d][y]))return}bi=h;bl()}function bn(a){if(Q(a[x])){a[x]();a[x]=e}}function bE(a,b){if(!bm(a,b))return;b[j]=h;A(function(){r[b[z]].removeChild(a);bn(b)},0)}function bF(a,b){if(a[t]===4){a[D]=O;b[j]=h;A(function(){bn(b)},0)}}function W(b,c,d,g,f,m){var o=b[z];A(function(){if("item"in r[o]){if(!r[o][0]){A(arguments.callee,25);return}r[o]=r[o][0]}var a=n.createElement(Y);if(typeof d==q)a.type=d;if(typeof g==q)a.charset=g;if(Q(f)){a[ba]=a[D]=function(){f(a,b)};a.src=c}r[o].insertBefore(a,(o===w?r[o].firstChild:e));if(typeof m==q){a.text=m;V(a,b,h)}},0)}function bo(a,b,c,d){P[a[I]]=h;W(a,b,c,d,V)}function bp(a,b,c,d){var g=arguments;if(s&&a[j]==e){a[j]=i;W(a,b,bb,d,bE)}else if(!s&&a[j]!=e&&!a[j]){a[x]=function(){bp.apply(e,g)}}else if(!s){bo.apply(e,g)}}function bq(a,b,c,d){var g=arguments,f;if(s&&a[j]==e){a[j]=i;f=a.xhr=(bc?new bc("Microsoft.XMLHTTP"):new p.XMLHttpRequest());f[D]=function(){bF(f,a)};f.open("GET",b);f.send("")}else if(!s&&a[j]!=e&&!a[j]){a[x]=function(){bq.apply(e,g)}}else if(!s){P[a[I]]=h;W(a,b,c,d,e,a.xhr.responseText);a.xhr=e}}function br(a){if(a.allowDup==e)a.allowDup=k.dupe;var b=a.src,c=a.type,d=a.charset,g=a.allowDup,f=R(b,bD),m,o=bz(f);if(typeof d!=q)d=e;g=!(!g);if(!g&&((P[f]!=e)||(s&&l[f])||bA(f))){if(l[f]!=e&&l[f][j]&&!l[f][y]&&o){V(e,l[f],h)}return}if(l[f]==e)l[f]={};m=l[f];if(m[z]==e)m[z]=bC;m[y]=i;m[I]=f;S=h;if(!F&&bk&&o)bq(m,f,c,d);else if(!F&&bj)bp(m,f,c,d);else bo(m,f,c,d)}function bs(a){T.push(a)}function X(a){if(v&&!F)bs(a);if(!v||B)a()}function bt(a){var b=[],c;for(c=-1;++c, fix a bug in IE6 if tag is present -- otherwise, insertBefore(...,null) acts just like appendChild() append_to[_script_which].insertBefore(scriptElem,(_script_which===sHEAD?append_to[_script_which].firstChild:nNULL));