<%@ include file="noexport.html" %> <% LrFunctionContext = import 'LrFunctionContext' LrPathUtils = import 'LrPathUtils' LrFileUtils = import 'LrFileUtils' if WIN_ENV then webGalleriesFolder = LrPathUtils.child(LrPathUtils.getStandardFilePath("appData"), "Web Galleries") else webGalleriesFolder = LrPathUtils.child(LrPathUtils.getStandardFilePath("home"), "Library/Application Support/Adobe/Lightroom/Web Galleries/") end local mdenvPath = LrPathUtils.child(LrPathUtils.child(webGalleriesFolder, "ImpactWSPP.lrwebengine"), "mdenv.lua") local luaString = LrFileUtils.readFile(mdenvPath) local func, errorMsg = loadstring(luaString, 'mdenv.lua' ) local env = { assert = assert, ipairs = ipairs, dofile = dofile, error = error, getmetatable = getmetatable, ipairs = ipairs, load = load, loadfile = loadfile, loadstring = loadstring, next = next, pairs = pairs, pcall = pcall, print = print, rawequal = rawequal, rawget = rawget, rawset = rawset, require = require, select = select, setmetatable = function() end, tonumber = tonumber, tostring = tostring, type = type, unpack = unpack, setenv = function() end, import = import, io = io, os = os, file = file, table = table, math = math, string = string, WIN_ENV = WIN_ENV, webGalleriesFolder = webGalleriesFolder } LrFunctionContext.callWithEnvironment(func, env) markdown = env._G.markdown %> <%<%@ include file="setup.lua" %>%> <% local mySize = "large" local resolution = ""; if (model.nonCSS.images_large.export) then resolution = "max" end if (model.nonCSS.images_medium.export and resolution == "") then resolution = "medium" end if (model.nonCSS.images_small and resolution == "") then resolution = "small" end local folder = "photos_" .. resolution -- Replace fixed tokens in the click URL path = "/" .. galleryURLPrefix:gsub("^%./", "") clickURL = model.nonCSS.clickURL:gsub("{path}", path) -- Remove the background image if needed if styles.body and model.nonCSS.backgroundImage.notOnGalleries then styles.body["background-image"] = "none" end -- Redirect the write command for a little while... local extra = "" local oldWrite = write local write = function(t) extra = extra .. tostring(t) end -- The following will be appended to "extra" %> <% write = oldWrite -- Write out the header -- -- We grab the gallery details from the publishing service if we have them... if not galleryDetails then galleryDetails = {} end options = { title = galleryDetails.title or "Example gallery", description = galleryDetails.description or "Example description", keywords = galleryDetails.keywords or "Example keywords", extra = extra, styles = styles } function encode_alt(s) if not s then return s end s = s:gsub('&', '&') s = s:gsub('"', '"') s = s:gsub('<', '<') s = s:gsub('>', '>') return s end %> <%@ include file="header.html" %> <% if model.nonCSS.brandingImage.onGallery and (model.nonCSS.brandingImage.position == "pageleft" or model.nonCSS.brandingImage.position == "pagecenter" or model.nonCSS.brandingImage.position == "pageright") then %> <%@ include file="branding.html" %> <% end %> <% local loadingdots='
' local n for n = 1, model.nonCSS.loadingdots.number do loadingdots = loadingdots .. "·" end loadingdots = loadingdots .. "
" %>
<% image = getImage(index) if model.nonCSS.fittingType == "width" then fitClass = "fithorizontal" elseif model.nonCSS.fittingType == "height" then fitClass = "fitvertical" else -- We scale based on the orientation of the photo. -- -- To do that we need to find a resolution that was actually exported... if model.nonCSS.images_large.export then width = image.renditions.large.width height = image.renditions.large.height elseif model.nonCSS.images_medium.export then width = image.renditions.medium.width height = image.renditions.medium.height else width = image.renditions.small.width height = image.renditions.small.height end if width > height then fitClass = "fithorizontal" else fitClass = "fitvertical" end end local desc = '
' if image.metadata.description and #image.metadata.description > 0 then someInfo = true desc = desc .. '
' .. markdown(image.metadata.description) .. '
' end desc = desc .. '
' %>
$desc
.jpg" alt="<%= encode_alt(image.metadata.seoAltText) %>">
<%@ include file="menu.html" %> <% ext = ".html" if isProtected then ext = ".php" end %> <% if model.nonCSS.controlsEnabled then %>
<% if page > 2 then write('') end %>
">▲
<% end %> <% if model.nonCSS.dots.enabled then %>
<% for d = 1, numImages do %> <% if d == 1 then write('class="first"') end %> href="<%= getImage(d).exportFilename .. ext %>"><% if model.nonCSS.dots.type == "squares" then write("" .. d) else write ('·') end%><% end %>
<% end %> <% img = '' i = index + 1 if i > numImages then i = 1 end if model.nonCSS.clickBehaviour == "advance" then img = '' .. img .. '' elseif model.nonCSS.clickBehaviour == "url" then img = '' .. img .. '' end %>
<%= img %>
<% --[[ Include the page footer]] %> <%@ include file="footer.html" %>