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 &#039;local p = {} function p.getTopLevelDomain(frame) local args = frame.args local domain = args.domain or args[1] local context = args.context or &quot;domains&quot; if domain and domain ~= &quot;&quot; then domain = mw.text.trim(domain):lower() domain = &quot;.&quot; .. domain:gsub(&quot;^%.&quot;, &quot;&quot;) local category = &quot;Category:Redirects from &quot; .. domain .. (context == &quot;domains&quot; and &quot; domain names&quot; or &quot; URLs&quot;) if mw.title...&#039;</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 &quot;domains&quot;<br /> <br /> if domain and domain ~= &quot;&quot; then<br /> domain = mw.text.trim(domain):lower()<br /> domain = &quot;.&quot; .. domain:gsub(&quot;^%.&quot;, &quot;&quot;)<br /> <br /> local category = &quot;Category:Redirects from &quot; .. domain ..<br /> (context == &quot;domains&quot; and &quot; domain names&quot; or &quot; URLs&quot;)<br /> <br /> if mw.title.new(category).exists then<br /> return &quot; &quot; .. domain<br /> end<br /> end<br /> <br /> local currentTitle = mw.title.getCurrentTitle().text<br /> currentTitle = currentTitle:lower():gsub(&quot;^https?://&quot;, &quot;&quot;)<br /> currentTitle = currentTitle:match(&quot;^([^/]+)&quot;) or currentTitle<br /> <br /> local topLevelDomain = currentTitle:match(&quot;(%.[^.]+)$&quot;)<br /> <br /> if topLevelDomain then<br /> topLevelDomain = topLevelDomain<br /> local category = &quot;Category:Redirects from &quot; .. topLevelDomain ..<br /> (context == &quot;domains&quot; and &quot; domain names&quot; or &quot; URLs&quot;)<br /> <br /> if mw.title.new(category).exists then<br /> return &quot; &quot; .. topLevelDomain<br /> end<br /> end<br /> <br /> return &quot;&quot;<br /> end<br /> <br /> function p.adjustTitleCapitalization(frame)<br /> local title = mw.title.getCurrentTitle().text<br /> local lowercaseParameter = (frame.args.lowercase or &quot;&quot;):lower()<br /> <br /> if lowercaseParameter == &quot;yes&quot; then<br /> return title:sub(1,1):lower() .. title:sub(2)<br /> end<br /> if lowercaseParameter == &quot;no&quot; then<br /> return title<br /> end<br /> <br /> return title:sub(2):find(&quot;%u&quot;) and title or title:sub(1,1):lower() .. title:sub(2)<br /> end<br /> <br /> return p</div> Xoontor