https://de.wikipedia.org/w/index.php?action=history&feed=atom&title=Modul%3APageTitleSimilar
Modul:PageTitleSimilar - Versionsgeschichte
2025-06-05T04:37:36Z
Versionsgeschichte dieser Seite in Wikipedia
MediaWiki 1.45.0-wmf.3
https://de.wikipedia.org/w/index.php?title=Modul:PageTitleSimilar&diff=253255778&oldid=prev
PerfektesChaos: 2025-02-11
2025-02-12T12:47:31Z
<p>2025-02-11</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="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 12. Februar 2025, 14:47 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 5:</td>
<td colspan="2" class="diff-lineno">Zeile 5:</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>Check whether similar page name is existing</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>Check whether similar page name is existing</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>]==]</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>]==]</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;"><br /></td>
<td colspan="2" class="diff-empty diff-side-added"></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;"><br /></td>
<td colspan="2" class="diff-empty diff-side-added"></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>if mw.site.server:find( ".beta.wmflabs.org", 4, true ) then</div></td>
<td colspan="2" class="diff-empty diff-side-added"></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> require( "strict" )</div></td>
<td colspan="2" class="diff-empty diff-side-added"></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>end</div></td>
<td colspan="2" class="diff-empty diff-side-added"></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;"><br /></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 Failsafe = PageTitleSimilar</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 Failsafe = PageTitleSimilar</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>local THIS = { }</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 THIS = { }</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 57:</td>
<td colspan="2" class="diff-lineno">Zeile 51:</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> -- apply -- string, with message type</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> -- apply -- string, with message type</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> -- -- Typogr</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> -- -- Typogr</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> -- -- <del style="font-weight: bold; text-decoration: none;">eURL</del></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> -- -- <ins style="font-weight: bold; text-decoration: none;">URL</ins></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> -- THIS.title has been defined</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> -- THIS.title has been defined</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> -- Postcondition:</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> -- Postcondition:</div></td>
</tr>
</table>
PerfektesChaos
https://de.wikipedia.org/w/index.php?title=Modul:PageTitleSimilar&diff=253239396&oldid=prev
TenWhile6: Schützte „Modul:PageTitleSimilar“: per request ([Bearbeiten=Nur Sichter] (unbeschränkt) [Verschieben=Nur Administratoren] (unbeschränkt))
2025-02-11T23:36:13Z
<p>Schützte „<a href="/wiki/Modul:PageTitleSimilar" title="Modul:PageTitleSimilar">Modul:PageTitleSimilar</a>“: per <a href="/wiki/Spezial:Permanenter_Link/253239317" title="Spezial:Permanenter Link/253239317">request</a> ([Bearbeiten=Nur Sichter] (unbeschränkt) [Verschieben=Nur Administratoren] (unbeschränkt))</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="de">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Version vom 12. Februar 2025, 01:36 Uhr</td>
</tr><tr><td colspan="2" class="diff-notice" lang="de"><div class="mw-diff-empty">(kein Unterschied)</div>
</td></tr></table>
TenWhile6
https://de.wikipedia.org/w/index.php?title=Modul:PageTitleSimilar&diff=253239204&oldid=prev
PerfektesChaos: 2025-02-11
2025-02-11T23:23:30Z
<p>2025-02-11</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="de">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Nächstältere Version</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Version vom 12. Februar 2025, 01:23 Uhr</td>
</tr><tr>
<td colspan="2" class="diff-lineno">Zeile 67:</td>
<td colspan="2" class="diff-lineno">Zeile 67:</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 t = mw.title.new( shift )</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 t = mw.title.new( shift )</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 t and t.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> if t and t.exists 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> local params = { <del style="font-weight: bold; text-decoration: none;">SEITE</del> = THIS.title.prefixedText }</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> local params = { <ins style="font-weight: bold; text-decoration: none;">["1"]</ins> = THIS.title.prefixedText }</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> r = THIS.frame:expandTemplate{ title = t,</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> r = THIS.frame:expandTemplate{ title = t,</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> args = params }</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> args = params }</div></td>
</tr>
<tr>
<td colspan="2" class="diff-lineno">Zeile 116:</td>
<td colspan="2" class="diff-lineno">Zeile 116:</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 type( v[ 1 ] ) == "string" and</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 type( v[ 1 ] ) == "string" and</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> type( v[ 2 ] ) == "string" 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> type( v[ 2 ] ) == "string" 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> shift = <del style="font-weight: bold; text-decoration: none;">s:</del>gsub( v[ 1 ], v[ 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> shift = <ins style="font-weight: bold; text-decoration: none;">mw.ustring.</ins>gsub(<ins style="font-weight: bold; text-decoration: none;"> s,</ins> v[ 1 ], v[ 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> if shift ~= s 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 shift ~= s 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> if find( shift ) 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 find( shift ) then</div></td>
</tr>
</table>
PerfektesChaos
https://de.wikipedia.org/w/index.php?title=Modul:PageTitleSimilar&diff=253238756&oldid=prev
PerfektesChaos: Setup
2025-02-11T22:49:27Z
<p>Setup</p>
<p><b>Neue Seite</b></p><div>local PageTitleSimilar = { suite = "PageTitleSimilar",<br />
serial = "2025-02-11",<br />
item = 0 }<br />
--[==[<br />
Check whether similar page name is existing<br />
]==]<br />
<br />
<br />
if mw.site.server:find( ".beta.wmflabs.org", 4, true ) then<br />
require( "strict" )<br />
end<br />
<br />
local Failsafe = PageTitleSimilar<br />
local THIS = { }<br />
<br />
<br />
<br />
local fault = function ( alert )<br />
-- Format error message<br />
-- Precondition:<br />
-- alert -- string, with message<br />
-- Postcondition:<br />
-- Returns string<br />
local e = mw.html.create( "span" )<br />
:addClass( "error" )<br />
:wikitext( string.format( "%s * %s",<br />
PageTitleSimilar.suite,<br />
alert ) )<br />
return tostring( e )<br />
end -- fault()<br />
<br />
<br />
<br />
local find = function ( ask )<br />
-- Check whether page title exists in this namespace<br />
-- Precondition:<br />
-- ask -- string, with page title<br />
-- Postcondition:<br />
-- Returns true, if existing<br />
-- THIS.title is the title of an existing page<br />
local t = mw.title.new( ask, THIS.ns )<br />
local r<br />
if t then<br />
r = t.exists<br />
if r then<br />
THIS.title = t<br />
end<br />
end<br />
return r<br />
end -- find()<br />
<br />
<br />
<br />
local found = function ( apply )<br />
-- Communicate match by transclusion<br />
-- Precondition:<br />
-- apply -- string, with message type<br />
-- -- Typogr<br />
-- -- eURL<br />
-- THIS.title has been defined<br />
-- Postcondition:<br />
-- Returns string<br />
local source = "source" .. apply<br />
local shift = THIS.JSON[ source ]<br />
local r<br />
if type( shift ) == "string" then<br />
local t = mw.title.new( shift )<br />
if t and t.exists then<br />
local params = { SEITE = THIS.title.prefixedText }<br />
r = THIS.frame:expandTemplate{ title = t,<br />
args = params }<br />
end<br />
end<br />
if not r then<br />
r = fault( "missing transclusion for " .. source )<br />
end<br />
return r<br />
end -- found()<br />
<br />
<br />
<br />
local fraction = function ()<br />
-- Try URL completion when common special chars were truncated<br />
-- Postcondition:<br />
-- Returns string, or not<br />
local s = THIS.self<br />
local r<br />
if s:find( "(", 1, true ) then<br />
find( s .. ")" )<br />
end<br />
if not THIS.title then<br />
local shift = s .. "."<br />
if not find( shift ) then<br />
shift = s .. "?"<br />
find( shift )<br />
end<br />
end<br />
if THIS.title then<br />
r = found( "URL" )<br />
end<br />
return r<br />
end -- fraction()<br />
<br />
<br />
<br />
local further = function ()<br />
-- Try improvements by typographical chars<br />
-- Postcondition:<br />
-- Returns string, or not<br />
local rep = THIS.JSON.replace<br />
local r<br />
if type( rep ) == "table" then<br />
local s = THIS.self<br />
local shift<br />
for k, v in pairs( rep ) do<br />
if type( v[ 1 ] ) == "string" and<br />
type( v[ 2 ] ) == "string" then<br />
shift = s:gsub( v[ 1 ], v[ 2 ] )<br />
if shift ~= s then<br />
if find( shift ) then<br />
r = found( "Typogr" )<br />
break -- for k, v<br />
else<br />
s = shift<br />
end<br />
end<br />
else<br />
r = fault( string.format( "replace&#91;%s&#93;", k ) )<br />
break -- for k, v<br />
end<br />
end -- for k, v<br />
end<br />
return r<br />
end -- further()<br />
<br />
<br />
<br />
Failsafe.failsafe = function ( atleast )<br />
-- Retrieve versioning and check for compliance<br />
-- Precondition:<br />
-- atleast -- string, with required version<br />
-- or wikidata|item|~|@ or false<br />
-- Postcondition:<br />
-- Returns string -- with queried version/item, also if problem<br />
-- false -- if appropriate<br />
-- 2024-03-01<br />
local since = atleast<br />
local last = ( since == "~" )<br />
local linked = ( since == "@" )<br />
local link = ( since == "item" )<br />
local r<br />
if last or link or linked or since == "wikidata" then<br />
local item = Failsafe.item<br />
since = false<br />
if type( item ) == "number" and item > 0 then<br />
local suited = string.format( "Q%d", item )<br />
if link then<br />
r = suited<br />
else<br />
local entity = mw.wikibase.getEntity( suited )<br />
if type( entity ) == "table" then<br />
local seek = Failsafe.serialProperty or "P348"<br />
local vsn = entity:formatPropertyValues( seek )<br />
if type( vsn ) == "table" and<br />
type( vsn.value ) == "string" and<br />
vsn.value ~= "" then<br />
if last and vsn.value == Failsafe.serial then<br />
r = false<br />
elseif linked then<br />
if mw.title.getCurrentTitle().prefixedText<br />
== mw.wikibase.getSitelink( suited ) then<br />
r = false<br />
else<br />
r = suited<br />
end<br />
else<br />
r = vsn.value<br />
end<br />
end<br />
end<br />
end<br />
elseif link then<br />
r = false<br />
end<br />
end<br />
if type( r ) == "nil" then<br />
if not since or since <= Failsafe.serial then<br />
r = Failsafe.serial<br />
else<br />
r = false<br />
end<br />
end<br />
return r<br />
end -- Failsafe.failsafe()<br />
<br />
<br />
<br />
-- Export<br />
local p = { }<br />
<br />
p.f = function ( frame )<br />
local source = frame.args[ 1 ]<br />
local r, scream<br />
if source then<br />
local lucky<br />
lucky, THIS.JSON = pcall( mw.loadJsonData, source )<br />
if lucky then<br />
local t = mw.title.getCurrentTitle()<br />
THIS.frame = frame<br />
THIS.ns = t.ns<br />
THIS.self = t.prefixedText<br />
if frame.args.URL == "1" then<br />
r = fraction()<br />
end<br />
if not r then<br />
r = further()<br />
end<br />
else<br />
scream = "no valid JSON found: " .. mw.text.nowiki( source )<br />
end<br />
else<br />
scream = "invoked without JSON"<br />
end<br />
if scream then<br />
r = fault( scream )<br />
end<br />
return r or ""<br />
end -- p.f<br />
<br />
<br />
<br />
p.failsafe = function ( frame )<br />
-- Versioning interface<br />
local s = type( frame )<br />
local since<br />
if s == "table" then<br />
since = frame.args[ 1 ]<br />
elseif s == "string" then<br />
since = frame<br />
end<br />
if since then<br />
since = mw.text.trim( since )<br />
if since == "" then<br />
since = false<br />
end<br />
end<br />
return Failsafe.failsafe( since ) or ""<br />
end -- p.failsafe<br />
<br />
return p</div>
PerfektesChaos