https://nordiclarp.org/w/index.php?title=Module:Purge&feed=atom&action=historyModule:Purge - Revision history2024-03-28T21:20:49ZRevision history for this page on the wikiMediaWiki 1.34.2https://nordiclarp.org/w/index.php?title=Module:Purge&diff=7412&oldid=prevJohannes Axner: 1 revision imported2018-12-29T01:11:55Z<p>1 revision imported</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #222; text-align: center;">Revision as of 01:11, 29 December 2018</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Johannes Axnerhttps://nordiclarp.org/w/index.php?title=Module:Purge&diff=7411&oldid=preven>Dinoguy1000: from the sandbox: if the pagename is specified, don't add the title text or its span2017-11-13T16:20:48Z<p>from the sandbox: if the pagename is specified, don't add the title text or its span</p>
<p><b>New page</b></p><div>-- This module implements [[Template:Purge]].<br />
<br />
local p = {}<br />
<br />
local function makeUrlLink(url, display)<br />
return string.format('[%s %s]', url, display)<br />
end<br />
<br />
function p._main(args)<br />
-- Make the URL<br />
local url<br />
do<br />
local title<br />
if args.page then<br />
title = mw.title.new(args.page)<br />
if not title then<br />
error(string.format(<br />
"'%s' is not a valid page name",<br />
args.page<br />
), 2)<br />
end<br />
else<br />
title = mw.title.getCurrentTitle()<br />
end<br />
if args.anchor then<br />
title.fragment = args.anchor<br />
end<br />
url = title:fullUrl{action = 'purge'}<br />
end<br />
<br />
-- Make the display<br />
local display<br />
if args.page then<br />
display = args[1] or 'Purge'<br />
else<br />
display = mw.html.create('span')<br />
display<br />
:attr('title', 'Purge this page')<br />
:wikitext(args[1] or 'Purge')<br />
display = tostring(display)<br />
end<br />
<br />
-- Output the HTML<br />
local root = mw.html.create('span')<br />
root<br />
:addClass('noprint')<br />
:addClass('plainlinks')<br />
:addClass('purgelink')<br />
:wikitext(makeUrlLink(url, display))<br />
<br />
return tostring(root)<br />
end<br />
<br />
function p.main(frame)<br />
local args = frame:getParent().args<br />
return p._main(args)<br />
end<br />
<br />
return p</div>en>Dinoguy1000