Aviashow 2010

81
...shared\webengines\default_html.lrwebengine\grid.html:298: attempt to index field 'renditions' (a nil value)

...shared\webengines\default_html.lrwebengine\grid.html:298: attempt to index field 'renditions' (a nil value)

Switch View
  • ...shared\webengines\default_html.lrwebengine\grid.html:298: in function 'func'
  • ?: in function 'ThumbnailGridFunc'
  • ...shared\webengines\default_html.lrwebengine\grid.html:318: in main chunk
  1. <%
  2. --[[ Define some variables to make locating other resources easier
  3. firstPage was defined in our manifest.]]
  4. local others = "content"
  5. local theRoot = "."
  6. local mySize = "thumb"
  7. %>
  8. <% --[[ Include the page header]] %>
  9. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  10. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  11. <head>
  12. <% --[[ HTML page metadata and stylesheets ]] %>
  13. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
  14. <meta name="Keywords" content="photography,software,photos,digital darkroom,gallery,image,photographer,adobe,photoshop,lightroom" >
  15. <meta name="generator" content="Adobe Photoshop Lightroom" >
  16. <title>$model.metadata.siteTitle.value</title>
  17. <link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="$others/custom.css" >
  18. <link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="$theRoot/resources/css/master.css" >
  19. <% --[[ Scripting support for rollovers and (when previewed in Lightroom) live Update, photobin syncing ]] %>
  20. <script type="text/javascript">
  21. window.AgMode = "$mode";
  22. cellRolloverColor="#A1A1A1";
  23. cellColor="#949494";
  24. <% if mode == 'preview' then %>
  25. window.AgOnLoad = function() {
  26. tellLightroomWhatImagesWeAreUsing();
  27. setActiveImageSize( "<%= mySize %>" );
  28. <% if image then %>
  29. callCallback( "showInPhotoBin", "$image.imageID" );
  30. <% end %>
  31. }
  32. <% end %>
  33. </script>
  34. <script type="text/javascript" src="$theRoot/resources/js/live_update.js">
  35. </script>
  36. <% --[[ Special hacks for Internet Explorer ]] %>
  37. <!--[if lt IE 7.]> <script defer type="text/javascript" src="$theRoot/resources/js/pngfix.js"></script> <![endif]-->
  38. <!--[if gt IE 6]> <link rel="stylesheet" href="$theRoot/resources/css/ie7.css"></link> <![endif]-->
  39. <!--[if lt IE 7.]> <link rel="stylesheet" href="$theRoot/resources/css/ie6.css"></link> <![endif]-->
  40. </head>
  41. <% --[[ The main HTML page begins here ]] %>
  42. <body>
  43. <% --[[ experimental; get colors from kuler]] %>
  44. <% if model.nonCSS.showKuler then %>
  45. <% if mode == 'preview' then %>
  46. <script language="javascript">
  47. var coloredElements = [
  48. "appearance.textColor.color",
  49. "nonCSS.cellColor",
  50. "appearance.itemNumber.color",
  51. "appearance.body.background-color",
  52. "nonCSS.thumbBorderColor",
  53. "appearance.previewFull.background-color",
  54. "nonCSS.cellRolloverColor",
  55. "nonCSS.cellBorderColor",
  56. "appearance.detailText.color",
  57. "nonCSS.largeImageBorderColor",
  58. "nonCSS.sectionBorderColor"
  59. ];
  60. function hexColorCmp(aValue,bValue) {
  61. aValueSplit = str_split(aValue, 2);
  62. aValueSum = hexdec(aValueSplit[0]) + hexdec(aValueSplit[1]) + hexdec(aValueSplit[2]);
  63. bValueSplit = str_split(bValue, 2);
  64. bValueSum = hexdec(bValueSplit[0]) + hexdec(bValueSplit[1]) + hexdec(bValueSplit[2]);
  65. return aValueSum - bValueSum;
  66. }
  67. function statusMessage( html ) {
  68. document.getElementById( 'kuler_message' ).innerHTML = html;
  69. }
  70. function subStatusMessage( html ) {
  71. document.getElementById( 'kuler_detail' ).innerHTML = html;
  72. }
  73. function getURLContents ( url, callback ) {
  74. document.AgFetchResults = callback;
  75. callCallback( "fetchURL", url );
  76. }
  77. var colors = null;
  78. function parseKulerXML( xmlstring ) {
  79. // convert string to XML object
  80. var xmlobject;
  81. // Windows requires us to include namespace prefix when searching for tags
  82. // by name. Safari doesn't. And neither offers an api for searching by
  83. // tags including the namespace <grrrr />.
  84. var HACK = "";
  85. if (window.ActiveXObject) {
  86. xmlobject=new ActiveXObject("Microsoft.XMLDOM");
  87. xmlobject.async=false;
  88. xmlobject.loadXML( xmlstring );
  89. HACK="kuler:";
  90. }
  91. else {
  92. xmlobject = (new DOMParser()).parseFromString(xmlstring, "text/xml");
  93. }
  94. // get a reference to the root-element "rss"
  95. var root = xmlobject.getElementsByTagName('rss')[0];
  96. // get reference to "channel" element
  97. var channels = root.getElementsByTagName("channel");
  98. // now get all "item" tags in the channel
  99. var items = channels[0].getElementsByTagName("item");
  100. if( items.length == 0 ) {
  101. statusMessage( "No results found. Ready." );
  102. return;
  103. }
  104. var myInfo = "" + items.length + " match<span id='kuler_detail'></span>:<br>";
  105. colors = new Array();
  106. for( var itemIndex = 0; itemIndex < items.length; itemIndex++ ) {
  107. var hexColorArray = new Array();
  108. colors[ itemIndex ] = hexColorArray;
  109. var item = items[ itemIndex ];
  110. // in the "item" we have a description, so get that
  111. var themeID = item.getElementsByTagName( HACK + 'themeID' )[0].firstChild.nodeValue;
  112. // we also get the "pubDate" element in the "item"
  113. var title = item.getElementsByTagName( 'title' )[0].firstChild.nodeValue;
  114. var themeSwatches = item.getElementsByTagName( HACK + 'themeSwatches' )[ 0 ];
  115. var swatches = themeSwatches.getElementsByTagName( HACK + 'swatch' );
  116. myInfo = myInfo + "<div style='margin:5px' onclick='applySwatch( " + itemIndex + " );'>";
  117. for( var swatchIndex = 0; swatchIndex < swatches.length; swatchIndex++ ) {
  118. var swatch = swatches[ swatchIndex ];
  119. var hexColor = swatch.getElementsByTagName( HACK + 'swatchHexColor' )[ 0 ].firstChild.nodeValue;
  120. myInfo = myInfo + "<span style='width:5px; background:#" + hexColor + ";'> </span>";
  121. hexColorArray[ swatchIndex ] = hexColor;
  122. }
  123. myInfo = myInfo + "\n";
  124. myInfo = myInfo + title + ": " + themeID + "</div>";
  125. }
  126. statusMessage(myInfo);
  127. }
  128. function applySwatch( index ) {
  129. subStatusMessage("<B>Applying swatch</B>")
  130. // use a delay, so the web view will actually display the above message before
  131. // starting this work, which may take a moment to complete.
  132. setTimeout("applySwatch0( " + index + " )", 10 );
  133. }
  134. var seed = 0;
  135. function applySwatch0( index ) {
  136. document.LR_modelManipulation = true;
  137. var swatches = colors[ index ];
  138. if( swatches == null ) {
  139. return;
  140. }
  141. for( var index = 0; index<coloredElements.length; index++ ) {
  142. var theColor = coloredElements[ index ];
  143. var swatchIndex = ( seed + index ) % swatches.length;
  144. if( theColor == null ) {
  145. break;
  146. }
  147. var hexColor = swatches[ swatchIndex ];
  148. callCallback( "updateModel", theColor, '#' + hexColor );
  149. }
  150. seed = seed + 1;
  151. document.LR_modelManipulation = false;
  152. subStatusMessage("")
  153. }
  154. function getTheme() {
  155. var query = document.getElementById( 'query' ).value;
  156. kulerURL = 'http://kuler.adobe.com/kuler/API/rss/search.cfm?searchQuery=' + query + '&startIndex=0&itemsPerPage=10'
  157. statusMessage( "Searching..." );
  158. getURLContents( kulerURL, parseKulerXML )
  159. }
  160. var kulerOn = false;
  161. function toggleKuler() {
  162. kulerOn = !kulerOn;
  163. var kulerElement = document.getElementById('kuler');
  164. var style = kulerElement.style;
  165. style.display = kulerOn ? '' : 'none';
  166. }
  167. </script>
  168. <table style="z-index: 2;position:absolute;top:10px;right:10px;">
  169. <tr>
  170. <td onclick="toggleKuler()" id="kulerToggler"><img src='$theRoot/kuler_blog_badge.png' width=28 height=28></td>
  171. <td id="kuler" style="background:white; display:none;">
  172. <div style="border:1px solid black; border-bottom:0; padding:5px;">
  173. Query: <input id='query' type='text' name='query' onkeypress="if( event.keyCode == 13 ) { getTheme(); event.keyCode=null; return false; }">
  174. <input type="button" onclick="getTheme(); return false;" name="button" value="Search">
  175. </div>
  176. <div style="border:1px solid black; border-top:0; padding:5px;">
  177. Status:
  178. <span id="kuler_message">Ready.</span>
  179. </div>
  180. </td>
  181. </tr>
  182. </table>
  183. <% end %>
  184. <% end %>
  185. <div id="wrapper_$mySize">
  186. <%
  187. local function fixUrlIfRelative( url )
  188. url = tostring( url ) or ""
  189. if string.find( url, "[a-z]+:" ) then
  190. -- this url starts with something like http: or mailto:, so leave it alone
  191. else
  192. -- this url is probably relative, so we need to tack on theRoot to the beginning
  193. -- of it, so no matter where the page we're currently viewing is placed in the
  194. -- output hierarchy, this link will still point to the same page
  195. url = theRoot .. "/" .. url;
  196. end
  197. return url
  198. end
  199. --[[ Include the identity plate during preview to enable quick live update ]]
  200. local includeIdentityPlate = mode == 'preview' or model.appearance.logo.display
  201. if includeIdentityPlate then
  202. local url = fixUrlIfRelative( model.metadata.homePage.value )
  203. %>
  204. <div id="model.nonCSS.idplateEnabled">
  205. <div class="logo"> <a href="$url"> <img width="<%= getIdentityPlateSize().width %>" height="<%= getIdentityPlateSize().height %>" class="pngDelayDisplay" src="$others/logo.png" alt="Logo"> </a> </div>
  206. </div>
  207. <%
  208. end --[[ End conditionalize identity plate ]]
  209. %>
  210. <% --[[ Page header titles ]] %>
  211. <div id="sitetitle">
  212. <h1 onclick="clickTarget( this, 'metadata.siteTitle.value' );" id="metadata.siteTitle.value" class="textColor">$model.metadata.siteTitle.value</h1>
  213. </div>
  214. <div id="collectionHeader">
  215. <h1 onclick="clickTarget( this, 'metadata.groupTitle.value' );" id="metadata.groupTitle.value" class="textColor">$model.metadata.groupTitle.value</h1>
  216. <p onclick="clickTarget( this, 'metadata.groupDescription.value' );" id="metadata.groupDescription.value" class="textColor">$model.metadata.groupDescription.value</p>
  217. </div>
  218. <% --[[ Main grid area ]] %>
  219. <div id="stage">
  220. <div id="index">
  221. <lr:ThumbnailGrid>
  222. <%
  223. --[[ Logic for putting borders around all the grid cells ]]
  224. local borderFunc = function( row, column )
  225. local result = ''
  226. if column == columns then result = ' borderRight' end
  227. if row == rows then result = result .. ' borderBottom' end
  228. return result
  229. end
  230. %>
  231. <% --[[ The grid ]] %>
  232. <lr:GridPhotoCell>
  233. <div class="thumbnail borderTopLeft<%= borderFunc( row, column ) %>" onmouseover="window.gridOn( this.parentNode, 'ID<%= image.imageID %>_thumb' );" onmouseout="window.gridOff( this.parentNode );" onclick="window.location.href='$others/<%= image.exportFilename %>_large.html'">
  234. <div class="itemNumber">$cellIndex</div>
  235. <a href="$others/<%= image.exportFilename %>_large.html" onclick="return needThumbImgLink;">
  236. <div style="margin-left:<%= 80 - math.floor( image.renditions.thumb.width / 2 ) %>px; margin-top:<%= 80 - math.floor( image.renditions.thumb.height / 2 ) %>px;">
  237. <% if model.nonCSS.dropShadows then %>
  238. <div class="dropShadow">
  239. <div class="inner">
  240. <% end %>
  241. <img src="$others/bin/images/thumb/<%= image.exportFilename %>.jpg" id="ID<%= image.imageID %>_thumb" alt="" class="thumb" />
  242. <% if model.nonCSS.dropShadows then %>
  243. </div>
  244. </div>
  245. <% end %>
  246. </div>
  247. </a> </div>
  248. </lr:GridPhotoCell>
  249. <lr:GridEmptyCell>
  250. <div class="emptyThumbnail borderTopLeft <%= borderFunc( row, column ) %>"></div>
  251. </lr:GridEmptyCell>
  252. <lr:GridRowEnd>
  253. <div class="clear">
  254. </div>
  255. </lr:GridRowEnd>
  256. </lr:ThumbnailGrid>
  257. </div>
  258. </div>
  259. <div class="clear">
  260. </div>
  261. <% --[[ Pagination section ]] %>
  262. <% if numGridPages > 1 then %>
  263. <div class="pagination">
  264. <ul>
  265. <lr:Pagination>
  266. <lr:CurrentPage>
  267. <li class="current textColor">$page</li>
  268. </lr:CurrentPage>
  269. <lr:OtherPages>
  270. <li class="textColor"> <a href="$link">$page</a> </li>
  271. </lr:OtherPages>
  272. <lr:PreviousEnabled>
  273. <li class="previous textColor"> <a class="paginationLinks" href="$link"><%= LOC "$$$/AgWPG/Templates/HTML/output/Previous=Previous" %></a> </li>
  274. </lr:PreviousEnabled>
  275. <lr:PreviousDisabled>
  276. <li class="previous textColor"> <%= LOC "$$$/AgWPG/Templates/HTML/output/Previous=Previous" %> </li>
  277. </lr:PreviousDisabled>
  278. <lr:NextEnabled>
  279. <li class="next textColor"> <a class="paginationLinks" href="$link"><%= LOC "$$$/AgWPG/Templates/HTML/output/Next=Next" %></a> </li>
  280. </lr:NextEnabled>
  281. <lr:NextDisabled>
  282. <li class="next textColor"> <%= LOC "$$$/AgWPG/Templates/HTML/output/Next=Next" %> </li>
  283. </lr:NextDisabled>
  284. </lr:Pagination>
  285. </ul>
  286. </div>
  287. <% end %>
  288. <% --[[ Include the page footer]] %>
  289. <% --[[ Contact Info ]] %>
  290. <div id="contact">
  291. <% if mode ~= 'preview' then
  292. local url = fixUrlIfRelative( model.metadata.contactInfo.link ) %>
  293. <a href="<%= url %>"> <span
  294. <% else %>
  295. <span onclick="clickTarget( this, 'metadata.contactInfo.value' );" style="text-decoration: underline;"
  296. <% end %>
  297. class="textColor" id="metadata.contactInfo.value"><%= model.metadata.contactInfo.value %></span>
  298. <% if mode ~= 'preview' then %>
  299. </a>
  300. <% end %>
  301. </div>
  302. <div class="clear">
  303. </div>
  304. </div>
  305. </body>
  306. </html>
  1. --[[ Define some variables to make locating other resources easier
  2. firstPage was defined in our manifest.]]
  3. local others = "content"
  4. local theRoot = "."
  5. local mySize = "thumb"
  6. write( [[
  7. ]] ) --[[ Include the page header]] write( [[
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  10. <head>
  11. ]] ) --[[ HTML page metadata and stylesheets ]] write( [[
  12. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >
  13. <meta name="Keywords" content="photography,software,photos,digital darkroom,gallery,image,photographer,adobe,photoshop,lightroom" >
  14. <meta name="generator" content="Adobe Photoshop Lightroom" >
  15. <title>]] )write( model.metadata.siteTitle.value )write( [[</title>
  16. <link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="]] )write( others )write( [[/custom.css" >
  17. <link rel="stylesheet" type="text/css" media="screen" title="Custom Settings" href="]] )write( theRoot )write( [[/resources/css/master.css" >
  18. ]] ) --[[ Scripting support for rollovers and (when previewed in Lightroom) live Update, photobin syncing ]] write( [[
  19. <script type="text/javascript">
  20. window.AgMode = "]] )write( mode )write( [[";
  21. cellRolloverColor="#A1A1A1";
  22. cellColor="#949494";
  23. ]] ) if mode == 'preview' then write( [[
  24. window.AgOnLoad = function() {
  25. tellLightroomWhatImagesWeAreUsing();
  26. setActiveImageSize( "]] )write( mySize )write( [[" );
  27. ]] ) if image then write( [[
  28. callCallback( "showInPhotoBin", "]] )write( image.imageID )write( [[" );
  29. ]] ) end write( [[
  30. }
  31. ]] ) end write( [[
  32. </script>
  33. <script type="text/javascript" src="]] )write( theRoot )write( [[/resources/js/live_update.js">
  34. </script>
  35. ]] ) --[[ Special hacks for Internet Explorer ]] write( [[
  36. <!--]] .. "[" .. [[if lt IE 7.]] .. "]" .. [[> <script defer type="text/javascript" src="]] )write( theRoot )write( [[/resources/js/pngfix.js"></script> <!]] .. "[" .. [[endif]] .. "]" .. [[-->
  37. <!--]] .. "[" .. [[if gt IE 6]] .. "]" .. [[> <link rel="stylesheet" href="]] )write( theRoot )write( [[/resources/css/ie7.css"></link> <!]] .. "[" .. [[endif]] .. "]" .. [[-->
  38. <!--]] .. "[" .. [[if lt IE 7.]] .. "]" .. [[> <link rel="stylesheet" href="]] )write( theRoot )write( [[/resources/css/ie6.css"></link> <!]] .. "[" .. [[endif]] .. "]" .. [[-->
  39. </head>
  40. ]] ) --[[ The main HTML page begins here ]] write( [[
  41. <body>
  42. ]] ) --[[ experimental; get colors from kuler]] write( [[
  43. ]] ) if model.nonCSS.showKuler then write( [[
  44. ]] ) if mode == 'preview' then write( [[
  45. <script language="javascript">
  46. var coloredElements = ]] .. "[" .. [[
  47. "appearance.textColor.color",
  48. "nonCSS.cellColor",
  49. "appearance.itemNumber.color",
  50. "appearance.body.background-color",
  51. "nonCSS.thumbBorderColor",
  52. "appearance.previewFull.background-color",
  53. "nonCSS.cellRolloverColor",
  54. "nonCSS.cellBorderColor",
  55. "appearance.detailText.color",
  56. "nonCSS.largeImageBorderColor",
  57. "nonCSS.sectionBorderColor"
  58. ]] .. "]" .. [[;
  59. function hexColorCmp(aValue,bValue) {
  60. aValueSplit = str_split(aValue, 2);
  61. aValueSum = hexdec(aValueSplit]] .. "[" .. [[0]] .. "]" .. [[) + hexdec(aValueSplit]] .. "[" .. [[1]] .. "]" .. [[) + hexdec(aValueSplit]] .. "[" .. [[2]] .. "]" .. [[);
  62. bValueSplit = str_split(bValue, 2);
  63. bValueSum = hexdec(bValueSplit]] .. "[" .. [[0]] .. "]" .. [[) + hexdec(bValueSplit]] .. "[" .. [[1]] .. "]" .. [[) + hexdec(bValueSplit]] .. "[" .. [[2]] .. "]" .. [[);
  64. return aValueSum - bValueSum;
  65. }
  66. function statusMessage( html ) {
  67. document.getElementById( 'kuler_message' ).innerHTML = html;
  68. }
  69. function subStatusMessage( html ) {
  70. document.getElementById( 'kuler_detail' ).innerHTML = html;
  71. }
  72. function getURLContents ( url, callback ) {
  73. document.AgFetchResults = callback;
  74. callCallback( "fetchURL", url );
  75. }
  76. var colors = null;
  77. function parseKulerXML( xmlstring ) {
  78. // convert string to XML object
  79. var xmlobject;
  80. // Windows requires us to include namespace prefix when searching for tags
  81. // by name. Safari doesn't. And neither offers an api for searching by
  82. // tags including the namespace <grrrr />.
  83. var HACK = "";
  84. if (window.ActiveXObject) {
  85. xmlobject=new ActiveXObject("Microsoft.XMLDOM");
  86. xmlobject.async=false;
  87. xmlobject.loadXML( xmlstring );
  88. HACK="kuler:";
  89. }
  90. else {
  91. xmlobject = (new DOMParser()).parseFromString(xmlstring, "text/xml");
  92. }
  93. // get a reference to the root-element "rss"
  94. var root = xmlobject.getElementsByTagName('rss')]] .. "[" .. [[0]] .. "]" .. [[;
  95. // get reference to "channel" element
  96. var channels = root.getElementsByTagName("channel");
  97. // now get all "item" tags in the channel
  98. var items = channels]] .. "[" .. [[0]] .. "]" .. [[.getElementsByTagName("item");
  99. if( items.length == 0 ) {
  100. statusMessage( "No results found. Ready." );
  101. return;
  102. }
  103. var myInfo = "" + items.length + " match<span id='kuler_detail'></span>:<br>";
  104. colors = new Array();
  105. for( var itemIndex = 0; itemIndex < items.length; itemIndex++ ) {
  106. var hexColorArray = new Array();
  107. colors]] .. "[" .. [[ itemIndex ]] .. "]" .. [[ = hexColorArray;
  108. var item = items]] .. "[" .. [[ itemIndex ]] .. "]" .. [[;
  109. // in the "item" we have a description, so get that
  110. var themeID = item.getElementsByTagName( HACK + 'themeID' )]] .. "[" .. [[0]] .. "]" .. [[.firstChild.nodeValue;
  111. // we also get the "pubDate" element in the "item"
  112. var title = item.getElementsByTagName( 'title' )]] .. "[" .. [[0]] .. "]" .. [[.firstChild.nodeValue;
  113. var themeSwatches = item.getElementsByTagName( HACK + 'themeSwatches' )]] .. "[" .. [[ 0 ]] .. "]" .. [[;
  114. var swatches = themeSwatches.getElementsByTagName( HACK + 'swatch' );
  115. myInfo = myInfo + "<div style='margin:5px' onclick='applySwatch( " + itemIndex + " );'>";
  116. for( var swatchIndex = 0; swatchIndex < swatches.length; swatchIndex++ ) {
  117. var swatch = swatches]] .. "[" .. [[ swatchIndex ]] .. "]" .. [[;
  118. var hexColor = swatch.getElementsByTagName( HACK + 'swatchHexColor' )]] .. "[" .. [[ 0 ]] .. "]" .. [[.firstChild.nodeValue;
  119. myInfo = myInfo + "<span style='width:5px; background:#" + hexColor + ";'> </span>";
  120. hexColorArray]] .. "[" .. [[ swatchIndex ]] .. "]" .. [[ = hexColor;
  121. }
  122. myInfo = myInfo + "\n";
  123. myInfo = myInfo + title + ": " + themeID + "</div>";
  124. }
  125. statusMessage(myInfo);
  126. }
  127. function applySwatch( index ) {
  128. subStatusMessage("<B>Applying swatch</B>")
  129. // use a delay, so the web view will actually display the above message before
  130. // starting this work, which may take a moment to complete.
  131. setTimeout("applySwatch0( " + index + " )", 10 );
  132. }
  133. var seed = 0;
  134. function applySwatch0( index ) {
  135. document.LR_modelManipulation = true;
  136. var swatches = colors]] .. "[" .. [[ index ]] .. "]" .. [[;
  137. if( swatches == null ) {
  138. return;
  139. }
  140. for( var index = 0; index<coloredElements.length; index++ ) {
  141. var theColor = coloredElements]] .. "[" .. [[ index ]] .. "]" .. [[;
  142. var swatchIndex = ( seed + index ) % swatches.length;
  143. if( theColor == null ) {
  144. break;
  145. }
  146. var hexColor = swatches]] .. "[" .. [[ swatchIndex ]] .. "]" .. [[;
  147. callCallback( "updateModel", theColor, '#' + hexColor );
  148. }
  149. seed = seed + 1;
  150. document.LR_modelManipulation = false;
  151. subStatusMessage("")
  152. }
  153. function getTheme() {
  154. var query = document.getElementById( 'query' ).value;
  155. kulerURL = 'http://kuler.adobe.com/kuler/API/rss/search.cfm?searchQuery=' + query + '&startIndex=0&itemsPerPage=10'
  156. statusMessage( "Searching..." );
  157. getURLContents( kulerURL, parseKulerXML )
  158. }
  159. var kulerOn = false;
  160. function toggleKuler() {
  161. kulerOn = !kulerOn;
  162. var kulerElement = document.getElementById('kuler');
  163. var style = kulerElement.style;
  164. style.display = kulerOn ? '' : 'none';
  165. }
  166. </script>
  167. <table style="z-index: 2;position:absolute;top:10px;right:10px;">
  168. <tr>
  169. <td onclick="toggleKuler()" id="kulerToggler"><img src=']] )write( theRoot )write( [[/kuler_blog_badge.png' width=28 height=28></td>
  170. <td id="kuler" style="background:white; display:none;">
  171. <div style="border:1px solid black; border-bottom:0; padding:5px;">
  172. Query: <input id='query' type='text' name='query' onkeypress="if( event.keyCode == 13 ) { getTheme(); event.keyCode=null; return false; }">
  173. <input type="button" onclick="getTheme(); return false;" name="button" value="Search">
  174. </div>
  175. <div style="border:1px solid black; border-top:0; padding:5px;">
  176. Status:
  177. <span id="kuler_message">Ready.</span>
  178. </div>
  179. </td>
  180. </tr>
  181. </table>
  182. ]] ) end write( [[
  183. ]] ) end write( [[
  184. <div id="wrapper_]] )write( mySize )write( [[">
  185. ]] )
  186. local function fixUrlIfRelative( url )
  187. url = tostring( url ) or ""
  188. if string.find( url, "[a-z]+:" ) then
  189. -- this url starts with something like http: or mailto:, so leave it alone
  190. else
  191. -- this url is probably relative, so we need to tack on theRoot to the beginning
  192. -- of it, so no matter where the page we're currently viewing is placed in the
  193. -- output hierarchy, this link will still point to the same page
  194. url = theRoot .. "/" .. url;
  195. end
  196. return url
  197. end
  198. --[[ Include the identity plate during preview to enable quick live update ]]
  199. local includeIdentityPlate = mode == 'preview' or model.appearance.logo.display
  200. if includeIdentityPlate then
  201. local url = fixUrlIfRelative( model.metadata.homePage.value )
  202. write( [[
  203. <div id="model.nonCSS.idplateEnabled">
  204. <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>
  205. </div>
  206. ]] )
  207. end --[[ End conditionalize identity plate ]]
  208. write( [[
  209. ]] ) --[[ Page header titles ]] write( [[
  210. <div id="sitetitle">
  211. <h1 onclick="clickTarget( this, 'metadata.siteTitle.value' );" id="metadata.siteTitle.value" class="textColor">]] )write( model.metadata.siteTitle.value )write( [[</h1>
  212. </div>
  213. <div id="collectionHeader">
  214. <h1 onclick="clickTarget( this, 'metadata.groupTitle.value' );" id="metadata.groupTitle.value" class="textColor">]] )write( model.metadata.groupTitle.value )write( [[</h1>
  215. <p onclick="clickTarget( this, 'metadata.groupDescription.value' );" id="metadata.groupDescription.value" class="textColor">]] )write( model.metadata.groupDescription.value )write( [[</p>
  216. </div>
  217. ]] ) --[[ Main grid area ]] write( [[
  218. <div id="stage">
  219. <div id="index">
  220. ]] )do write( [[
  221. ]] )
  222. --[[ Logic for putting borders around all the grid cells ]]
  223. local borderFunc = function( row, column )
  224. local result = ''
  225. if column == columns then result = ' borderRight' end
  226. if row == rows then result = result .. ' borderBottom' end
  227. return result
  228. end
  229. write( [[
  230. ]] ) --[[ The grid ]] write( [[
  231. ]] )local GridPhotoCellFunc = function( cellIndex, row, column, image ) write( [[
  232. <div class="thumbnail borderTopLeft]] )write( borderFunc( row, column ) )write( [[" onmouseover="window.gridOn( this.parentNode, 'ID]] )write( image.imageID )write( [[_thumb' );" onmouseout="window.gridOff( this.parentNode );" onclick="window.location.href=']] )write( others )write( [[/]] )write( image.exportFilename )write( [[_large.html'">
  233. <div class="itemNumber">]] )write( cellIndex )write( [[</div>
  234. <a href="]] )write( others )write( [[/]] )write( image.exportFilename )write( [[_large.html" onclick="return needThumbImgLink;">
  235. <div style="margin-left:]] )write( 80 - math.floor( image.renditions.thumb.width / 2 ) )write( [[px; margin-top:]] )write( 80 - math.floor( image.renditions.thumb.height / 2 ) )write( [[px;">
  236. ]] ) if model.nonCSS.dropShadows then write( [[
  237. <div class="dropShadow">
  238. <div class="inner">
  239. ]] ) end write( [[
  240. <img src="]] )write( others )write( [[/bin/images/thumb/]] )write( image.exportFilename )write( [[.jpg" id="ID]] )write( image.imageID )write( [[_thumb" alt="" class="thumb" />
  241. ]] ) if model.nonCSS.dropShadows then write( [[
  242. </div>
  243. </div>
  244. ]] ) end write( [[
  245. </div>
  246. </a> </div>
  247. ]] )end write( [[
  248. ]] )local GridEmptyCellFunc = function( cellIndex, row, column ) write( [[
  249. <div class="emptyThumbnail borderTopLeft ]] )write( borderFunc( row, column ) )write( [["></div>
  250. ]] )end write( [[
  251. ]] )local GridRowEndFunc = function( row ) write( [[
  252. <div class="clear">
  253. </div>
  254. ]] )end write( [[
  255. ]] )LrTagFuncs.ThumbnailGridFunc( _G, GridPhotoCellFunc, GridEmptyCellFunc, GridRowStartFunc, GridRowEndFunc ) end write( [[
  256. </div>
  257. </div>
  258. <div class="clear">
  259. </div>
  260. ]] ) --[[ Pagination section ]] write( [[
  261. ]] ) if numGridPages > 1 then write( [[
  262. <div class="pagination">
  263. <ul>
  264. ]] ) do local LrPaginationEntries = {}
  265. local oldWrite = write
  266. write = function( w )
  267. table.insert( LrPaginationEntries, function() oldWrite( w ) end )
  268. end
  269. write( [[
  270. ]] )LrPaginationEntries.CurrentPage = function( page ) write( [[
  271. <li class="current textColor">]] )write( page )write( [[</li>
  272. ]] )end table.insert( LrPaginationEntries, 'PageNumbers' ) write( [[
  273. ]] )LrPaginationEntries.OtherPages = function( page, link ) write( [[
  274. <li class="textColor"> <a href="]] )write( link )write( [[">]] )write( page )write( [[</a> </li>
  275. ]] )end write( [[
  276. ]] )LrPaginationEntries.PreviousEnabled = function( page, link ) write( [[
  277. <li class="previous textColor"> <a class="paginationLinks" href="]] )write( link )write( [[">]] )write( LOC "$$$/AgWPG/Templates/HTML/output/Previous=Previous" )write( [[</a> </li>
  278. ]] )end table.insert( LrPaginationEntries, 'Previous' ) write( [[
  279. ]] )LrPaginationEntries.PreviousDisabled = function( ) write( [[
  280. <li class="previous textColor"> ]] )write( LOC "$$$/AgWPG/Templates/HTML/output/Previous=Previous" )write( [[ </li>
  281. ]] )end write( [[
  282. ]] )LrPaginationEntries.NextEnabled = function( page, link ) write( [[
  283. <li class="next textColor"> <a class="paginationLinks" href="]] )write( link )write( [[">]] )write( LOC "$$$/AgWPG/Templates/HTML/output/Next=Next" )write( [[</a> </li>
  284. ]] )end table.insert( LrPaginationEntries, 'Next' ) write( [[
  285. ]] )LrPaginationEntries.NextDisabled = function( ) write( [[
  286. <li class="next textColor"> ]] )write( LOC "$$$/AgWPG/Templates/HTML/output/Next=Next" )write( [[ </li>
  287. ]] )end write( [[
  288. ]] )write = oldWrite LrTagFuncs.PaginationFunc( _G, LrPaginationEntries ) end write( [[
  289. </ul>
  290. </div>
  291. ]] ) end write( [[
  292. ]] ) --[[ Include the page footer]] write( [[
  293. ]] ) --[[ Contact Info ]] write( [[
  294. <div id="contact">
  295. ]] ) if mode ~= 'preview' then
  296. local url = fixUrlIfRelative( model.metadata.contactInfo.link ) write( [[
  297. <a href="]] )write( url )write( [["> <span
  298. ]] ) else write( [[
  299. <span onclick="clickTarget( this, 'metadata.contactInfo.value' );" style="text-decoration: underline;"
  300. ]] ) end write( [[
  301. class="textColor" id="metadata.contactInfo.value">]] )write( model.metadata.contactInfo.value )write( [[</span>
  302. ]] ) if mode ~= 'preview' then write( [[
  303. </a>
  304. ]] ) end write( [[
  305. </div>
  306. <div class="clear">
  307. </div>
  308. </div>
  309. </body>
  310. </html>
  311. ]] )