Home | History | Annotate | Download | only in test

Lines Matching refs:shim

1 append(c,a)}})})();(function(){var e=false,d=false;var f=function(){var a=new Element("div").setStyles({position:"fixed",top:0,right:0}).inject(document.body);e=(a.offsetTop===0);a.dispose();d=true};Element.implement({pin:function(p,r){if(!d){f()}if(this.getStyle("display")=="none"){return this}var n,c=window.getScroll(),b,s;if(p!==false){n=this.getPosition();if(!this.retrieve("pin:_pinned")){var q={top:n.y-c.y,left:n.x-c.x,margin:"0px",padding:"0px"};if(e&&!r){this.setStyle("position","fixed").setStyles(q)}else{b=this.getOffsetParent();var o=this.getPosition(b),a=this.getStyles("left","top");if(b&&a.left=="auto"||a.top=="auto"){this.setPosition(o)}if(this.getStyle("position")=="static"){this.setStyle("position","absolute")}o={x:a.left.toInt()-c.x,y:a.top.toInt()-c.y};s=function(){if(!this.retrieve("pin:_pinned")){return}var g=window.getScroll();this.setStyles({left:o.x+g.x,top:o.y+g.y})}.bind(this);this.store("pin:_scrollFixer",s);window.addEvent("scroll",s)}this.store("pin:_pinned",true)}}else{if(!this.retrieve("pin:_pinned")){return this}b=this.getParent();var t=(b.getComputedStyle("position")!="static"?b:b.getOffsetParent());n=this.getPosition();this.store("pin:_pinned",false);s=this.retrieve("pin:_scrollFixer");if(!s){this.setStyles({position:"absolute",top:n.y+c.y,left:n.x+c.x})}else{this.store("pin:_scrollFixer",null);window.removeEvent("scroll",s)}this.removeClass("isPinned")}return this},unpin:function(){return this.pin(false)},togglePin:function(){return this.pin(!this.retrieve("pin:_pinned"))}})})();(function(c){var d=Element.Position={options:{relativeTo:document.body,position:{x:"center",y:"center"},offset:{x:0,y:0}},getOptions:function(a,b){b=Object.merge({},d.options,b);d.setPositionOption(b);d.setEdgeOption(b);d.setOffsetOption(a,b);d.setDimensionsOption(a,b);return b},setPositionOption:function(a){a.position=d.getCoordinateFromValue(a.position)},setEdgeOption:function(a){var b=d.getCoordinateFromValue(a.edge);a.edge=b?b:(a.position.x=="center"&&a.position.y=="center")?{x:"center",y:"center"}:{x:"left",y:"top"}},setOffsetOption:function(b,i){var j={x:0,y:0};var h={x:0,y:0};var a=b.measure(function(){return document.id(this.getOffsetParent())});if(!a||a==b.getDocument().body){return}h=a.getScroll();j=a.measure(function(){var e=this.getPosition();if(this.getStyle("position")=="fixed"){var f=window.getScroll();e.x+=f.x;e.y+=f.y}return e});i.offset={parentPositioned:a!=document.id(i.relativeTo),x:i.offset.x-j.x+h.x,y:i.offset.y-j.y+h.y}},setDimensionsOption:function(a,b){b.dimensions=a.getDimensions({computeSize:true,styles:["padding","border","margin"]})},getPosition:function(h,i){var j={};i=d.getOptions(h,i);var b=document.id(i.relativeTo)||document.body;d.setPositionCoordinates(i,j,b);if(i.edge){d.toEdge(j,i)}var a=i.offset;j.left=((j.x>=0||a.parentPositioned||i.allowNegative)?j.x:0).toInt();j.top=((j.y>=0||a.parentPositioned||i.allowNegative)?j.y:0).toInt();d.toMinMax(j,i);if(i.relFixedPosition||b.getStyle("position")=="fixed"){d.toRelFixedPosition(b,j)}if(i.ignoreScroll){d.toIgnoreScroll(b,j)}if(i.ignoreMargins){d.toIgnoreMargins(j,i)}j.left=Math.ceil(j.left);j.top=Math.ceil(j.top);delete j.x;delete j.y;return j},setPositionCoordinates:function(a,n,q){var o=a.offset.y,m=a.offset.x,p=(q==document.body)?window.getScroll():q.getPosition(),b=p.y,r=p.x,l=window.getSize();switch(a.position.x){case"left":n.x=r+m;break;case"right":n.x=r+m+q.offsetWidth;break;default:n.x=r+((q==document.body?l.x:q.offsetWidth)/2)+m;break}switch(a.position.y){case"top":n.y=b+o;break;case"bottom":n.y=b+o+q.offsetHeight;break;default:n.y=b+((q==document.body?l.y:q.offsetHeight)/2)+o;break}},toMinMax:function(h,g){var a={left:"x",top:"y"},b;["minimum","maximum"].each(function(e){["left","top"].each(function(f){b=g[e]?g[e][a[f]]:null;if(b!=null&&((e=="minimum")?h[f]<b:h[f]>b)){h[f]=b}})})},toRelFixedPosition:function(a,f){var b=window.getScroll();f.top+=b.y;f.left+=b.x},toIgnoreScroll:function(a,b){var f=a.getScroll();b.top-=f.y;b.left-=f.x},toIgnoreMargins:function(b,a){b.left+=a.edge.x=="right"?a.dimensions["margin-right"]:(a.edge.x!="center"?-a.dimensions["margin-left"]:-a.dimensions["margin-left"]+((a.dimensions["margin-right"]+a.dimensions["margin-left"])/2));b.top+=a.edge.y=="bottom"?a.dimensions["margin-bottom"]:(a.edge.y!="center"?-a.dimensions["margin-top"]:-a.dimensions["margin-top"]+((a.dimensions["margin-bottom"]+a.dimensions["margin-top"])/2))},toEdge:function(j,i){var h={},a=i.dimensions,b=i.edge;switch(b.x){case"left":h.x=0;break;case"right":h.x=-a.x-a.computedRight-a.computedLeft;break;default:h.x=-(Math.round(a.totalWidth/2));break}switch(b.y){case"top":h.y=0;break;case"bottom":h.y=-a.y-a.computedTop-a.computedBottom;break;default:h.y=-(Math.round(a.totalHeight/2));break}j.x+=h.x;j.y+=h.y},getCoordinateFromValue:function(a){if(typeOf(a)!="string"){return a}a=a.toLowerCase();return{x:a.test("left")?"left":(a.test("right")?"right":"center"),y:a.test(/upper|top/)?"top":(a.test("bottom")?"bottom":"center")}}};Element.implement({position:function(a){if(a&&(a.x!=null||a.y!=null)){return(c?c.apply(this,arguments):this)}var b=this.setStyle("position","absolute").calculatePosition(a);return(a&&a.returnPos)?b:this.setStyles(b)},calculatePosition:function(a){return d.getPosition(this,a)}})})(Element.prototype.position);Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"},isVisible:function(){var d=this.offsetWidth,c=this.offsetHeight;return(d==0&&c==0)?false:(d>0&&c>0)?true:this.style.display!="none"},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){var c;try{c=this.getStyle("display")}catch(d){}if(c=="none"){return this}return this.store("element:_originalDisplay",c||"").setStyle("display","none")},show:function(b){if(!b&&this.isDisplayed()){return this}b=b||this.retrieve("element:_originalDisplay")||"block";return this.setStyle("display",(b=="none")?"block":b)},swapClass:function(d,c){return this.removeClass(d).addClass(c)}});Document.implement({clearSelection:function(){if(window.getSelection){var d=window.getSelection();if(d&&d.removeAllRanges){d.removeAllRanges()}}else{if(document.selection&&document.selection.empty){try{document.selection.empty()}catch(c){}}}}});(function(){var b=false;this.IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:"iframeShim",src:'javascript:false;document.write("");',display:false,zIndex:null,margin:0,offset:{x:0,y:0},browsers:b},property:"IframeShim",initialize:function(d,a){this.element=document.id(d);if(this.occlude()){return this.occluded}this.setOptions(a);this.makeShim();return this},makeShim:function(){if(this.options.browsers){var e=this.element.getStyle("zIndex").toInt();if(!e){e=1;var f=this.element.getStyle("position");if(f=="static"||!f){this.element.setStyle("position","relative")}this.element.setStyle("zIndex",e)}e=((this.options.zIndex!=null||this.options.zIndex===0)&&e>this.options.zIndex)?this.options.zIndex:e-1;if(e<0){e=1}this.shim=new Element("iframe",{src:this.options.src,scrolling:"no",frameborder:0,styles:{zIndex:e,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className}).store("IframeShim",this);var a=(function(){this.shim.inject(this.element,"after");this[this.options.display?"show":"hide"]();this.fireEvent("inject")}).bind(this);if(!IframeShim.ready){window.addEvent("load",a)}else{a()}}else{this.position=this.hide=this.show=this.dispose=Function.from(this)}},position:function(){if(!IframeShim.ready||!this.shim){return this}var a=this.element.measure(function(){return this.getSize()});if(this.options.margin!=undefined){a.x=a.x-(this.options.margin*2);a.y=a.y-(this.options.margin*2);this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin}this.shim.set({width:a.x,height:a.y}).position({relativeTo:this.element,offset:this.options.offset});return this},hide:function(){if(this.shim){this.shim.setStyle("display","none")}return this},show:function(){if(this.shim){this.shim.setStyle("display","block")}return this.position()},dispose:function(){if(this.shim){this.shim.dispose()}return this},destroy:function(){if(this.shim){this.shim.destroy()}return this}})})();window.addEvent("load",function(){IframeShim.ready=true});var Mask=new Class({Implements:[Options,Events],Binds:["position"],options:{style:{},"class":"mask",maskMargins:false,useIframeShim:true,iframeShimOptions:{}},initialize:function(c,d){this.target=document.id(c)||document.id(document.body);this.target.store("mask",this);this.setOptions(d);this.render();this.inject()},render:function(){this.element=new Element("div",{"class":this.options["class"],id:this.options.id||"mask-"+String.uniqueID(),styles:Object.merge({},this.options.style,{display:"none"}),events:{click:function(b){this.fireEvent("click",b);if(this.options.hideOnClick){this.hide()}}.bind(this)}});this.hidden=true},toElement:function(){return this.element},inject:function(c,d){d=d||(this.options.inject?this.options.inject.where:"")||(this.target==document.body?"inside":"after");c=c||(this.options.inject&&this.options.inject.target)||this.target;this.element.inject(c,d);if(this.options.useIframeShim){this.shim=new IframeShim(this.element,this.options.iframeShimOptions);this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim