https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AGAN_link
Module:GAN link - Revision history
2025-05-30T02:53:03Z
Revision history for this page on the wiki
MediaWiki 1.45.0-wmf.3
https://en.wikipedia.org/w/index.php?title=Module:GAN_link&diff=755085174&oldid=prev
Mr. Stradivarius: fix error message for bad nomination page titles
2016-12-16T03:47:35Z
<p>fix error message for bad nomination page titles</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 03:47, 16 December 2016</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 53:</td>
<td colspan="2" class="diff-lineno">Line 53:</td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local title = mw.title.new(nominationPage)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> local title = mw.title.new(nominationPage)</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not title then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not title then</div></td>
</tr>
<tr>
<td class="diff-marker" data-marker="−"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> error(string.format('%s is not a valid title'), 2)</div></td>
<td class="diff-marker" data-marker="+"></td>
<td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> error(string.format('%s is not a valid title'<ins style="font-weight: bold; text-decoration: none;">, nominationPage</ins>), 2)</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> elseif title.exists then</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> elseif title.exists then</div></td>
</tr>
<tr>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return makeExistingNominationLink(nominationPage)</div></td>
<td class="diff-marker"></td>
<td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> return makeExistingNominationLink(nominationPage)</div></td>
</tr>
</table>
Mr. Stradivarius
https://en.wikipedia.org/w/index.php?title=Module:GAN_link&diff=755079005&oldid=prev
Mr. Stradivarius: Protected "Module:GAN link": High-risk Lua module ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))
2016-12-16T02:53:00Z
<p>Protected "<a href="/wiki/Module:GAN_link" title="Module:GAN link">Module:GAN link</a>": <a href="/wiki/Wikipedia:High-risk_templates" title="Wikipedia:High-risk templates">High-risk Lua module</a> ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 02:53, 16 December 2016</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>
Mr. Stradivarius
https://en.wikipedia.org/w/index.php?title=Module:GAN_link&diff=754926749&oldid=prev
Mr. Stradivarius: make a replacement for Template:GAN link
2016-12-15T07:41:14Z
<p>make a replacement for <a href="/wiki/Template:GAN_link" title="Template:GAN link">Template:GAN link</a></p>
<p><b>New page</b></p><div>-- This module implements {{GAN link}}.<br />
<br />
local p = {}<br />
<br />
local function getGANIcon()<br />
return require('Module:Icon')._main{'GAN'}<br />
end<br />
<br />
local function makeWikilink(page, display)<br />
if display and display ~= page then<br />
return string.format('[[%s|%s]]', page, display)<br />
else<br />
return string.format('[[%s]]', page)<br />
end<br />
end<br />
<br />
local function getNominationPage(article, number)<br />
return string.format('Talk:%s/GA%d', article, number)<br />
end<br />
<br />
local function makeArticleLink(options)<br />
assert(options.article, 'options.article not specified')<br />
assert(options.formattedArticle, 'options.formattedArticle not specified')<br />
local display<br />
if options.isItalic then<br />
display = string.format('<i>%s</i>', options.article)<br />
elseif options.display then<br />
display = options.display<br />
else<br />
display = options.formattedArticle<br />
end<br />
return makeWikilink(options.article, display)<br />
end<br />
<br />
local function makeExistingNominationLink(nominationPage)<br />
return makeWikilink(nominationPage, 'nom')<br />
end<br />
<br />
local function makeNewNominationLink(nominationPage)<br />
local url = mw.uri.fullUrl(nominationPage, {<br />
action = 'edit',<br />
editintro = 'Template:GAN/editintro',<br />
preload = 'Template:GAN/preload',<br />
})<br />
return string.format(<br />
"'''<span class='plainlinks'>[%s start]</span>'''",<br />
tostring(url)<br />
)<br />
end<br />
<br />
local function makeNominationLink(nominationPage)<br />
assert(nominationPage, 'no nominationPage argument given to makeNominationLink')<br />
local title = mw.title.new(nominationPage)<br />
if not title then<br />
error(string.format('%s is not a valid title'), 2)<br />
elseif title.exists then<br />
return makeExistingNominationLink(nominationPage)<br />
else<br />
return makeNewNominationLink(nominationPage)<br />
end<br />
end<br />
<br />
function p._main(args)<br />
-- Link parameters<br />
local formattedArticle = args[1]<br />
if not formattedArticle then<br />
error('No article specified', 2)<br />
end<br />
local article = formattedArticle:gsub("'''", ""):gsub("''", "")<br />
local display = args[2]<br />
<br />
-- Number<br />
local number<br />
if args['#'] then<br />
number = tonumber(args['#'])<br />
if not number then<br />
error("'%s' is not a valid number", args['#'])<br />
end<br />
else<br />
number = 1<br />
end<br />
<br />
-- Formatting parameters<br />
local hasIcon = not not args.icon<br />
local isItalic = not not args.i<br />
<br />
-- Output<br />
local ret = {}<br />
if hasIcon then<br />
ret[#ret + 1] = getGANIcon()<br />
end<br />
ret[#ret + 1] = makeArticleLink{<br />
article = article,<br />
formattedArticle = formattedArticle,<br />
display = display,<br />
isItalic = isItalic,<br />
}<br />
ret[#ret + 1] = string.format(<br />
'(%s)',<br />
makeNominationLink(getNominationPage(article, number))<br />
)<br />
return table.concat(ret, ' ')<br />
end<br />
<br />
function p.main(frame)<br />
local args = require('Module:Arguments').getArgs(frame, {<br />
wrappers = 'Template:GAN link'<br />
})<br />
return p._main(args)<br />
end<br />
<br />
return p</div>
Mr. Stradivarius