~ted/lazr-js/annoying-debug-message

« back to all changes in this revision

Viewing changes to src-js/lazrjs/yui/dom/dom-style-min.js

  • Committer: Launchpad Patch Queue Manager
  • Date: 2010-09-09 14:20:30 UTC
  • mfrom: (182.1.3 yui-3.2)
  • Revision ID: launchpad@pqm.canonical.com-20100909142030-13w6vo0ixfysxc15
[r=beuno] Update lazr-js to yui-3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3
3
Code licensed under the BSD License:
4
4
http://developer.yahoo.com/yui/license.html
5
 
version: 3.1.2
6
 
build: 56
 
5
version: 3.2.0
 
6
build: 2676
7
7
*/
8
 
YUI.add("dom-style",function(A){(function(E){var C="documentElement",B="defaultView",D="ownerDocument",N="style",P="float",F="cssFloat",G="styleFloat",L="transparent",I="getComputedStyle",O=E.config.doc,K=undefined,J=E.DOM,M=/color$/i,H=/width|height|top|left|right|bottom|margin|padding/i;E.mix(J,{DEFAULT_UNIT:"px",CUSTOM_STYLES:{},setStyle:function(T,Q,V,S){S=S||T.style;var R=J.CUSTOM_STYLES,U;if(S){if(V===null||V===""){V="";}else{if(!isNaN(new Number(V))&&H.test(Q)){V+=J.DEFAULT_UNIT;}}if(Q in R){if(R[Q].set){R[Q].set(T,V,S);return;}else{if(typeof R[Q]==="string"){Q=R[Q];}}}S[Q]=V;}},getStyle:function(T,Q,S){S=S||T.style;var R=J.CUSTOM_STYLES,U="";if(S){if(Q in R){if(R[Q].get){return R[Q].get(T,Q,S);}else{if(typeof R[Q]==="string"){Q=R[Q];}}}U=S[Q];if(U===""){U=J[I](T,Q);}}return U;},setStyles:function(R,S){var Q=R.style;E.each(S,function(T,U){J.setStyle(R,U,T,Q);},J);},getComputedStyle:function(R,Q){var T="",S=R[D];if(R[N]){T=S[B][I](R,null)[Q];}return T;}});if(O[C][N][F]!==K){J.CUSTOM_STYLES[P]=F;}else{if(O[C][N][G]!==K){J.CUSTOM_STYLES[P]=G;}}if(E.UA.opera){J[I]=function(S,R){var Q=S[D][B],T=Q[I](S,"")[R];if(M.test(R)){T=E.Color.toRGB(T);}return T;};}if(E.UA.webkit){J[I]=function(S,R){var Q=S[D][B],T=Q[I](S,"")[R];if(T==="rgba(0, 0, 0, 0)"){T=L;}return T;};}})(A);(function(D){var B=parseInt,C=RegExp;D.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(E){if(!D.Color.re_RGB.test(E)){E=D.Color.toHex(E);}if(D.Color.re_hex.exec(E)){E="rgb("+[B(C.$1,16),B(C.$2,16),B(C.$3,16)].join(", ")+")";}return E;},toHex:function(F){F=D.Color.KEYWORDS[F]||F;if(D.Color.re_RGB.exec(F)){F=[Number(C.$1).toString(16),Number(C.$2).toString(16),Number(C.$3).toString(16)];for(var E=0;E<F.length;E++){if(F[E].length<2){F[E]="0"+F[E];}}F=F.join("");}if(F.length<6){F=F.replace(D.Color.re_hex3,"$1$1");}if(F!=="transparent"&&F.indexOf("#")<0){F="#"+F;}return F.toUpperCase();}};})(A);(function(D){var W="hasLayout",K="px",L="filter",B="filters",T="opacity",M="auto",G="borderWidth",J="borderTopWidth",Q="borderRightWidth",V="borderBottomWidth",H="borderLeftWidth",I="width",O="height",R="transparent",S="visible",C="getComputedStyle",Z=undefined,X=document.documentElement,P=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,E=function(Y){return Y.currentStyle||Y.style;},N={CUSTOM_STYLES:{},get:function(Y,b){var a="",c;if(Y){c=E(Y)[b];if(b===T&&D.DOM.CUSTOM_STYLES[T]){a=D.DOM.CUSTOM_STYLES[T].get(Y);}else{if(!c||(c.indexOf&&c.indexOf(K)>-1)){a=c;}else{if(D.DOM.IE.COMPUTED[b]){a=D.DOM.IE.COMPUTED[b](Y,b);}else{if(P.test(c)){a=N.getPixel(Y,b)+K;}else{a=c;}}}}}return a;},sizeOffsets:{width:["Left","Right"],height:["Top","Bottom"],top:["Top"],bottom:["Bottom"]},getOffset:function(b,g){var d=E(b)[g],Y=g.charAt(0).toUpperCase()+g.substr(1),f="offset"+Y,a="pixel"+Y,e=N.sizeOffsets[g],c="";if(d===M||d.indexOf("%")>-1){c=b["offset"+Y];if(e[0]){c-=N.getPixel(b,"padding"+e[0]);c-=N.getBorderWidth(b,"border"+e[0]+"Width",1);}if(e[1]){c-=N.getPixel(b,"padding"+e[1]);c-=N.getBorderWidth(b,"border"+e[1]+"Width",1);}}else{if(!b.style[a]&&!b.style[g]){b.style[g]=d;}c=b.style[a];}return c+K;},borderMap:{thin:"2px",medium:"4px",thick:"6px"},getBorderWidth:function(a,c,Y){var b=Y?"":K,d=a.currentStyle[c];if(d.indexOf(K)<0){if(N.borderMap[d]&&a.currentStyle.borderStyle!=="none"){d=N.borderMap[d];}else{d=0;}}return(Y)?parseFloat(d):d;},getPixel:function(b,Y){var d=null,a=E(b),e=a.right,c=a[Y];b.style.right=c;d=b.style.pixelRight;b.style.right=e;return d;},getMargin:function(b,Y){var c,a=E(b);if(a[Y]==M){c=0;}else{c=N.getPixel(b,Y);}return c+K;},getVisibility:function(a,Y){var b;while((b=a.currentStyle)&&b[Y]=="inherit"){a=a.parentNode;}return(b)?b[Y]:S;},getColor:function(a,Y){var b=E(a)[Y];if(!b||b===R){D.DOM.elementByAxis(a,"parentNode",null,function(c){b=E(c)[Y];if(b&&b!==R){a=c;return true;}});}return D.Color.toRGB(b);},getBorderColor:function(a,Y){var b=E(a),c=b[Y]||b.color;return D.Color.toRGB(D.Color.toHex(c));}},F={};try{if(X.style[T]===Z&&X[B]){D.DOM.CUSTOM_STYLES[T]={get:function(a){var c=100;try{c=a[B]["DXImageTransform.Microsoft.Alpha"][T];}catch(b){try{c=a[B]("alpha")[T];}catch(Y){}}return c/100;},set:function(a,d,Y){var c,b;if(d===""){b=E(a);c=(T in b)?b[T]:1;d=c;}if(typeof Y[L]=="string"){Y[L]="alpha("+T+"="+d*100+")";if(!a.currentStyle||!a.currentStyle[W]){Y.zoom=1;}}}};}}catch(U){}try{document.createElement("div").style.height="-1px";}catch(U){D.DOM.CUSTOM_STYLES.height={set:function(b,c,a){var Y=parseFloat(c);if(isNaN(Y)||Y>=0){a.height=c;}else{}}};D.DOM.CUSTOM_STYLES.width={set:function(b,c,a){var Y=parseFloat(c);if(isNaN(Y)||Y>=0){a.width=c;}else{}}};}F[I]=F[O]=N.getOffset;F.color=F.backgroundColor=N.getColor;F[G]=F[J]=F[Q]=F[V]=F[H]=N.getBorderWidth;F.marginTop=F.marginRight=F.marginBottom=F.marginLeft=N.getMargin;F.visibility=N.getVisibility;F.borderColor=F.borderTopColor=F.borderRightColor=F.borderBottomColor=F.borderLeftColor=N.getBorderColor;if(!D.config.win[C]){D.DOM[C]=N.get;}D.namespace("DOM.IE");D.DOM.IE.COMPUTED=F;D.DOM.IE.ComputedStyle=N;})(A);A.mix(A.DOM,{setWidth:function(C,B){A.DOM._setSize(C,"width",B);},setHeight:function(C,B){A.DOM._setSize(C,"height",B);},_getOffsetProp:function(B,C){return"offset"+C.charAt(0).toUpperCase()+C.substr(1);},_setSize:function(B,E,D){var C;A.DOM.setStyle(B,E,D+"px");C=B[A.DOM._getOffsetProp(B,E)];D=D-(C-D);if(D<0){D=0;}A.DOM.setStyle(B,E,D+"px");}});},"3.1.2",{requires:["dom-base"]});
 
 
b'\\ No newline at end of file'
 
