https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3ADomain_handler%2Fsandbox
Module:Domain handler/sandbox - Revision history
2025-05-31T08:02:55Z
Revision history for this page on the wiki
MediaWiki 1.45.0-wmf.3
https://en.wikipedia.org/w/index.php?title=Module:Domain_handler/sandbox&diff=1284921794&oldid=prev
Xoontor at 15:36, 10 April 2025
2025-04-10T15:36:14Z
<p></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 15:36, 10 April 2025</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Line 25:</td>
<td colspan="2" class="diff-lineno">Line 25:</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;"><br /></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;"><br /></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 topLevelDomain 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 topLevelDomain 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> topLevelDomain = topLevelDomain</div></td>
<td colspan="2" class="diff-empty diff-side-added"></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 category = "Category:Redirects from " .. topLevelDomain ..</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 category = "Category:Redirects from " .. topLevelDomain ..</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> (context == "domains" and " domain names" or " URLs")</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> (context == "domains" and " domain names" or " URLs")</div></td>
</tr>
</table>
Xoontor
https://en.wikipedia.org/w/index.php?title=Module:Domain_handler/sandbox&diff=1281247626&oldid=prev
Xoontor: ←Created page with 'local p = {} function p.getTopLevelDomain(frame) local args = frame.args local domain = args.domain or args[1] local context = args.context or "domains" if domain and domain ~= "" then domain = mw.text.trim(domain):lower() domain = "." .. domain:gsub("^%.", "") local category = "Category:Redirects from " .. domain .. (context == "domains" and " domain names" or " URLs") if mw.title...'
2025-03-19T06:05:10Z
<p><a href="/wiki/Wikipedia:AES" class="mw-redirect" title="Wikipedia:AES">←</a>Created page with 'local p = {} function p.getTopLevelDomain(frame) local args = frame.args local domain = args.domain or args[1] local context = args.context or "domains" if domain and domain ~= "" then domain = mw.text.trim(domain):lower() domain = "." .. domain:gsub("^%.", "") local category = "Category:Redirects from " .. domain .. (context == "domains" and " domain names" or " URLs") if mw.title...'</p>
<p><b>New page</b></p><div>local p = {}<br />
<br />
function p.getTopLevelDomain(frame)<br />
local args = frame.args<br />
local domain = args.domain or args[1]<br />
local context = args.context or "domains"<br />
<br />
if domain and domain ~= "" then<br />
domain = mw.text.trim(domain):lower()<br />
domain = "." .. domain:gsub("^%.", "")<br />
<br />
local category = "Category:Redirects from " .. domain ..<br />
(context == "domains" and " domain names" or " URLs")<br />
<br />
if mw.title.new(category).exists then<br />
return " " .. domain<br />
end<br />
end<br />
<br />
local currentTitle = mw.title.getCurrentTitle().text<br />
currentTitle = currentTitle:lower():gsub("^https?://", "")<br />
currentTitle = currentTitle:match("^([^/]+)") or currentTitle<br />
<br />
local topLevelDomain = currentTitle:match("(%.[^.]+)$")<br />
<br />
if topLevelDomain then<br />
topLevelDomain = topLevelDomain<br />
local category = "Category:Redirects from " .. topLevelDomain ..<br />
(context == "domains" and " domain names" or " URLs")<br />
<br />
if mw.title.new(category).exists then<br />
return " " .. topLevelDomain<br />
end<br />
end<br />
<br />
return ""<br />
end<br />
<br />
function p.adjustTitleCapitalization(frame)<br />
local title = mw.title.getCurrentTitle().text<br />
local lowercaseParameter = (frame.args.lowercase or ""):lower()<br />
<br />
if lowercaseParameter == "yes" then<br />
return title:sub(1,1):lower() .. title:sub(2)<br />
end<br />
if lowercaseParameter == "no" then<br />
return title<br />
end<br />
<br />
return title:sub(2):find("%u") and title or title:sub(1,1):lower() .. title:sub(2)<br />
end<br />
<br />
return p</div>
Xoontor