<%@ 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 modelLocationContentID = "nonCSS.galleryPage.content" -- The Page Content for sub galleries is passed through by the plugin if not pageContent then pageContent = "" end -- For the top level index page, we use the model's text if (not hierarchy or #hierarchy == 0) and model.nonCSS.indexBlurb then pageContent = model.nonCSS.galleryPage.content end -- Write out the header if not galleryDetails then galleryDetails = {} end local title = galleryDetails.title or "Example gallery" -- For the top level index page, we use the model's text if (not hierarchy or #hierarchy == 0) then title = model.nonCSS.galleryPage.title end local options = { title = title, description = galleryDetails.description or "Example description", styles = styles } typeOfPageBeingEdited = "galleriesPage" %> <%@ include file="header.html" %>
"> <% if model.nonCSS.brandingImage.galleryPage and (model.nonCSS.brandingImage.position == "pageleft" or model.nonCSS.brandingImage.position == "pagecenter" or model.nonCSS.brandingImage.position == "pageright") then %> <%@ include file="branding.html" %> <% end %> <%@ include file="menu.html" %>
<% if model.nonCSS.brandingImage.galleryPage and (model.nonCSS.brandingImage.position == "copyleft" or model.nonCSS.brandingImage.position == "copycenter" or model.nonCSS.brandingImage.position == "copyright") then %> <%@ include file="branding.html" %> <% end %> <% if model.nonCSS.contentBox.enable and (model.nonCSS.indexBlurb or #pageContent > 0) then %>
<% end %> <% if model.nonCSS.breadcrumbbar.enabled and hierarchy and #hierarchy > 0 and not hierarchy[#hierarchy].hideGallery then local html = "" hierarchy[0] = { name = model.nonCSS.breadcrumbbar.home } for index = 0, #hierarchy - 1 do if not hierarchy[index].inaccessible then local href = string.rep("../", #hierarchy - index) if (index == 0 and model.nonCSS.startPage == "home") or mode == "preview" then href = href .. "galleries.html" else if hierarchy[index].isProtected then href = href .. "index.php" else href = href .. "index.html" end end html = html .. ''.. hierarchy[index].name ..' '.. model.nonCSS.breadcrumbbar.separator ..' ' end if hierarchy[index].hideGallery then html = "" end end if #html > 0 then write('') end end %> <% if #pageContent > 0 then %>
onclick="clickTarget(this, '<%= modelLocationContentID %>');"<% end %> id="<%= modelLocationContentID %>"><% write (markdown(pageContent)) %>
<% end %> <% if model.nonCSS.contentBox.enable and (model.nonCSS.indexBlurb or #pageContent > 0) then %>
<% end %>
<% -- Output each image in the array for i = 1, numImages do local image = getImage(i) local galleryIndex local galleryURLPrefix = "" local imageURLPrefix = "" local galleryType = "gallery" local hideImage = image.pt_noPhotoAvailable local galleryDescription = [[ ### An example gallery This is an gallery description, you'll enter yours when you ceate a new gallery via the _Publishing service_. You can use Markdown text here too. ]] local gallerySetDescription = [[ ### An example gallery set This is an example of a gallery set. Click the image to see a gallery index with a breadcrumb bar. ]] local galleryGridDescription = [[ ### The Contact Sheet View This will take you to a gallery that's being displayed in contact sheet mode. This view is useful for client galleries, and you can choose to use this view on a per gallery basis. ]] local galleryPasswordDescription = [[ ### A protected gallery This is an example of a password protected gallery. Click to see the password form. ]] -- Override values from publish plugin if image.pt_galleryURLPrefix then galleryURLPrefix = image.pt_galleryURLPrefix end if image.pt_imageURLPrefix then imageURLPrefix = image.pt_imageURLPrefix end if mode == "publishAsSubGallery" then if image.pt_isProtected then galleryIndex = galleryURLPrefix .. "index.php" else galleryIndex = galleryURLPrefix .. "index.html" end elseif mode == "preview" and i % 4 == 2 then galleryIndex = "gallerySetExample.html" galleryDescription = gallerySetDescription galleryType = "set" elseif mode == "preview" and i % 4 == 3 then galleryIndex = "gridExample.html" galleryDescription = galleryGridDescription elseif mode == "preview" and i % 4 == 0 then galleryIndex = "password.html" hideImage = true galleryDescription = galleryPasswordDescription else galleryIndex = "gindex.html" end -- Override values from publish plugin if image.pt_galleryDescription then galleryDescription = image.pt_galleryDescription end if image.pt_galleryType then galleryType = image.pt_galleryType end if galleryType == "gallery" then galleryType = "albumGalleryBox" else galleryType = "albumSetBox" end if i % model.nonCSS.indexColumns == 0 then galleryType = galleryType .. " albumBoxRHS" else galleryType = galleryType .. " albumBoxNormal" end %>
<% if not hideImage then %>
.jpg" width="<%= image.renditions['thumb'].width %>" height="<%= image.renditions['thumb'].height %>">
<% end %>
style="position: static !important"<% end %>><%= markdown(galleryDescription) %>
<% end %>
<% --[[ Include the page footer]] %> <%@ include file="footer.html" %>