%@ include file="noexport.html" %> <%<%@ include file="setup.lua" %>%> <% 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, "FilmstripWSPP.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 %> <% --[[ grid.html This file displays a thumbnail grid of the images with dimensions specified in the galleryInfo.lrweb file. Define some variables to make locating other resources easier.]] 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 -- Remove the background image if needed if styles.body and model.nonCSS.backgroundImage.notOnGalleries then styles.body["background-image"] = "none" end if not model.nonCSS.gallery.showNavBar then styles["#menuwrapper"] = { display = "none" } end -- If the branding image is used, don't scroll it. styles["#brandingwrapper"] = { position = "fixed !important;" } -- Set up the description opacity here (so that it's not !important, so that MooTools cna change it) styles[".description"] = { opacity = "" .. model.nonCSS.gallery.descriptionOpacity / 100, filter = "alpha(opacity=" .. model.nonCSS.gallery.descriptionOpacity .. ")" } -- This engine allows the user to choose the galleries page as the home page. In this case the filename will be "index.html", but -- the publication service won't have known this... parentLink = parentLink or "galleries.html" if model.nonCSS.startPage == "galleries" and mode == "publishAsSubGallery" then parentLink = parentLink:gsub("galleries", "index") end local backURL = parentLink -- Redirect the write command for a little while... local mySize = "medium" 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 } typeOfPageBeingEdited = "galleryPage" 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 %> <%@ include file="menu.html" %>