


%@ 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" local pageContent = model.nonCSS.galleryPage.content -- 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 -- 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 if not galleryDetails then galleryDetails = {} end local options = { title = galleryDetails.title or "Example gallery", description = galleryDetails.description or "Example description", styles = styles, extra = extra } typeOfPageBeingEdited = "contactSheetPage" function urlEncode(s) s = string.gsub(s, "([&=+%c])", function (c) return string.format("%%%02X", string.byte(c)) end) s = string.gsub(s, " ", "+") return s end function encode_html(s) if not s then return s end s = s:gsub('&', '&') s = s:gsub('"', '"') s = s:gsub('<', '<') s = s:gsub('>', '>') return s end function round(num, idp) local mult = 10^(idp or 0) return math.floor(num * mult + 0.5) / mult end function dms2s(d, m, s) return round(d + m / 60 + s / 3600, 6) end function googleURLs(metadata) if not metadata.gps then return end local latlong if metadata.WSPP_GPSLatitude then -- WSPP provides accurate raws GPS data, use that if we can latlong = "" .. metadata.WSPP_GPSLatitude .. "," .. metadata.WSPP_GPSLongitude else -- In the web module we have to live with parsing the rounded off form local dn, mn, sn, ns, de, me, se, ew = metadata.gps:match("^(%d+)%D+(%d+)%D([%d\.]+)%D%s*(%u)%s+(%d+)%D+(%d+)%D([%d\.]+)%D+%s*(%u)$") if dn then if ns == "S" then dn = -dn end if ew == "W" then de = -de end latlong = dms2s(dn, mn, sn) .. "," .. dms2s(de, me, se) end end if latlong then local imageUrl = "http://maps.google.com/maps/api/staticmap?center=" .. latlong imageUrl = imageUrl .. "&markers=color:green|label:%20|" .. latlong imageUrl = imageUrl .. "&maptype=hybrid&zoom=10&size=640x640&sensor=false" local mapsUrl = "http://maps.google.com/maps?f=q&q=" .. latlong mapsUrl = mapsUrl .. "&ll=" .. latlong mapsUrl = mapsUrl .. "&t=h&iwloc=near&;z=10" return imageUrl, mapsUrl end end function escape(str) str = str:gsub('"', '"') str = str:gsub("'", "\\'") return str end %> <%@ include file="header.html" %>
<% --[[ Include the page footer]] %> <%@ include file="footer.html" %>