8
YUI.add("dom-style",function(a){(function(e){var o="documentElement",b="defaultView",n="ownerDocument",h="style",i="float",q="cssFloat",r="styleFloat",k="transparent",d="getComputedStyle",c="getBoundingClientRect",g=e.config.doc,s=undefined,p=e.DOM,f="transform",l=["WebkitTransform","MozTransform","OTransform"],m=/color$/i,j=/width|height|top|left|right|bottom|margin|padding/i;e.Array.each(l,function(t){if(t in g[o].style){f=t;}});e.mix(p,{DEFAULT_UNIT:"px",CUSTOM_STYLES:{},setStyle:function(w,t,y,v){v=v||w.style;var u=p.CUSTOM_STYLES,x;if(v){if(y===null||y===""){y="";}else{if(!isNaN(new Number(y))&&j.test(t)){y+=p.DEFAULT_UNIT;}}if(t in u){if(u[t].set){u[t].set(w,y,v);return;}else{if(typeof u[t]==="string"){t=u[t];}}}v[t]=y;}},getStyle:function(w,t,v){v=v||w.style;var u=p.CUSTOM_STYLES,x="";if(v){if(t in u){if(u[t].get){return u[t].get(w,t,v);}else{if(typeof u[t]==="string"){t=u[t];}}}x=v[t];if(x===""){x=p[d](w,t);}}return x;},setStyles:function(u,v){var t=u.style;e.each(v,function(w,x){p.setStyle(u,x,w,t);},p);},getComputedStyle:function(u,t){var w="",v=u[n];if(u[h]){w=v[b][d](u,null)[t];}return w;}});if(g[o][h][q]!==s){p.CUSTOM_STYLES[i]=q;}else{if(g[o][h][r]!==s){p.CUSTOM_STYLES[i]=r;}}if(e.UA.opera){p[d]=function(v,u){var t=v[n][b],w=t[d](v,"")[u];if(m.test(u)){w=e.Color.toRGB(w);}return w;};}if(e.UA.webkit){p[d]=function(v,u){var t=v[n][b],w=t[d](v,"")[u];if(w==="rgba(0, 0, 0, 0)"){w=k;}return w;};}e.DOM._getAttrOffset=function(x,u){var z=e.DOM[d](x,u),w=x.offsetParent,t,v,y;if(z==="auto"){t=e.DOM.getStyle(x,"position");if(t==="static"||t==="relative"){z=0;}else{if(w&&w[c]){v=w[c]()[u];y=x[c]()[u];if(u==="left"||u==="top"){z=y-v;}else{z=v-x[c]()[u];}}}}return z;};e.DOM._getOffset=function(t){var v,u=null;if(t){v=p.getStyle(t,"position");u=[parseInt(p[d](t,"left"),10),parseInt(p[d](t,"top"),10)];if(isNaN(u[0])){u[0]=parseInt(p.getStyle(t,"left"),10);if(isNaN(u[0])){u[0]=(v==="relative")?0:t.offsetLeft||0;}}if(isNaN(u[1])){u[1]=parseInt(p.getStyle(t,"top"),10);if(isNaN(u[1])){u[1]=(v==="relative")?0:t.offsetTop||0;}}}return u;};p.CUSTOM_STYLES.transform={set:function(u,v,t){t[f]=v;},get:function(u,t){return p[d](u,f);}};})(a);(function(d){var b=parseInt,c=RegExp;d.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(e){if(!d.Color.re_RGB.test(e)){e=d.Color.toHex(e);}if(d.Color.re_hex.exec(e)){e="rgb("+[b(c.$1,16),b(c.$2,16),b(c.$3,16)].join(", ")+")";}return e;},toHex:function(f){f=d.Color.KEYWORDS[f]||f;if(d.Color.re_RGB.exec(f)){f=[Number(c.$1).toString(16),Number(c.$2).toString(16),Number(c.$3).toString(16)];for(var e=0;e<f.length;e++){if(f[e].length<2){f[e]="0"+f[e];}}f=f.join("");}if(f.length<6){f=f.replace(d.Color.re_hex3,"$1$1");}if(f!=="transparent"&&f.indexOf("#")<0){f="#"+f;}return f.toUpperCase();}};})(a);},"3.2.0",{requires:["dom-base"]});
 
 
b'\\ No newline at end of file'