ulvis.paste.net

Paste Search Dynamic
Recent pastes
iWebImage.js
  1. //
  2. // iWeb - iWebImage.js
  3. // Copyright 2007-2008 Apple Inc.
  4. // All rights reserved.
  5. //
  6.  
  7. var IWAllImages={};var IWAllImageObjects={};function IWCreateImage(url)
  8. {return IWAllImages[url]||new IWImage(url);}
  9. var IWNamedImages={};function IWImageNamed(name)
  10. {var url=IWNamedImages[name];return url?IWCreateImage(url):null}
  11. function IWRegisterNamedImage(name,url)
  12. {IWNamedImages[name]=url;}
  13. var IWImageEnableUnload=isiPhone;var IWImage=class.create({initialize:function(url)
  14. {if(IWAllImages.hasOwnProperty(url))
  15. {iWLog("warning -- use IWCreateImage rather than new IWImage and you'll get better performance");}
  16. this.mPreventUnloading=0;this.mLoading=false;this.mLoaded=false;this.mURL=url;this.mCallbacks=[];IWAllImages[url]=this;},sourceURL:function()
  17. {return this.mURL;},loaded:function()
  18. {return this.mLoaded;},load:function(callback,delayCallbackIfLoaded)
  19. {if(this.mLoaded&&(callback!=null))
  20. {delayCallbackIfLoaded?setTimeout(callback,0):callback();}
  21. else
  22. {if(callback!=null)
  23. {this.mCallbacks.push(callback);}
  24. if(this.mLoading==false)
  25. {this.mLoading=true;var img=new Image();IWAllImageObjects[this.sourceURL()]=img;img.onload=this.p_onload.bind(this);img.src=this.mURL;}}},unload:function(evenIfNotEnabled)
  26. {if((evenIfNotEnabled||IWImageEnableUnload)&&this.mLoaded)
  27. {if(this.mPreventUnloading<=0)
  28. {this.mLoaded=false;this.mLoading=false;IWAllImageObjects[this.sourceURL()]=null;}
  29. else
  30. {this.mPreventedUnload=true;}}},preventUnloading:function()
  31. {if(this.mPreventUnloading==0)
  32. {this.mPreventedUnload=false;}
  33. ++this.mPreventUnloading;},allowUnloading:function()
  34. {--this.mPreventUnloading;if(this.mPreventUnloading<=0&&this.mPreventedUnload)
  35. {this.unload();}},naturalSize:function()
  36. {(function(){return this.mNaturalSize!==undefined}).bind(this).assert();return this.mNaturalSize;},imgObject:function()
  37. {return IWAllImageObjects[this.sourceURL()];},p_onload:function()
  38. {this.preventUnloading();this.mLoaded=true;if(this.mNaturalSize===undefined)
  39. {var imgObject=this.imgObject();(function(){return imgObject!==undefined}).assert();this.mNaturalSize=new IWSize(imgObject.width,imgObject.height);}
  40. for(var i=0;i<this.mCallbacks.length;++i)
  41. {this.mCallbacks[i]();}
  42. this.mCallbacks=[];this.allowUnloading();},toString:function()
  43. {return"IWImage("+this.mNaturalSize+", "+this.mURL+")";}});function IWCreateLoadingArea()
  44. {if(IWSharedLoadingAreaManager==null)
  45. {IWSharedLoadingAreaManager=new IWLoadingAreaManager();}
  46. return IWSharedLoadingAreaManager.createLoadingArea();}
  47. var IWLoadingAreaManager=class.create({initialize:function()
  48. {var div=$(document.createElement("div"));div.setStyle({visibility:"hidden",position:"absolute",width:0,height:0,overflow:"hidden"});document.body.appendChild(div);this.mCurrentLoadingArea=div;},createLoadingArea:function()
  49. {var loadingArea=document.createElement('div');this.mCurrentLoadingArea.appendChild(loadingArea);return loadingArea;}});var IWSharedLoadingAreaManager=null;var IWSharedEffectRegistry=null;var allStyleSheetsLoaded=false;var timeStyleSheetsAppearedInDOM=null;function IWCreateEffectRegistry()
  50. {if(IWSharedEffectRegistry==null)
  51. {IWSharedEffectRegistry=new IWEffectRegistry();}
  52. return IWSharedEffectRegistry;}
  53. var IWEffectRegistry=class.create({initialize:function()
  54. {this.mEffects=null;},registerEffects:function(effects)
  55. {this.mEffects=effects;},applyEffects:function()
  56. {var effectQueue=[];effectQueue=effectQueue.concat(this.p_queueForEffectType("crop"));effectQueue=effectQueue.concat(this.p_queueForEffectType("stroke"));effectQueue=effectQueue.concat(this.p_queueForEffectType("reflection"));effectQueue=effectQueue.concat(this.p_queueForEffectType("shadow"));this.p_applyEffectsFromQueue(effectQueue);},p_queueForEffectType:function(effectType)
  57. {var effectQueue=[];var i=0;var effectClass=effectType+"_"+i++;while(effect=this.mEffects[effectClass])
  58. {effectQueue=effectQueue.concat(this.p_queueForEffectClass(effect,effectClass));effectClass=effectType+"_"+i++;}
  59. return effectQueue;},p_queueForEffectClass:function(effect,effectClass,elementList)
  60. {var effectQueue=[];var elements=elementList||$$("."+effectClass);while(elements&&elements.length>0)
  61. {var element=elements.shift();var children=element.select("."+effectClass);if(children.length>0)
  62. {elements=elements.minusArray(children);effectQueue=effectQueue.concat(this.p_queueForEffectClass(effect,effectClass,children));}
  63. effectQueue.push({element:element,effect:effect});}
  64. return effectQueue;},p_allStyleSheetsLoaded:function()
  65. {if(isCamino||isFirefox)
  66. {if(timeStyleSheetsAppearedInDOM!=null)
  67. {duration=(new Date().getTime())-timeStyleSheetsAppearedInDOM;if(duration>100)
  68. {allStyleSheetsLoaded=true;timeStyleSheetsAppearedInDOM=null;}}
  69. else if(!allStyleSheetsLoaded)
  70. {for(var i=0,sheetCount=document.styleSheets.length;i<sheetCount;i++)
  71. {var styleSheet=document.styleSheets[i];if(styleSheet.href&&styleSheet.href.indexOf("Moz.css")!=-1)
  72. {timeStyleSheetsAppearedInDOM=new Date().getTime();}}}}
  73. else
  74. {allStyleSheetsLoaded=true;}
  75. return allStyleSheetsLoaded;},p_applyEffectsFromQueue:function(queue)
  76. {var startTime=new Date().getTime();var duration=0;var readyToApplyEffects=this.p_allStyleSheetsLoaded();while(queue.length>0&&duration<100&&readyToApplyEffects)
  77. {var queueEntry=queue.shift();if(queueEntry&&queueEntry.effect&&queueEntry.element)
  78. {queueEntry.effect.applyToElement(queueEntry.element);}
  79. duration=(new Date().getTime())-startTime;}
  80. if(queue.length>0)
  81. {setTimeout(this.p_applyEffectsFromQueue.bind(this,queue),0);}
  82. else
  83. {performPostEffectsFixups();}}});function IWChildOffset(child,parent,positionedOnly)
  84. {var l=0;var t=0;if(parent)
  85. {var current=child;while(current&&current!=parent)
  86. {if(!positionedOnly||(current.style.position=="absolute")||(current.style.position=="relative"))
  87. {l+=current.offsetLeft;t+=current.offsetTop;}
  88. current=current.parentNode;}}
  89. return new IWPoint(l,t);}
  90. function IWImageExtents(ancestor,images,left,top,right,bottom)
  91. {var unionedBounds=new IWRect(left,top,right-left,bottom-top);for(var e=0;e<images.length;++e)
  92. {var imageClippedBounds=new IWRect(images[e].offsetLeft,images[e].offsetTop,images[e].offsetWidth,images[e].offsetHeight);if(ancestor)
  93. {var current=images[e].parentNode;while(current&&current!=ancestor)
  94. {if((current.style.position=="absolute")||(current.style.position=="relative"))
  95. {imageClippedBounds.origin.x+=current.offsetLeft||0;imageClippedBounds.origin.y+=current.offsetTop||0;}
  96. var testForHidden=function(str)
  97. {return str=='hidden';};var clipX=[current.style.overflow,current.style.overflowX].any(testForHidden);var clipY=[current.style.overflow,current.style.overflowY].any(testForHidden);if(clipX||clipY)
  98. {var currentRect=new IWRect(clipX?current.offsetLeft:imageClippedBounds.origin.x,clipY?current.offsetTop:imageClippedBounds.origin.y,clipX?current.offsetWidth:imageClippedBounds.size.width,clipY?current.offsetHeight:imageClippedBounds.size.height);imageClippedBounds=imageClippedBounds.intersection(currentRect);}
  99. current=current.parentNode;}}
  100. if((imageClippedBounds.size.width>0)&&(imageClippedBounds.size.height>0))
  101. {if((unionedBounds.size.width>0)&&(unionedBounds.size.height>0))
  102. {unionedBounds=unionedBounds.union(imageClippedBounds);}
  103. else
  104. {unionedBounds=imageClippedBounds.clone();}}}
  105. var extents={left:unionedBounds.origin.x,top:unionedBounds.origin.y,right:unionedBounds.origin.x+unionedBounds.size.width,bottom:unionedBounds.origin.y+unionedBounds.size.height};return extents;}
  106. function IWEffectChildren(element,imagesOnly)
  107. {element=$(element);var inlineBlocks=element.select('.inline-block');return element.descendants().findAll(function(child){if((!imagesOnly&&child.match("div.badge-fill"))||child.match("img"))
  108. {var inline=false;for(var index=0,end=inlineBlocks.length;inline==false&&index<end;++index)
  109. {inline=child.descendantOf(inlineBlocks[index]);}
  110. return inline==false;}
  111. else
  112. {return false;}});}
  113. function IWClippingNode(node)
  114. {if(node)
  115. {if(node.style&&(node.style.overflow||node.style.overflowX||node.style.overflowY))
  116. {if([node.style.overflow,node.style.overflowX,node.style.overflowY].include('hidden'))
  117. return node;}
  118. else
  119. {return IWClippingNode(node.parentNode);}}
  120. return null;}
  121. var IWShadow=class.create({initialize:function(params)
  122. {this.mBlurRadius=params.blurRadius;this.mOffset=params.offset;this.mColor=params.color;this.mOpacity=params.opacity;},applyToElement:function(shadowed)
  123. {var framePos=new IWPoint(shadowed.offsetLeft,shadowed.offsetTop);var frameSize=new IWSize(shadowed.offsetWidth,shadowed.offsetHeight);var opacity=1.0;if(shadowed!=null)
  124. {shadowed=$(shadowed);opacity=shadowed.getStyle('opacity');if(windowsInternetExplorer)
  125. {var newRoot=$(shadowed.cloneNode(false));shadowed.parentNode.insertBefore(newRoot,shadowed);var shadow=$(document.createElement('DIV'));var shadowContents=shadowed.cloneNodeExcludingIDs(true);shadow.appendChild(shadowContents);shadow.select('map').each(function(mapElement){mapElement.parentNode.removeChild(mapElement);});shadow.select(".IWReflection").invoke("remove");newRoot.appendChild(shadow);newRoot.appendChild(shadowed);shadowed.setStyle({top:0,left:0});var blurRadius=this.mBlurRadius*0.5;var xOffset=this.mOffset.x-(this.mBlurRadius*0.6);var yOffset=this.mOffset.y-(this.mBlurRadius*0.6);shadow.setStyle({position:"absolute",left:px(xOffset-500),top:px(yOffset-500),width:px(frameSize.width+1000),height:px(frameSize.height+1000)});shadowContents.setStyle({position:"absolute",left:px(500),top:px(500),padding:0,margin:0});shadow.style.filter="progid:DXImageTransform.Microsoft.MaskFilter()"+" progid:DXImageTransform.Microsoft.MaskFilter(color="+this.mColor+")"+" progid:DXImageTransform.Microsoft.Alpha(opacity="+this.mOpacity*opacity*100+")"+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+blurRadius+")";if(newRoot.hasClassName("inline-block"))
  126. {var rootTop=newRoot.style.top;var rootMarginTop=newRoot.style.marginTop;if(rootTop&&!rootMarginTop)
  127. {rootTop=(toPixelsAtElement(newRoot,rootTop,true));newRoot.style.marginTop=px(-rootTop);}
  128. else if(!rootTop&&rootMarginTop)
  129. {rootMarginTop=(toPixelsAtElement(newRoot,rootMarginTop,true));newRoot.style.rootTop=px(-rootMarginTop);}
  130. else if(rootTop&&rootMarginTop)
  131. {rootTop=(toPixelsAtElement(newRoot,rootTop,true));rootMarginTop=(toPixelsAtElement(newRoot,rootMarginTop,true));if(rootTop!=rootMarginTop)
  132. {newRoot.style.rootTop=px(-rootMarginTop);}}}
  133. if(shadowed.offsetTop!=0)
  134. {var top=shadowed.style.top;top=top?(toPixelsAtElement(shadowed,top,true)):0;top-=shadowed.offsetTop;shadowed.style.top=px(top);}}
  135. else
  136. {var sourceElements=IWEffectChildren(shadowed,false);var extents=IWImageExtents(shadowed,sourceElements,0,0,frameSize.width,frameSize.height);var canvas=undefined;if(shadowed.sandwich&&shadowed.sandwich.canvas)
  137. {canvas=shadowed.sandwich.canvas;}
  138. extents.left-=Math.max(this.mBlurRadius-this.mOffset.x,0);extents.top-=Math.max(this.mBlurRadius-this.mOffset.y,0);extents.right+=Math.max(this.mBlurRadius+this.mOffset.x,0);extents.bottom+=Math.max(this.mBlurRadius+this.mOffset.y,0);extents.left=Math.floor(extents.left);extents.top=Math.floor(extents.top);extents.right=Math.ceil(extents.right);extents.bottom=Math.ceil(extents.bottom);var leftOffset=extents.left;var topOffset=extents.top;extents.right-=extents.left;extents.bottom-=extents.top;extents.left=0;extents.top=0;var width=extents.right-extents.left;var height=extents.bottom-extents.top;if(canvas===undefined)
  139. {canvas=$(document.createElement("canvas"));}
  140. var context=canvas.getContext?canvas.getContext("2d"):null;var canvasCanDrawShadow=context?context.shadowColor:false;if(canvasCanDrawShadow)
  141. {$(canvas).setAttribute("width",width);$(canvas).setAttribute("height",height);$(canvas).setStyle({position:"absolute",top:px(topOffset),left:px(leftOffset)});var workingCanvas=undefined;if(shadowed.sandwich&&shadowed.sandwich.workingCanvas)
  142. {workingCanvas=shadowed.sandwich.workingCanvas;}
  143. if(workingCanvas===undefined)
  144. {workingCanvas=canvas.cloneNode(false);}
  145. var self=this;var sandwich=shadowed.sandwich||{};sandwich.loadedElements=[];sandwich.elementCount=sourceElements.length;sandwich.loadedElementCount=0;sandwich.canvas=canvas;sandwich.workingCanvas=workingCanvas;shadowed.sandwich=sandwich;sandwich.onImageLoad=function(j,img,image)
  146. {var offset=IWChildOffset(img,shadowed,true);this.loadedElements[j]={imgObject:image.imgObject(),left:offset.x-leftOffset,top:offset.y-topOffset,width:img.offsetWidth,height:img.offsetHeight,render:function(context){context.drawImage(this.imgObject,this.left,this.top,this.width,this.height);}};this.loadedElementCount++;if(this.loadedElementCount==this.elementCount)
  147. {this.renderShadow()}}
  148. sandwich.registerDiv=function(j,div)
  149. {var offset=IWChildOffset(div,shadowed,true);this.loadedElements[j]={divElement:div,left:offset.x-leftOffset,top:offset.y-topOffset,width:div.offsetWidth,height:div.offsetHeight,render:function(context){var div=this.divElement;var color=div.getStyle('background-color');var opacity=parseFloat(div.style.opacity||1);context.save();context.globalAlpha*=opacity;context.fillStyle=color;context.fillRect(this.left,this.top,this.width,this.height);context.restore();}};this.loadedElementCount++;if(this.loadedElementCount==this.elementCount)
  150. {this.renderShadow()}}
  151. sandwich.renderShadow=function()
  152. {if(canvas.parentNode===null)
  153. {shadowed.insertBefore(canvas,shadowed.firstChild);}
  154. canvas.parentNode.insertBefore(workingCanvas,canvas);var context=workingCanvas.getContext("2d");new IWRect(0,0,width,height).clear(context);var bgImage=shadowed.getStyle('background-image');var hasBGImage=bgImage&&bgImage.indexOf('url(')==0;var bgColor=shadowed.getStyle('background-color');var alphaComponent=self.p_alphaComponent(bgColor);IWAssert(function(){return alphaComponent==0||alphaComponent==1},"alpha must be 0 or 1 for background color if shadow is applied");var fillBackground=(hasBGImage||alphaComponent>0);var divBounds=new IWRect(-leftOffset,-topOffset,frameSize.width,frameSize.height).round();if(fillBackground)
  155. {context.fillStyle='rgba(0,0,0,1)';divBounds.fill(context);}
  156. for(var k=0;k<this.loadedElements.length;++k)
  157. {var loaded=this.loadedElements[k];var clipper=$(IWClippingNode(sourceElements[k]));if(clipper&&clipper.descendantOf(shadowed))
  158. {var clipToShadow=IWChildOffset(clipper,shadowed,true);context.save();context.rect(clipToShadow.x-leftOffset,clipToShadow.y-topOffset,clipper.offsetWidth,clipper.offsetHeight);context.clip();loaded.render(context);context.restore();}
  159. else
  160. {loaded.render(context);}}
  161. context=canvas.getContext("2d");new IWRect(0,0,width,height).clear(context);var drawImageUnshadowed=true;context.globalAlpha=opacity;if(context.shadowColor)
  162. {var usingShadowAlpha=true;context.save();usingShadowAlpha=!(isWebKit&&isEarlyWebKitVersion);if(usingShadowAlpha)
  163. {var components=self.mColor.toLowerCase().match(/#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/);if(components&&components.length>=4)
  164. {context.shadowColor="rgba("+parseInt(components[1],16)+", "+parseInt(components[2],16)+", "+parseInt(components[3],16)+", "+self.mOpacity+")";}
  165. else
  166. {components=self.mColor.match(/rgb\(([0-9\.]+),[ ]*([0-9\.]+),[ ]*([0-9\.]+)\)/);if(components&&components.length>=4)
  167. {context.shadowColor="rgba("+components[1]+", "+components[2]+", "+components[3]+", "+self.mOpacity+")";}
  168. else
  169. {iWLog("not using shadow alpha, failed to match "+self.mColor);usingShadowAlpha=false;}}}
  170. if(usingShadowAlpha==false)
  171. {context.globalAlpha*=self.mOpacity;context.shadowColor=self.mColor;}
  172. context.shadowBlur=self.mBlurRadius;context.shadowOffsetX=self.mOffset.x;context.shadowOffsetY=self.mOffset.y;context.drawImage(workingCanvas,0,0);context.restore();if(usingShadowAlpha==false)
  173. {drawImageUnshadowed=self.mOpacity<1.0;}
  174. else
  175. {drawImageUnshadowed=false;}}
  176. if(drawImageUnshadowed)
  177. {context.drawImage(workingCanvas,0,0);}
  178. if(fillBackground)
  179. {divBounds.clear(context);context.save();context.globalAlpha=opacity;context.rect(divBounds.origin.x,divBounds.origin.y,divBounds.size.width,divBounds.size.height);context.clip();for(var k=0;k<this.loadedElements.length;++k)
  180. {this.loadedElements[k].render(context);}
  181. context.restore();}
  182. if(workingCanvas.parentNode)
  183. {workingCanvas.parentNode.removeChild(workingCanvas);delete this.workingCanvas;this.workingCanvas=null;}
  184. for(var j=0;j<sourceElements.length;++j)
  185. {sourceElements[j].style.opacity=0.0;}};if(sourceElements.length>0)
  186. {for(var j=0;j<sourceElements.length;++j)
  187. {var element=$(sourceElements[j]);if(element.match('img'))
  188. {var image=IWCreateImage(element.src);image.load(sandwich.onImageLoad.bind(sandwich,j,element,image));}
  189. else if(element.match('div'))
  190. {sandwich.registerDiv(j,element);}}}
  191. else
  192. {sandwich.renderShadow();}
  193. workingCanvas.style.visibility="hidden";}}}},p_alphaComponent:function(color)
  194. {var alpha=1.0;if(color&&color.indexOf('rgba(')!=-1)
  195. {if(color.match(/rgba\((?:\s*\S+\s*,\s*){3}(\S+)\s*\)/))
  196. {alpha=RegExp.$1;}}
  197. return alpha;}});var IWReflection=class.create({initialize:function(parameters)
  198. {this.mOpacity=parameters.opacity;this.mOffset=Math.max(parameters.offset,1);this.mFadeSustain=0.4;this.mMaxSustain=120;},applyToElement:function(div)
  199. {var bounds=new IWRect(div.offsetLeft,div.offsetTop,div.offsetWidth,div.offsetHeight);var reflectionHeight=Math.min(div.offsetHeight*this.mFadeSustain,this.mMaxSustain)*0.75;if(div!=null)
  200. {var imgs=IWEffectChildren(div,true);var extents=IWImageExtents(div,imgs,0,0,bounds.size.width,bounds.size.height);var totalWidth=extents.right-extents.left;var totalHeight=extents.bottom-extents.top;var leftOffset=extents.left;var topOffset=extents.top;var bottomOffset=totalHeight-bounds.size.height;if(windowsInternetExplorer)
  201. {var reflection=$(document.createElement("div"));reflection.setStyle({position:"absolute",left:px(extents.left),top:px(bounds.size.height),marginTop:px(this.mOffset),width:px(totalWidth),height:px(reflectionHeight),overflow:"hidden",filter:'progid:DXImageTransform.Microsoft.Alpha(opacity='+(this.mOpacity*100)+', style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy=100)'});reflection.addClassName("IWReflection");var flipped=$(document.createElement("div"));flipped.setStyle({position:"relative",width:px(totalWidth),height:px(totalHeight),filter:'flipv'});var cloned=$(div.cloneNode(true));cloned.setStyle({left:px(-extents.left),top:px(-extents.top),position:"absolute"});cloned.className=cloned.className.replace(/(shadow_\d+)/g,'');reflection.appendChild(flipped);flipped.appendChild(cloned);div.insertBefore(reflection,div.firstChild);}
  202. else
  203. {var reflection=$(document.createElement("canvas"));extents.right-=extents.left;extents.bottom-=extents.top;extents.left=0;extents.top=0;reflection.setAttribute("width",extents.right-extents.left);reflection.setAttribute("height",reflectionHeight+this.mOffset/2);reflection.setStyle({position:"absolute",top:px(bounds.size.height),marginTop:px(this.mOffset),left:px(leftOffset)});div.insertBefore(reflection,div.firstChild);var context=reflection.getContext("2d");context.clearRect(0,0,reflection.width,reflection.height);var sandwich={};sandwich.loadedImgs=[];sandwich.imgCount=imgs.length;var self=this;sandwich.onImageLoad=function(j,img,image){var offset=IWChildOffset(img,div,true);this.loadedImgs[j]={imgObject:image.imgObject(),left:offset.x-leftOffset,top:offset.y-topOffset-bottomOffset,width:img.offsetWidth,height:img.offsetHeight};var allImagesLoaded=false;if(this.loadedImgs.length>=this.imgCount)
  204. {allImagesLoaded=true;for(var k=0;allImagesLoaded&&k<this.loadedImgs.length;++k)
  205. {if(this.loadedImgs[k]===undefined)
  206. {allImagesLoaded=false;}}}
  207. if(allImagesLoaded)
  208. {context.save();context.translate(0,bounds.size.height-1);context.scale(1,-1);for(var k=0;k<this.loadedImgs.length;++k)
  209. {var loadedImg=this.loadedImgs[k];var clipper=$(IWClippingNode(imgs[k]));if(clipper&&clipper.descendantOf(div))
  210. {var clipOffset=IWChildOffset(clipper,div,true);context.save();context.rect(clipOffset.x-leftOffset,clipOffset.y-topOffset-bottomOffset,clipper.offsetWidth,clipper.offsetHeight);context.clip();context.drawImage(loadedImg.imgObject,loadedImg.left,loadedImg.top,loadedImg.width,loadedImg.height);context.restore();}
  211. else
  212. {context.drawImage(loadedImg.imgObject,loadedImg.left,loadedImg.top,loadedImg.width,loadedImg.height);}}
  213. context.restore();context.save();context.globalCompositeOperation="destination-out";var gradient=context.createLinearGradient(0,0,0,reflection.height);gradient.addColorStop(1,"rgba(255, 255, 255, 1.0)");gradient.addColorStop(0,"rgba(255, 255, 255, "+(1-self.mOpacity)+")");context.fillStyle=gradient;if(navigator.appVersion.indexOf('WebKit')!=-1)
  214. {context.rect(0,0,reflection.width,reflection.height*2);context.fill();}
  215. else
  216. {context.fillRect(0,0,reflection.width,reflection.height*2);}
  217. context.restore();}};for(var j=0;j<imgs.length;++j)
  218. {var img=imgs[j];var image=IWCreateImage(img.src);image.load(sandwich.onImageLoad.bind(sandwich,j,img,image));}}}}});var kLeft=0,kTopLeft=1,kTop=2,kTopRight=3,kRight=4,kBottomRight=5,kBottom=6,kBottomLeft=7,kPartCount=8;var IWStrokeParts=class.create({initialize:function(strokeParts,maxImageSize,shouldClip,strokeWidth)
  219. {this.mStrokeParts=strokeParts;this.mMaxImageSize=maxImageSize;this.mShouldClip=shouldClip;if(shouldClip)
  220. {this.mStrokeWidth=strokeWidth;}},p_imageLayout:function(imageSize)
  221. {var strokeParts=this.mStrokeParts;var hDelta=this.mMaxImageSize.width-imageSize.width;var vDelta=this.mMaxImageSize.height-imageSize.height;var topLeft=strokeParts[kTopLeft].rect;var topRight=strokeParts[kTopRight].rect.offset(-hDelta,0);var bottomRight=strokeParts[kBottomRight].rect.offset(-hDelta,-vDelta);var bottomLeft=strokeParts[kBottomLeft].rect.offset(0,-vDelta);var top=strokeParts[kTop].rect;top.size.width=topRight.origin.x-top.origin.x;var right=strokeParts[kRight].rect.offset(-hDelta,0);right.size.height=bottomRight.origin.y-right.origin.y;var bottom=strokeParts[kBottom].rect.offset(0,-vDelta);bottom.size.width=bottomRight.origin.x-bottom.origin.x;var left=strokeParts[kLeft].rect;left.size.height=bottomLeft.origin.y-left.origin.y;return[left,topLeft,top,topRight,right,bottomRight,bottom,bottomLeft];},p_imageMarkup:function(imageSize,zIndex)
  222. {var markup='';var layoutRects=this.p_imageLayout(imageSize);for(var index=kLeft;index<kPartCount;++index)
  223. {var style=layoutRects[index].position();if(zIndex)
  224. {style+='z-index: '+zIndex+';';}
  225. markup+=imgMarkup(this.mStrokeParts[index].url,style);}
  226. return markup;},markupForImageStreamEntry:function(imageStreamEntry,imageSize)
  227. {var rect=new IWRect(0,0,imageSize.width,imageSize.height);var clippingDivPre='';var clippingDivPost='';var thumbRect=rect.clone();if(this.mShouldClip)
  228. {var left=(this.mStrokeWidth/2+1);var top=(this.mStrokeWidth/2+1);var clippingRect=new IWRect(left,top,(imageSize.width-this.mStrokeWidth-2),(imageSize.height-this.mStrokeWidth-2));clippingDivPre='<div style="overflow: hidden; '+clippingRect.position()+'">';clippingDivPost='</div>';thumbRect.origin.x-=left;thumbRect.origin.y-=top;}
  229. var markup='<div class="framedImage" style="'+rect.position()+'">';markup+=clippingDivPre;markup+=imageStreamEntry.thumbnailMarkupForRect(thumbRect);markup+=clippingDivPost;markup+=this.p_imageMarkup(imageSize,2);markup+='</div>';return markup;},applyToElement:function(div)
  230. {div=$(div);if(div!=null)
  231. {if(div.parentNode)
  232. {$(div.parentNode).ensureHasLayoutForIE();}
  233. var size=new IWSize(div.offsetWidth,div.offsetHeight);div.insert(this.p_imageMarkup(size,(div.hasClassName("aboveStrokesAndFrames")?-1:"auto")));if(!div.hasClassName("flowDefining"))
  234. {if(div.style.position!='absolute')
  235. {var divRect=new IWRect(0,0,div.offsetWidth,div.offsetHeight);var unionRect=IWZeroRect();var layoutRects=this.p_imageLayout(size);layoutRects.each(function(r)
  236. {unionRect=unionRect.union(r);});var padding=divRect.paddingToRect(unionRect);var marginLeft=Element.getStyle(div,"marginLeft");marginLeft=marginLeft?(toPixelsAtElement(div,marginLeft,false)):0;var marginTop=Element.getStyle(div,"marginTop");marginTop=marginTop?(toPixelsAtElement(div,marginTop,true)):0;var marginRight=Element.getStyle(div,"marginRight");marginRight=marginRight?(toPixelsAtElement(div,marginRight,false)):0;var marginBottom=Element.getStyle(div,"marginBottom");marginBottom=marginBottom?(toPixelsAtElement(div,marginBottom,true)):0;if(windowsInternetExplorer)
  237. {div.setStyle({marginLeft:px(Math.max(0,padding.left-1)+marginLeft),marginTop:px(Math.max(0,padding.top-1)+marginTop),marginRight:px(Math.max(0,padding.right-1)+marginRight),marginBottom:px(Math.max(0,padding.bottom-1)+marginBottom)});if(effectiveBrowserVersion==7)
  238. {updateListOfIE7FloatsFix(div);}}
  239. else
  240. {div.setStyle({marginLeft:px(padding.left+marginLeft),marginTop:px(padding.top+marginTop),marginRight:px(padding.right+marginRight),marginBottom:px(padding.bottom+marginBottom)});}}}}},strokeExtra:function(imageSize)
  241. {if(!imageSize)
  242. {imageSize=this.mMaxImageSize;}
  243. rect=new IWRect(IWZeroPoint(),imageSize);var layout=this.p_imageLayout(rect.size);var unionRect=IWZeroRect();layout.each(function(r)
  244. {unionRect=unionRect.union(r);});return rect.paddingToRect(unionRect);}});var IWStroke=class.create({initialize:function(strokeURL,strokeRect,maxImageSize)
  245. {this.mStrokeURL=strokeURL;this.mStrokeRect=strokeRect;this.mMaxImageSize=maxImageSize;},p_strokeRect:function(imageSize)
  246. {var hScale=imageSize.width/this.mMaxImageSize.width;var vScale=imageSize.height/this.mMaxImageSize.height;var strokeRect=this.mStrokeRect.scale(hScale,vScale,true);return strokeRect;},p_imageMarkup:function(imageSize,zIndex)
  247. {var style=this.p_strokeRect(imageSize).position();if(zIndex)
  248. {style+='z-index: '+zIndex+';';}
  249. return imgMarkup(this.mStrokeURL,style);},markupForImageStreamEntry:function(imageStreamEntry,imageSize)
  250. {var rect=new IWRect(0,0,imageSize.width,imageSize.height);var markup='<div class="framedImage" style="'+rect.position()+'">';markup+=imageStreamEntry.thumbnailMarkupForRect(rect);markup+=this.p_imageMarkup(imageSize,2);markup+='</div>';return markup;},applyToElement:function(div)
  251. {div=$(div);if(div!=null)
  252. {if(div.parentNode)
  253. {$(div.parentNode).ensureHasLayoutForIE();}
  254. var size=new IWSize(div.offsetWidth,div.offsetHeight);div.insert(this.p_imageMarkup(size,(div.hasClassName("aboveStrokesAndFrames")?-1:"auto")));if(!div.hasClassName("flowDefining"))
  255. {if(div.style.position!='absolute')
  256. {var divRect=new IWRect(0,0,div.offsetWidth,div.offsetHeight);var padding=divRect.paddingToRect(this.mStrokeRect);var marginLeft=Element.getStyle(div,"marginLeft");marginLeft=marginLeft?(toPixelsAtElement(div,marginLeft,false)):0;var marginTop=Element.getStyle(div,"marginTop");marginTop=marginTop?(toPixelsAtElement(div,marginTop,true)):0;var marginRight=Element.getStyle(div,"marginRight");marginRight=marginRight?(toPixelsAtElement(div,marginRight,false)):0;var marginBottom=Element.getStyle(div,"marginBottom");marginBottom=marginBottom?(toPixelsAtElement(div,marginBottom,true)):0;div.setStyle({marginLeft:px(padding.left+marginLeft),marginTop:px(padding.top+marginTop),marginRight:px(padding.right+marginRight),marginBottom:px(padding.bottom+marginBottom)});if(windowsInternetExplorer&&effectiveBrowserVersion==7)
  257. {updateListOfIE7FloatsFix(div);}}}}},strokeExtra:function(imageSize)
  258. {if(imageSize===undefined)
  259. {imageSize=this.mMaxImageSize;}
  260. var imageRect=new IWRect(IWZeroPoint(),imageSize);return imageRect.paddingToRect(this.p_strokeRect(imageSize));}});var IWEmptyStroke=class.create({initialize:function()
  261. {},markupForImageStreamEntry:function(imageStreamEntry,imageSize)
  262. {var rect=new IWRect(0,0,imageSize.width,imageSize.height);var markup='<div class="framedImage" style="'+rect.position()+'">';markup+=imageStreamEntry.thumbnailMarkupForRect(rect);markup+='</div>';return markup;},applyToElement:function(div)
  263. {},strokeExtra:function()
  264. {return new IWPadding(0,0,0,0);}});var kSFRFrameTopLeft=0;var kSFRFrameTop=1;var kSFRFrameTopRight=2;var kSFRFrameRight=3;var kSFRFrameBottomRight=4;var kSFRFrameBottom=5;var kSFRFrameBottomLeft=6;var kSFRFrameLeft=7;var kSFRFrameClip=0;var kSFRFrameStretchEvenly=1;var kSFRFrameStretchToFit=2;var IWPhotoFrame=class.create({initialize:function(images,maskImages,tilingMode,assetScale,leftInset,topInset,rightInset,bottomInset,unscaledLeftWidth,unscaledTopHeight,unscaledRightWidth,unscaledBottomHeight,leftTileHeight,topTileWidth,rightTileHeight,bottomTileWidth,adornmentURL,adornmentPosition,adornmentSize,minimumAssetScale)
  265. {this.mImages=images;this.mMaskImages=maskImages;this.mTilingMode=tilingMode;this.mLeftInset=leftInset;this.mTopInset=topInset;this.mRightInset=rightInset;this.mBottomInset=bottomInset;this.mUnscaledLeftWidth=unscaledLeftWidth;this.mUnscaledTopHeight=unscaledTopHeight;this.mUnscaledRightWidth=unscaledRightWidth;this.mUnscaledBottomHeight=unscaledBottomHeight;this.mLeftTileHeight=leftTileHeight;this.mTopTileWidth=topTileWidth;this.mRightTileHeight=rightTileHeight;this.mBottomTileWidth=bottomTileWidth;this.mAdornmentURL=adornmentURL;this.mAdornmentPosition=adornmentPosition;this.mAdornmentSize=adornmentSize;this.mMinimumAssetScale=minimumAssetScale;this.setAssetScale(assetScale);},setAssetScale:function(assetScale)
  266. {assetScale=Math.min(assetScale,1.0);assetScale=Math.max(this.mMinimumAssetScale,assetScale);this.mAssetScale=assetScale;this.mLeftWidth=this.scaledValue(this.mUnscaledLeftWidth);this.mTopHeight=this.scaledValue(this.mUnscaledTopHeight);this.mRightWidth=this.scaledValue(this.mUnscaledRightWidth);this.mBottomHeight=this.scaledValue(this.mUnscaledBottomHeight);},scaledValue:function(valueToScale)
  267. {return Math.ceil(valueToScale*this.mAssetScale);},markupForImageStreamEntry:function(imageStreamEntry,size)
  268. {var oldAssetScale=this.mAssetScale;var maximumScale=this.maximumAssetScaleForImageSize(size);if((maximumScale<oldAssetScale)&&(maximumScale>=this.mMinimumAssetScale))
  269. {this.setAssetScale(maximumScale);}
  270. var coverageRect=this.coverageRect(new IWRect(0,0,size.width,size.height));var imageRect=new IWRect(-coverageRect.origin.x,-coverageRect.origin.y,size.width,size.height);coverageRect=coverageRect.offsetToOrigin();var markup='<div class="framedImage" style="'+coverageRect.position()+'">';markup+=imageStreamEntry.thumbnailMarkupForRect(imageRect);if(maximumScale>=this.mMinimumAssetScale)
  271. {if(this.mImages!=null)
  272. {markup+=this.p_buildFrame(this.mImages,coverageRect.size,2);}
  273. if(this.mAdornmentURL!=null)
  274. {markup+=this.p_adornmentMarkupForRect(imageRect,2);}
  275. if(this.mMaskImages)
  276. {}}
  277. markup+='</div>';if(oldAssetScale!=this.mAssetScale)this.setAssetScale(oldAssetScale);return markup;},strokeExtra:function()
  278. {var adornmentExtraTopMargin=0;if(this.mAdornmentURL)
  279. {adornmentExtraTopMargin=Math.max(0,(this.scaledValue(this.mAdornmentSize.height)-this.mTopHeight)/2.0-this.mAdornmentPosition.y);}
  280. return new IWPadding(this.mLeftWidth-this.scaledValue(this.mLeftInset),this.mTopHeight-this.scaledValue(this.mTopInset)+adornmentExtraTopMargin,this.mRightWidth-this.scaledValue(this.mRightInset),this.mBottomHeight-this.scaledValue(this.mBottomInset));},applyToElement:function(div)
  281. {div=$(div);if(div!=null)
  282. {if(div.parentNode)
  283. {$(div.parentNode).ensureHasLayoutForIE();}
  284. var markup='';var divRect=new IWRect(0,0,div.offsetWidth,div.offsetHeight);if((divRect.size.width>=(this.scaledValue(this.mLeftInset)+this.scaledValue(this.mRightInset)))&&(divRect.size.height>=(this.scaledValue(this.mTopInset)+this.scaledValue(this.mTopInset))))
  285. {if(this.mImages!=null)
  286. {var coverageRect=this.coverageRect(divRect);var containerRect=new IWRect(coverageRect.origin.x,coverageRect.origin.y,0,0);markup+='<div style="'+containerRect.position()+'">';markup+=this.p_buildFrame(this.mImages,coverageRect.size,(div.hasClassName("aboveStrokesAndFrames")?-1:"auto"));markup+='</div>';}
  287. if(this.mAdornmentURL!=null)
  288. {markup+=this.p_adornmentMarkupForRect(divRect);}}
  289. div.insert(markup);if(!div.hasClassName("flowDefining"))
  290. {if(div.style.position!='absolute')
  291. {var frameExtra=this.strokeExtra();var marginLeft=Element.getStyle(div,"marginLeft");marginLeft=marginLeft?(toPixelsAtElement(div,marginLeft,false)):0;var marginTop=Element.getStyle(div,"marginTop");marginTop=marginTop?(toPixelsAtElement(div,marginTop,true)):0;var marginRight=Element.getStyle(div,"marginRight");marginRight=marginRight?(toPixelsAtElement(div,marginRight,false)):0;var marginBottom=Element.getStyle(div,"marginBottom");marginBottom=marginBottom?(toPixelsAtElement(div,marginBottom,true)):0;div.setStyle({marginLeft:px(frameExtra.left+marginLeft),marginTop:px(frameExtra.top+marginTop),marginRight:px(frameExtra.right+marginRight),marginBottom:px(frameExtra.bottom+marginBottom)});if(windowsInternetExplorer&&effectiveBrowserVersion==7)
  292. {updateListOfIE7FloatsFix(div);}}}}},maximumAssetScaleForImageSize:function(in_imgSize)
  293. {var maxScale=1;if((in_imgSize.width>this.mLeftInset+this.mRightInset)&&(in_imgSize.height>this.mTopInset+this.mBottomInset))
  294. {maxScale=1;}
  295. else if((in_imgSize.width<Math.ceil(this.mLeftInset*this.mMinimumAssetScale)+Math.ceil(this.mRightInset*this.mMinimumAssetScale))||(in_imgSize.height<Math.ceil(this.mTopInset*this.mMinimumAssetScale)+Math.ceil(this.mBottomInset*this.mMinimumAssetScale)))
  296. {maxScale=0;}
  297. else
  298. {var maxWidthScale=1;var floatEpsilon=0.0000001;if(((this.mLeftInset+this.mRightInset)>=in_imgSize.width)&&((this.mLeftInset+this.mRightInset)>0))
  299. {var leftChunkRatio=Math.floor(this.mLeftInset/(this.mLeftInset+this.mRightInset)*in_imgSize.width)/this.mLeftInset;var rightChunkRatio=Math.floor(this.mRightInset/(this.mLeftInset+this.mRightInset)*in_imgSize.width)/this.mRightInset;leftChunkRatio-=floatEpsilon;rightChunkRatio-=floatEpsilon;maxWidthScale=Math.max(leftChunkRatio,rightChunkRatio);if(in_imgSize.width<(Math.ceil(this.mLeftInset*maxWidthScale)+Math.ceil(this.mRightInset*maxWidthScale)))
  300. {maxWidthScale=Math.min(leftChunkRatio,rightChunkRatio);}
  301. if((maxWidthScale<this.mMinimumAssetScale)||in_imgSize.width<(Math.ceil(this.mLeftInset*maxWidthScale)+Math.ceil(this.mRightInset*maxWidthScale)))
  302. {maxWidthScale=this.mMinimumAssetScale;}}
  303. var maxHeightScale=1;if(((this.mTopInset+this.mBottomInset)>=in_imgSize.height)&&((this.mTopInset+this.mBottomInset)>0))
  304. {var topChunkRatio=Math.floor(this.mTopInset/(this.mTopInset+this.mBottomInset)*in_imgSize.height)/this.mTopInset;var bottomChunkRatio=Math.floor(this.mBottomInset/(this.mTopInset+this.mBottomInset)*in_imgSize.height)/this.mBottomInset;topChunkRatio-=floatEpsilon;bottomChunkRatio-=floatEpsilon;maxHeightScale=Math.max(topChunkRatio,bottomChunkRatio);if(in_imgSize.height<(Math.ceil(this.mTopInset*maxHeightScale)+Math.ceil(this.mBottomInset*maxHeightScale)))
  305. {maxHeightScale=Math.min(topChunkRatio,bottomChunkRatio);}
  306. if((maxHeightScale<this.mMinimumAssetScale)||in_imgSize.height<(Math.ceil(this.mTopInset*maxHeightScale)+Math.ceil(this.mBottomInset*maxHeightScale)))
  307. {maxHeightScale=this.mMinimumAssetScale;}}
  308. maxScale=Math.min(maxWidthScale,maxHeightScale);}
  309. return maxScale;},coverageRect:function(rect)
  310. {var left=rect.origin.x+this.scaledValue(this.mLeftInset);var top=rect.origin.y+this.scaledValue(this.mTopInset);var right=rect.maxX()-this.scaledValue(this.mRightInset);var bottom=rect.maxY()-this.scaledValue(this.mBottomInset);left-=this.mLeftWidth;right+=this.mRightWidth;top-=this.mTopHeight;bottom+=this.mBottomHeight;return(new IWRect(left,top,right-left,bottom-top)).round();},p_buildFrame:function(images,size,zIndex)
  311. {var width=size.width;var height=size.height;var startX=this.mLeftWidth;var endX=width-this.mRightWidth;var startY=this.mTopHeight;var endY=height-this.mBottomHeight;var markup="";var zIndexStyle=zIndex?('z-index: '+zIndex+';'):'';if((startX<=endX+1)&&(startY<=endY+1))
  312. {var imageRect=new IWRect(0.0,0.0,this.mLeftWidth,this.mTopHeight);markup=imgMarkup(images[kSFRFrameTopLeft].sourceURL(),imageRect.position()+zIndexStyle);imageRect=new IWRect(0.0,(height-this.mBottomHeight),this.mLeftWidth,this.mBottomHeight);markup+=imgMarkup(images[kSFRFrameBottomLeft].sourceURL(),imageRect.position()+zIndexStyle);imageRect=new IWRect((width-this.mRightWidth),0.0,this.mRightWidth,this.mTopHeight);markup+=imgMarkup(images[kSFRFrameTopRight].sourceURL(),imageRect.position()+zIndexStyle);imageRect=new IWRect((width-this.mRightWidth),(height-this.mBottomHeight),this.mRightWidth,this.mBottomHeight);markup+=imgMarkup(images[kSFRFrameBottomRight].sourceURL(),imageRect.position()+zIndexStyle);var naturalSize=new IWSize(this.mLeftWidth,this.scaledValue(this.mLeftTileHeight));imageRect=new IWRect(0.0,startY,naturalSize.width,naturalSize.height);markup+=this.p_tiles(images[kSFRFrameLeft].sourceURL(),imageRect,startY,endY,true,zIndex);naturalSize=new IWSize(this.mRightWidth,this.scaledValue(this.mRightTileHeight));imageRect=new IWRect(width-this.mRightWidth,startY,naturalSize.width,naturalSize.height);markup+=this.p_tiles(images[kSFRFrameRight].sourceURL(),imageRect,startY,endY,true,zIndex);naturalSize=new IWSize(this.scaledValue(this.mTopTileWidth),this.mTopHeight);imageRect=new IWRect(startX,0.0,naturalSize.width,naturalSize.height);markup+=this.p_tiles(images[kSFRFrameTop].sourceURL(),imageRect,startX,endX,false,zIndex);naturalSize=new IWSize(this.scaledValue(this.mBottomTileWidth),this.mBottomHeight);imageRect=new IWRect(startX,height-this.mBottomHeight,naturalSize.width,naturalSize.height);markup+=this.p_tiles(images[kSFRFrameBottom].sourceURL(),imageRect,startX,endX,false,zIndex);}
  313. return markup;},p_adornmentRectForRect:function(rect)
  314. {var adornmentCenter=new IWPoint();rect=this.coverageRect(rect);adornmentCenter.x=(rect.size.width-(this.mLeftWidth+this.mRightWidth))*this.mAdornmentPosition.x;adornmentCenter.x+=rect.origin.x+this.mLeftWidth;adornmentCenter.y=this.mTopHeight/2.0+(rect.origin.y+this.mAdornmentPosition.y);var scaledAdornmentSize=new IWSize(this.scaledValue(this.mAdornmentSize.width),this.scaledValue(this.mAdornmentSize.height));var adornmentOrigin=new IWPoint(adornmentCenter.x-(scaledAdornmentSize.width/2.0),adornmentCenter.y-(scaledAdornmentSize.height/2.0));var adornmentRect=new IWRect(adornmentOrigin,scaledAdornmentSize);return adornmentRect;},p_adornmentMarkupForRect:function(rect,zIndex)
  315. {var zIndexStyle=zIndex?('z-index: '+zIndex+';'):'';return imgMarkup(this.mAdornmentURL,this.p_adornmentRectForRect(rect).position()+zIndexStyle);},p_tiles:function(imageURL,imageRect,start,end,vertical,zIndex)
  316. {var markup="";if(start<end)
  317. {var zIndexStyle=zIndex?('z-index: '+zIndex+';'):'';var tileRect=imageRect.clone();var tilingMode=this.mTilingMode;if(vertical)
  318. {tileRect.size.height=Math.ceil(end-start);if(imageRect.size.height==1)
  319. {tilingMode=kSFRFrameStretchToFit;}}
  320. else
  321. {tileRect.size.width=Math.ceil(end-start);if(imageRect.size.width==1)
  322. {tilingMode=kSFRFrameStretchToFit;}}
  323. if(tilingMode==kSFRFrameStretchToFit)
  324. {markup+=imgMarkup(imageURL,tileRect.position()+zIndexStyle);}
  325. else
  326. {var naturalSize=imageRect.size;var offset=(vertical?naturalSize.height:naturalSize.width);var maxTiles=Math.ceil((end-start)/offset);if(offset<5||maxTiles>20)
  327. {IWAssert(function(){return true},"Please remove this assert and the surrouding block.");iWLog("Too many frame image tiles are getting generated.  Performance may be affected.");}
  328. if(tilingMode==kSFRFrameStretchEvenly)
  329. {offset=(end-start)/maxTiles;if(vertical)
  330. {imageRect.size.height=offset;}
  331. else
  332. {imageRect.size.width=offset;}}
  333. else if(tilingMode==kSFRFrameClip)
  334. {markup+='<div style="'+tileRect.position()+'overflow: hidden; ">';imageRect.origin.x=0;imageRect.origin.y=0;}
  335. for(var i=0;i<maxTiles;++i)
  336. {var left=Math.round(imageRect.origin.x);var right=Math.round(imageRect.origin.x+imageRect.size.width);var top=Math.round(imageRect.origin.y);var bottom=Math.round(imageRect.origin.y+imageRect.size.height);var roundedRect=new IWRect(left,top,(right-left),(bottom-top));markup+=imgMarkup(imageURL,roundedRect.position()+zIndexStyle);imageRect=vertical?imageRect.offset(0.0,offset):imageRect.offset(offset,0.0);}
  337. if(tilingMode==kSFRFrameClip)
  338. {markup+="</div>";}}}
  339. return markup;}});
Parsed in 0.273 seconds