Aviashow 2010
...ared\webengines\default_html.lrwebengine\detail.html:322: attempt to index field 'renditions' (a nil value)
...ared\webengines\default_html.lrwebengine\detail.html:322: attempt to index field 'renditions' (a nil value)
Switch View
- ...ared\webengines\default_html.lrwebengine\detail.html:322: in main chunk
- <%
- --[[ 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]] %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
- <head>
- <% --[[ HTML page metadata and stylesheets ]] %>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
- <meta name="Keywords" content="photography,software,photos,digital darkroom,gallery,image,photographer,adobe,photoshop,lightroom" >
- <meta name="generator" content="Adobe Photoshop Lightroom" >
- <title>$model.metadata.siteTitle.value</title>
- <link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="$others/custom.css" >
- <link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="$theRoot/resources/css/master.css" >
- <% --[[ Scripting support for rollovers and (when previewed in Lightroom) live Update, photobin syncing ]] %>
- <script type="text/javascript">
- window.AgMode = "$mode";
- cellRolloverColor="#A1A1A1";
- cellColor="#949494";
- <% if mode == 'preview' then %>
- window.AgOnLoad = function() {
- tellLightroomWhatImagesWeAreUsing();
- setActiveImageSize( "<%= mySize %>" );
- <% if image then %>
- callCallback( "showInPhotoBin", "$image.imageID" );
- <% end %>
- }
- <% end %>
- </script>
- <script type="text/javascript" src="$theRoot/resources/js/live_update.js">
- </script>
- <% --[[ Special hacks for Internet Explorer ]] %>
- <!--[if lt IE 7.]> <script defer type="text/javascript" src="$theRoot/resources/js/pngfix.js"></script> <![endif]-->
- <!--[if gt IE 6]> <link rel="stylesheet" href="$theRoot/resources/css/ie7.css"></link> <![endif]-->
- <!--[if lt IE 7.]> <link rel="stylesheet" href="$theRoot/resources/css/ie6.css"></link> <![endif]-->
- </head>
- <% --[[ The main HTML page begins here ]] %>
- <body>
- <% --[[ experimental; get colors from kuler]] %>
- <% if model.nonCSS.showKuler then %>
- <% if mode == 'preview' then %>
- <script language="javascript">
- var coloredElements = [
- "appearance.textColor.color",
- "nonCSS.cellColor",
- "appearance.itemNumber.color",
- "appearance.body.background-color",
- "nonCSS.thumbBorderColor",
- "appearance.previewFull.background-color",
- "nonCSS.cellRolloverColor",
- "nonCSS.cellBorderColor",
- "appearance.detailText.color",
- "nonCSS.largeImageBorderColor",
- "nonCSS.sectionBorderColor"
- ];
- function hexColorCmp(aValue,bValue) {
- aValueSplit = str_split(aValue, 2);
- aValueSum = hexdec(aValueSplit[0]) + hexdec(aValueSplit[1]) + hexdec(aValueSplit[2]);
- bValueSplit = str_split(bValue, 2);
- bValueSum = hexdec(bValueSplit[0]) + hexdec(bValueSplit[1]) + hexdec(bValueSplit[2]);
- return aValueSum - bValueSum;
- }
- function statusMessage( html ) {
- document.getElementById( 'kuler_message' ).innerHTML = html;
- }
- function subStatusMessage( html ) {
- document.getElementById( 'kuler_detail' ).innerHTML = html;
- }
- function getURLContents ( url, callback ) {
- document.AgFetchResults = callback;
- callCallback( "fetchURL", url );
- }
- var colors = null;
- function parseKulerXML( xmlstring ) {
- // convert string to XML object
- var xmlobject;
- // Windows requires us to include namespace prefix when searching for tags
- // by name. Safari doesn't. And neither offers an api for searching by
- // tags including the namespace <grrrr />.
- var HACK = "";
- if (window.ActiveXObject) {
- xmlobject=new ActiveXObject("Microsoft.XMLDOM");
- xmlobject.async=false;
- xmlobject.loadXML( xmlstring );
- HACK="kuler:";
- }
- else {
- xmlobject = (new DOMParser()).parseFromString(xmlstring, "text/xml");
- }
- // get a reference to the root-element "rss"
- var root = xmlobject.getElementsByTagName('rss')[0];
- // get reference to "channel" element
- var channels = root.getElementsByTagName("channel");
- // now get all "item" tags in the channel
- var items = channels[0].getElementsByTagName("item");
- if( items.length == 0 ) {
- statusMessage( "No results found. Ready." );
- return;
- }
- var myInfo = "" + items.length + " match<span id='kuler_detail'></span>:<br>";
- colors = new Array();
- for( var itemIndex = 0; itemIndex < items.length; itemIndex++ ) {
- var hexColorArray = new Array();
- colors[ itemIndex ] = hexColorArray;
- var item = items[ itemIndex ];
- // in the "item" we have a description, so get that
- var themeID = item.getElementsByTagName( HACK + 'themeID' )[0].firstChild.nodeValue;
- // we also get the "pubDate" element in the "item"
- var title = item.getElementsByTagName( 'title' )[0].firstChild.nodeValue;
- var themeSwatches = item.getElementsByTagName( HACK + 'themeSwatches' )[ 0 ];
- var swatches = themeSwatches.getElementsByTagName( HACK + 'swatch' );
- myInfo = myInfo + "<div style='margin:5px' onclick='applySwatch( " + itemIndex + " );'>";
- for( var swatchIndex = 0; swatchIndex < swatches.length; swatchIndex++ ) {
- var swatch = swatches[ swatchIndex ];
- var hexColor = swatch.getElementsByTagName( HACK + 'swatchHexColor' )[ 0 ].firstChild.nodeValue;
- myInfo = myInfo + "<span style='width:5px; background:#" + hexColor + ";'> </span>";
- hexColorArray[ swatchIndex ] = hexColor;
- }
- myInfo = myInfo + "\n";
- myInfo = myInfo + title + ": " + themeID + "</div>";
- }
- statusMessage(myInfo);
-
- }
- function applySwatch( index ) {
- subStatusMessage("<B>Applying swatch</B>")
- // use a delay, so the web view will actually display the above message before
- // starting this work, which may take a moment to complete.
- setTimeout("applySwatch0( " + index + " )", 10 );
- }
- var seed = 0;
- function applySwatch0( index ) {
- document.LR_modelManipulation = true;
- var swatches = colors[ index ];
- if( swatches == null ) {
- return;
- }
- for( var index = 0; index<coloredElements.length; index++ ) {
- var theColor = coloredElements[ index ];
- var swatchIndex = ( seed + index ) % swatches.length;
- if( theColor == null ) {
- break;
- }
- var hexColor = swatches[ swatchIndex ];
- callCallback( "updateModel", theColor, '#' + hexColor );
- }
- seed = seed + 1;
- document.LR_modelManipulation = false;
- subStatusMessage("")
- }
- function getTheme() {
- var query = document.getElementById( 'query' ).value;
- kulerURL = 'http://kuler.adobe.com/kuler/API/rss/search.cfm?searchQuery=' + query + '&startIndex=0&itemsPerPage=10'
- statusMessage( "Searching..." );
- getURLContents( kulerURL, parseKulerXML )
- }
-
- var kulerOn = false;
- function toggleKuler() {
- kulerOn = !kulerOn;
- var kulerElement = document.getElementById('kuler');
- var style = kulerElement.style;
- style.display = kulerOn ? '' : 'none';
- }
- </script>
- <table style="z-index: 2;position:absolute;top:10px;right:10px;">
- <tr>
- <td onclick="toggleKuler()" id="kulerToggler"><img src='$theRoot/kuler_blog_badge.png' width=28 height=28></td>
- <td id="kuler" style="background:white; display:none;">
- <div style="border:1px solid black; border-bottom:0; padding:5px;">
- Query: <input id='query' type='text' name='query' onkeypress="if( event.keyCode == 13 ) { getTheme(); event.keyCode=null; return false; }">
- <input type="button" onclick="getTheme(); return false;" name="button" value="Search">
- </div>
- <div style="border:1px solid black; border-top:0; padding:5px;">
- Status:
- <span id="kuler_message">Ready.</span>
- </div>
- </td>
- </tr>
- </table>
- <% end %>
- <% end %>
- <div id="wrapper_$mySize">
- <%
- local function fixUrlIfRelative( url )
- url = tostring( url ) or ""
- if string.find( url, "[a-z]+:" ) then
- -- this url starts with something like http: or mailto:, so leave it alone
- else
- -- this url is probably relative, so we need to tack on theRoot to the beginning
- -- of it, so no matter where the page we're currently viewing is placed in the
- -- output hierarchy, this link will still point to the same page
- url = theRoot .. "/" .. url;
- end
- return url
- end
- --[[ Include the identity plate during preview to enable quick live update ]]
- local includeIdentityPlate = mode == 'preview' or model.appearance.logo.display
- if includeIdentityPlate then
- local url = fixUrlIfRelative( model.metadata.homePage.value )
- %>
- <div id="model.nonCSS.idplateEnabled">
- <div class="logo"> <a href="$url"> <img width="<%= getIdentityPlateSize().width %>" height="<%= getIdentityPlateSize().height %>" class="pngDelayDisplay" src="$others/logo.png" alt="Logo"> </a> </div>
- </div>
- <%
- end --[[ End conditionalize identity plate ]]
- %>
- <% --[[ Page header titles ]] %>
- <div id="sitetitle">
- <h1 onclick="clickTarget( this, 'metadata.siteTitle.value' );" id="metadata.siteTitle.value" class="textColor">$model.metadata.siteTitle.value</h1>
- </div>
- <div id="collectionHeader">
- <h1 onclick="clickTarget( this, 'metadata.groupTitle.value' );" id="metadata.groupTitle.value" class="textColor">$model.metadata.groupTitle.value</h1>
- <p onclick="clickTarget( this, 'metadata.groupDescription.value' );" id="metadata.groupDescription.value" class="textColor">$model.metadata.groupDescription.value</p>
- </div>
- <% --[[ Main image area ]] %>
- <div id="stage2">
- <div id="previewFull" class="borderTopLeft borderBottomRight">
- <div id="detailTitle" class="detailText">
- $image.metadata.title
- </div>
- <% --[[ Pagination section ]] %>
- <div class="detailNav">
- <ul>
- <lr:Pagination>
- <lr:PreviousEnabled>
- <li class="previous"> <a class="paginationLinks detailText" href="$link"><%= LOC "$$$/AgWPG/Templates/HTML/output/Previous=Previous" %></a> </li>
- </lr:PreviousEnabled>
- <lr:PreviousDisabled>
- <li class="previous detailText"> <%= LOC "$$$/AgWPG/Templates/HTML/output/Previous=Previous" %> </li>
- </lr:PreviousDisabled>
- <li class="index"> <a href="$gridPageLink" class="detailLinks detailText">Index</a> </li>
- <lr:NextEnabled>
- <li class="next"> <a class="paginationLinks detailText" href="$link"><%= LOC "$$$/AgWPG/Templates/HTML/output/Next=Next" %></a> </li>
- </lr:NextEnabled>
- <lr:NextDisabled>
- <li class="next detailText"> <%= LOC "$$$/AgWPG/Templates/HTML/output/Next=Next" %> </li>
- </lr:NextDisabled>
- </lr:Pagination>
- </ul>
- </div>
- <%
- --[[
- 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
- %>
- <a href="$gridPageLink">
- <div style="margin-left:<%= previewX %>px;">
- <%
- local pathToANode="parentNode.parentNode"
- if model.nonCSS.dropShadows then
- pathToANode = "parentNode.parentNode.parentNode.parentNode" %>
- <div class="dropShadow">
- <div class="inner">
- <% end %>
- <img src="bin/images/large/<%= image.exportFilename %>.jpg"
- class="previewFullImage preview"
- id="previewImage"
- alt="$image.metadata.title"
- <% if mode == 'preview' then %>
- width=<%= imgWidth %>
- height=<%= imgHeight %>
- <% end %>
- onclick="var node=<%= pathToANode %>; if( node.click ) { return node.click(); } else { return true; }">
- <% if model.nonCSS.dropShadows then %>
- </div>
- </div>
- <% end %>
- </div>
- </a>
- <div style="clear:both; height:5px"></div>
- <% --[[ Caption ]] %>
- <div id="detailCaption" class="detailText">
- $image.metadata.description
- </div>
- </div>
- </div>
- <div class="clear">
- </div>
- <% --[[ Include the page footer]] %>
- <% --[[ Contact Info ]] %>
- <div id="contact">
- <% if mode ~= 'preview' then
- local url = fixUrlIfRelative( model.metadata.contactInfo.link ) %>
- <a href="<%= url %>"> <span
- <% else %>
- <span onclick="clickTarget( this, 'metadata.contactInfo.value' );" style="text-decoration: underline;"
- <% end %>
- class="textColor" id="metadata.contactInfo.value"><%= model.metadata.contactInfo.value %></span>
- <% if mode ~= 'preview' then %>
- </a>
- <% end %>
- </div>
- <div class="clear">
- </div>
- </div>
- </body>
- </html>
-
- --[[ 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"
- write( [[
- ]] ) --[[ Include the page header]] write( [[
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
- <head>
- ]] ) --[[ HTML page metadata and stylesheets ]] write( [[
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
- <meta name="Keywords" content="photography,software,photos,digital darkroom,gallery,image,photographer,adobe,photoshop,lightroom" >
- <meta name="generator" content="Adobe Photoshop Lightroom" >
- <title>]] )write( model.metadata.siteTitle.value )write( [[</title>
- <link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="]] )write( others )write( [[/custom.css" >
- <link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="]] )write( theRoot )write( [[/resources/css/master.css" >
- ]] ) --[[ Scripting support for rollovers and (when previewed in Lightroom) live Update, photobin syncing ]] write( [[
- <script type="text/javascript">
- window.AgMode = "]] )write( mode )write( [[";
- cellRolloverColor="#A1A1A1";
- cellColor="#949494";
- ]] ) if mode == 'preview' then write( [[
- window.AgOnLoad = function() {
- tellLightroomWhatImagesWeAreUsing();
- setActiveImageSize( "]] )write( mySize )write( [[" );
- ]] ) if image then write( [[
- callCallback( "showInPhotoBin", "]] )write( image.imageID )write( [[" );
- ]] ) end write( [[
- }
- ]] ) end write( [[
- </script>
- <script type="text/javascript" src="]] )write( theRoot )write( [[/resources/js/live_update.js">
- </script>
- ]] ) --[[ Special hacks for Internet Explorer ]] write( [[
- <!--]] .. "[" .. [[if lt IE 7.]] .. "]" .. [[> <script defer type="text/javascript" src="]] )write( theRoot )write( [[/resources/js/pngfix.js"></script> <!]] .. "[" .. [[endif]] .. "]" .. [[-->
- <!--]] .. "[" .. [[if gt IE 6]] .. "]" .. [[> <link rel="stylesheet" href="]] )write( theRoot )write( [[/resources/css/ie7.css"></link> <!]] .. "[" .. [[endif]] .. "]" .. [[-->
- <!--]] .. "[" .. [[if lt IE 7.]] .. "]" .. [[> <link rel="stylesheet" href="]] )write( theRoot )write( [[/resources/css/ie6.css"></link> <!]] .. "[" .. [[endif]] .. "]" .. [[-->
- </head>
- ]] ) --[[ The main HTML page begins here ]] write( [[
- <body>
- ]] ) --[[ experimental; get colors from kuler]] write( [[
- ]] ) if model.nonCSS.showKuler then write( [[
- ]] ) if mode == 'preview' then write( [[
- <script language="javascript">
- var coloredElements = ]] .. "[" .. [[
- "appearance.textColor.color",
- "nonCSS.cellColor",
- "appearance.itemNumber.color",
- "appearance.body.background-color",
- "nonCSS.thumbBorderColor",
- "appearance.previewFull.background-color",
- "nonCSS.cellRolloverColor",
- "nonCSS.cellBorderColor",
- "appearance.detailText.color",
- "nonCSS.largeImageBorderColor",
- "nonCSS.sectionBorderColor"
- ]] .. "]" .. [[;
- function hexColorCmp(aValue,bValue) {
- aValueSplit = str_split(aValue, 2);
- aValueSum = hexdec(aValueSplit]] .. "[" .. [[0]] .. "]" .. [[) + hexdec(aValueSplit]] .. "[" .. [[1]] .. "]" .. [[) + hexdec(aValueSplit]] .. "[" .. [[2]] .. "]" .. [[);
- bValueSplit = str_split(bValue, 2);
- bValueSum = hexdec(bValueSplit]] .. "[" .. [[0]] .. "]" .. [[) + hexdec(bValueSplit]] .. "[" .. [[1]] .. "]" .. [[) + hexdec(bValueSplit]] .. "[" .. [[2]] .. "]" .. [[);
- return aValueSum - bValueSum;
- }
- function statusMessage( html ) {
- document.getElementById( 'kuler_message' ).innerHTML = html;
- }
- function subStatusMessage( html ) {
- document.getElementById( 'kuler_detail' ).innerHTML = html;
- }
- function getURLContents ( url, callback ) {
- document.AgFetchResults = callback;
- callCallback( "fetchURL", url );
- }
- var colors = null;
- function parseKulerXML( xmlstring ) {
- // convert string to XML object
- var xmlobject;
- // Windows requires us to include namespace prefix when searching for tags
- // by name. Safari doesn't. And neither offers an api for searching by
- // tags including the namespace <grrrr />.
- var HACK = "";
- if (window.ActiveXObject) {
- xmlobject=new ActiveXObject("Microsoft.XMLDOM");
- xmlobject.async=false;
- xmlobject.loadXML( xmlstring );
- HACK="kuler:";
- }
- else {
- xmlobject = (new DOMParser()).parseFromString(xmlstring, "text/xml");
- }
- // get a reference to the root-element "rss"
- var root = xmlobject.getElementsByTagName('rss')]] .. "[" .. [[0]] .. "]" .. [[;
- // get reference to "channel" element
- var channels = root.getElementsByTagName("channel");
- // now get all "item" tags in the channel
- var items = channels]] .. "[" .. [[0]] .. "]" .. [[.getElementsByTagName("item");
- if( items.length == 0 ) {
- statusMessage( "No results found. Ready." );
- return;
- }
- var myInfo = "" + items.length + " match<span id='kuler_detail'></span>:<br>";
- colors = new Array();
- for( var itemIndex = 0; itemIndex < items.length; itemIndex++ ) {
- var hexColorArray = new Array();
- colors]] .. "[" .. [[ itemIndex ]] .. "]" .. [[ = hexColorArray;
- var item = items]] .. "[" .. [[ itemIndex ]] .. "]" .. [[;
- // in the "item" we have a description, so get that
- var themeID = item.getElementsByTagName( HACK + 'themeID' )]] .. "[" .. [[0]] .. "]" .. [[.firstChild.nodeValue;
- // we also get the "pubDate" element in the "item"
- var title = item.getElementsByTagName( 'title' )]] .. "[" .. [[0]] .. "]" .. [[.firstChild.nodeValue;
- var themeSwatches = item.getElementsByTagName( HACK + 'themeSwatches' )]] .. "[" .. [[ 0 ]] .. "]" .. [[;
- var swatches = themeSwatches.getElementsByTagName( HACK + 'swatch' );
- myInfo = myInfo + "<div style='margin:5px' onclick='applySwatch( " + itemIndex + " );'>";
- for( var swatchIndex = 0; swatchIndex < swatches.length; swatchIndex++ ) {
- var swatch = swatches]] .. "[" .. [[ swatchIndex ]] .. "]" .. [[;
- var hexColor = swatch.getElementsByTagName( HACK + 'swatchHexColor' )]] .. "[" .. [[ 0 ]] .. "]" .. [[.firstChild.nodeValue;
- myInfo = myInfo + "<span style='width:5px; background:#" + hexColor + ";'> </span>";
- hexColorArray]] .. "[" .. [[ swatchIndex ]] .. "]" .. [[ = hexColor;
- }
- myInfo = myInfo + "\n";
- myInfo = myInfo + title + ": " + themeID + "</div>";
- }
- statusMessage(myInfo);
-
- }
- function applySwatch( index ) {
- subStatusMessage("<B>Applying swatch</B>")
- // use a delay, so the web view will actually display the above message before
- // starting this work, which may take a moment to complete.
- setTimeout("applySwatch0( " + index + " )", 10 );
- }
- var seed = 0;
- function applySwatch0( index ) {
- document.LR_modelManipulation = true;
- var swatches = colors]] .. "[" .. [[ index ]] .. "]" .. [[;
- if( swatches == null ) {
- return;
- }
- for( var index = 0; index<coloredElements.length; index++ ) {
- var theColor = coloredElements]] .. "[" .. [[ index ]] .. "]" .. [[;
- var swatchIndex = ( seed + index ) % swatches.length;
- if( theColor == null ) {
- break;
- }
- var hexColor = swatches]] .. "[" .. [[ swatchIndex ]] .. "]" .. [[;
- callCallback( "updateModel", theColor, '#' + hexColor );
- }
- seed = seed + 1;
- document.LR_modelManipulation = false;
- subStatusMessage("")
- }
- function getTheme() {
- var query = document.getElementById( 'query' ).value;
- kulerURL = 'http://kuler.adobe.com/kuler/API/rss/search.cfm?searchQuery=' + query + '&startIndex=0&itemsPerPage=10'
- statusMessage( "Searching..." );
- getURLContents( kulerURL, parseKulerXML )
- }
-
- var kulerOn = false;
- function toggleKuler() {
- kulerOn = !kulerOn;
- var kulerElement = document.getElementById('kuler');
- var style = kulerElement.style;
- style.display = kulerOn ? '' : 'none';
- }
- </script>
- <table style="z-index: 2;position:absolute;top:10px;right:10px;">
- <tr>
- <td onclick="toggleKuler()" id="kulerToggler"><img src=']] )write( theRoot )write( [[/kuler_blog_badge.png' width=28 height=28></td>
- <td id="kuler" style="background:white; display:none;">
- <div style="border:1px solid black; border-bottom:0; padding:5px;">
- Query: <input id='query' type='text' name='query' onkeypress="if( event.keyCode == 13 ) { getTheme(); event.keyCode=null; return false; }">
- <input type="button" onclick="getTheme(); return false;" name="button" value="Search">
- </div>
- <div style="border:1px solid black; border-top:0; padding:5px;">
- Status:
- <span id="kuler_message">Ready.</span>
- </div>
- </td>
- </tr>
- </table>
- ]] ) end write( [[
- ]] ) end write( [[
- <div id="wrapper_]] )write( mySize )write( [[">
- ]] )
- local function fixUrlIfRelative( url )
- url = tostring( url ) or ""
- if string.find( url, "[a-z]+:" ) then
- -- this url starts with something like http: or mailto:, so leave it alone
- else
- -- this url is probably relative, so we need to tack on theRoot to the beginning
- -- of it, so no matter where the page we're currently viewing is placed in the
- -- output hierarchy, this link will still point to the same page
- url = theRoot .. "/" .. url;
- end
- return url
- end
- --[[ Include the identity plate during preview to enable quick live update ]]
- local includeIdentityPlate = mode == 'preview' or model.appearance.logo.display
- if includeIdentityPlate then
- local url = fixUrlIfRelative( model.metadata.homePage.value )
- write( [[
- <div id="model.nonCSS.idplateEnabled">
- <div class="logo"> <a href="]] )write( url )write( [["> <img width="]] )write( getIdentityPlateSize().width )write( [[" height="]] )write( getIdentityPlateSize().height )write( [[" class="pngDelayDisplay" src="]] )write( others )write( [[/logo.png" alt="Logo"> </a> </div>
- </div>
- ]] )
- end --[[ End conditionalize identity plate ]]
- write( [[
- ]] ) --[[ Page header titles ]] write( [[
- <div id="sitetitle">
- <h1 onclick="clickTarget( this, 'metadata.siteTitle.value' );" id="metadata.siteTitle.value" class="textColor">]] )write( model.metadata.siteTitle.value )write( [[</h1>
- </div>
- <div id="collectionHeader">
- <h1 onclick="clickTarget( this, 'metadata.groupTitle.value' );" id="metadata.groupTitle.value" class="textColor">]] )write( model.metadata.groupTitle.value )write( [[</h1>
- <p onclick="clickTarget( this, 'metadata.groupDescription.value' );" id="metadata.groupDescription.value" class="textColor">]] )write( model.metadata.groupDescription.value )write( [[</p>
- </div>
- ]] ) --[[ Main image area ]] write( [[
- <div id="stage2">
- <div id="previewFull" class="borderTopLeft borderBottomRight">
- <div id="detailTitle" class="detailText">
- ]] )write( image.metadata.title )write( [[
- </div>
- ]] ) --[[ Pagination section ]] write( [[
- <div class="detailNav">
- <ul>
- ]] ) do local LrPaginationEntries = {}
- local oldWrite = write
- write = function( w )
- table.insert( LrPaginationEntries, function() oldWrite( w ) end )
- end
- write( [[
- ]] )LrPaginationEntries.PreviousEnabled = function( page, link ) write( [[
- <li class="previous"> <a class="paginationLinks detailText" href="]] )write( link )write( [[">]] )write( LOC "$$$/AgWPG/Templates/HTML/output/Previous=Previous" )write( [[</a> </li>
- ]] )end table.insert( LrPaginationEntries, 'Previous' ) write( [[
- ]] )LrPaginationEntries.PreviousDisabled = function( ) write( [[
- <li class="previous detailText"> ]] )write( LOC "$$$/AgWPG/Templates/HTML/output/Previous=Previous" )write( [[ </li>
- ]] )end write( [[
- <li class="index"> <a href="]] )write( gridPageLink )write( [[" class="detailLinks detailText">Index</a> </li>
- ]] )LrPaginationEntries.NextEnabled = function( page, link ) write( [[
- <li class="next"> <a class="paginationLinks detailText" href="]] )write( link )write( [[">]] )write( LOC "$$$/AgWPG/Templates/HTML/output/Next=Next" )write( [[</a> </li>
- ]] )end table.insert( LrPaginationEntries, 'Next' ) write( [[
- ]] )LrPaginationEntries.NextDisabled = function( ) write( [[
- <li class="next detailText"> ]] )write( LOC "$$$/AgWPG/Templates/HTML/output/Next=Next" )write( [[ </li>
- ]] )end write( [[
- ]] )write = oldWrite LrTagFuncs.PaginationFunc( _G, LrPaginationEntries ) end write( [[
- </ul>
- </div>
- ]] )
- --[[
- 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
- write( [[
- <a href="]] )write( gridPageLink )write( [[">
- <div style="margin-left:]] )write( previewX )write( [[px;">
- ]] )
- local pathToANode="parentNode.parentNode"
- if model.nonCSS.dropShadows then
- pathToANode = "parentNode.parentNode.parentNode.parentNode" write( [[
- <div class="dropShadow">
- <div class="inner">
- ]] ) end write( [[
- <img src="bin/images/large/]] )write( image.exportFilename )write( [[.jpg"
- class="previewFullImage preview"
- id="previewImage"
- alt="]] )write( image.metadata.title )write( [["
- ]] ) if mode == 'preview' then write( [[
- width=]] )write( imgWidth )write( [[
- height=]] )write( imgHeight )write( [[
- ]] ) end write( [[
- onclick="var node=]] )write( pathToANode )write( [[; if( node.click ) { return node.click(); } else { return true; }">
- ]] ) if model.nonCSS.dropShadows then write( [[
- </div>
- </div>
- ]] ) end write( [[
- </div>
- </a>
- <div style="clear:both; height:5px"></div>
- ]] ) --[[ Caption ]] write( [[
- <div id="detailCaption" class="detailText">
- ]] )write( image.metadata.description )write( [[
- </div>
- </div>
- </div>
- <div class="clear">
- </div>
- ]] ) --[[ Include the page footer]] write( [[
- ]] ) --[[ Contact Info ]] write( [[
- <div id="contact">
- ]] ) if mode ~= 'preview' then
- local url = fixUrlIfRelative( model.metadata.contactInfo.link ) write( [[
- <a href="]] )write( url )write( [["> <span
- ]] ) else write( [[
- <span onclick="clickTarget( this, 'metadata.contactInfo.value' );" style="text-decoration: underline;"
- ]] ) end write( [[
- class="textColor" id="metadata.contactInfo.value">]] )write( model.metadata.contactInfo.value )write( [[</span>
- ]] ) if mode ~= 'preview' then write( [[
- </a>
- ]] ) end write( [[
- </div>
- <div class="clear">
- </div>
- </div>
- </body>
- </html>
- ]] )