<% --[[ Define some variables to make locating other resources easier firstPage was defined in our manifest.]] local image = getImage( index ) local theRoot = ".." local others = "." local mySize = "large" %> <% --[[ Include the page header]] %> <%@ include file="head.html" %> <% --[[ Main image area ]] %>
$image.metadata.title
<% --[[ Pagination section ]] %>
<% --[[ Logic for centering the image on the page. We've decided to implement a rather complicated layout system for the image depending on whether it can fit nicely in the same area occupied by the grid. That coupled with the fact that HTML doesn't center things very well means its a little harder yet. The solution we adopt is to calculate the left margin for the image, and then position the element manually. ]] local imageBorderWidth = 0 local imgWidth = image.renditions.large.width local imgHeight = image.renditions.large.height if model.nonCSS.showImageBorderLarge then imageBorderWidth = model.nonCSS.imageBorderWidth end local gridDefinedWidth = model.nonCSS.numCols * 161 + 1 local imagePlusBorderDefinedWith = 2 * imageBorderWidth + model.photoSizes.large.width + 30 local stageWidth = math.max( gridDefinedWidth, imagePlusBorderDefinedWith ) local previewX = math.floor( math.max( 15, ( stageWidth - imgWidth ) / 2 ) ) - imageBorderWidth %>
<% local pathToANode="parentNode.parentNode" if model.nonCSS.dropShadows then pathToANode = "parentNode.parentNode.parentNode.parentNode" %>
<% end %> $image.metadata.title width=<%= imgWidth %> height=<%= imgHeight %> <% end %> onclick="var node=<%= pathToANode %>; if( node.click ) { return node.click(); } else { return true; }"> <% if model.nonCSS.dropShadows then %>
<% end %>
<% --[[ Caption ]] %>
$image.metadata.description
<% --[[ Include the page footer]] %> <%@ include file="foot.html" %>