Jump to content

Module:Documentation: Difference between revisions

move diff link to the env table
m>Mr. Stradivarius
(p.makeStartBoxLinksData - fix title objects that weren't being passed through)
m>Mr. Stradivarius
(move diff link to the env table)
Line 273: Line 273:
return mw.title.new(env.templatePage .. '/' .. message('printSubpage', 'string'))
return mw.title.new(env.templatePage .. '/' .. message('printSubpage', 'string'))
end
end
function envFuncs.compareLink()
-- Diff link between the sandbox and the main template using [[Special:ComparePages]].
local templateTitle = env.templateTitle
local sandboxTitle = env.sandboxTitle
local compareUrl = mw.uri.fullUrl(
'Special:ComparePages',
{page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
)
compareUrl = tostring(compareUrl)
local compareDisplay = message('compareLinkDisplay', 'string')
return makeUrlLink(compareUrl, compareDisplay)
end


return env
return env
Line 669: Line 682:
local sandboxEditDisplay = message('sandboxEditLinkDisplay', 'string')
local sandboxEditDisplay = message('sandboxEditLinkDisplay', 'string')
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
local compareUrl = mw.uri.fullUrl('Special:ComparePages', {page1 = templateTitle.prefixedText, page2 = sandboxPage})
local compareLink = env.compareLink
compareUrl = tostring(compareUrl)
local compareDisplay = message('compareLinkDisplay', 'string')
local compareLink = makeUrlLink(compareUrl, compareDisplay)
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
else
else
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.