source: trunk/spip/esqueleto-redcta/plugins/magusine/ie7/ie7-quirks.js @ 133

Last change on this file since 133 was 80, checked in by guille, 16 years ago

el plugin completo

File size: 2.2 KB
RevLine 
[80]1/*
2        IE7, version 0.9 (alpha) (2005-08-19)
3        Copyright: 2004-2005, Dean Edwards (http://dean.edwards.name/)
4        License: http://creativecommons.org/licenses/LGPL/2.1/
5*/
6IE7.addModule("ie7-quirks",function(){if(quirksMode){var F="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");for(var i=0;i<F.length;i++){F[F[i]]=F[i-1]||"0.67em"}ie7CSS.addFix(new RegExp("(font(-size)?\\s*:\\s*)([\\w\\-\\.]+)"),function(m,o){return m[o+1]+(F[m[o+3]]||m[o+3])});if(appVersion<6){var N=/^\-/,L=/(em|ex)$/i;var EM=/em$/i,EX=/ex$/i;function _2(e){var s=1;_0.style.fontFamily=e.currentStyle.fontFamily;_0.style.lineHeight=e.currentStyle.lineHeight;while(e!=body){var f=e.currentStyle["ie7-font-size"];if(f){if(EM.test(f))s*=parseFloat(f);else if(PERCENT.test(f))s*=(parseFloat(f)/100);else if(EX.test(f))s*=(parseFloat(f)/2);else{_0.style.fontSize=f;return 1}}e=e.parentElement}return s};var _0=createTempElement();getPixelValue=function(e,v){if(PIXEL.test(v||0))return parseInt(v||0);var scale=N.test(v)?-1:1;if(L.test(v))scale*=_2(e);_0.style.width=(scale<0)?v.slice(1):v;body.appendChild(_0);v=scale*_0.offsetWidth;_0.removeNode();return parseInt(v)};HEADER=HEADER.replace(/(font(-size)?\s*:\s*([^\s;}\/]*))/gi,"ie7-font-size:$3;$1");ie7CSS.addFix(/cursor\s*:\s*pointer/,"cursor:hand");ie7CSS.addFix(/display\s*:\s*list-item/,"display:block")}function getPaddingWidth(e){return getPixelValue(e,e.currentStyle.paddingLeft)+getPixelValue(e,e.currentStyle.paddingRight)};function _1(e){if(appVersion<5.5&&ie7Layout)ie7Layout.boxSizing(e.parentElement);var p=e.parentElement;var m=p.offsetWidth-e.offsetWidth-getPaddingWidth(p);var a=(e.currentStyle["ie7-margin"]&&e.currentStyle.marginRight=="auto")||e.currentStyle["ie7-margin-right"]=="auto";switch(p.currentStyle.textAlign){case"right":m=(a)?parseInt(m/2):0;e.runtimeStyle.marginRight=parseInt(m)+"px";break;case"center":if(a)m=0;default:if(a)m=parseInt(m/2);e.runtimeStyle.marginLeft=parseInt(m)+"px"}};ie7CSS.addRecalc("margin(-left|-right)?","[^};]*auto",function(e){if(register(_1,e,e.parentElement&&e.currentStyle.display=="block"&&e.currentStyle.marginLeft=="auto"&&e.currentStyle.position!="absolute")){_1(e)}});addResize(function(){for(var i in _1.elements){e=_1.elements[i];e.runtimeStyle.marginLeft=e.runtimeStyle.marginRight="";_1(e)}})}});
Note: See TracBrowser for help on using the repository browser.