https://iopwiki.com/index.php?title=Module:Yesno&feed=atom&action=historyModule:Yesno - Revision history2024-03-28T10:55:57ZRevision history for this page on the wikiMediaWiki 1.32.2https://iopwiki.com/index.php?title=Module:Yesno&diff=7800&oldid=prevPianoforte: 1 revision imported2016-12-20T11:41:50Z<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 11:41, 20 December 2016</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Pianofortehttps://iopwiki.com/index.php?title=Module:Yesno&diff=7667&oldid=prevPianoforte: Created page with "-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template {{yesno}}. return function (val, default) -- If your wiki..."2016-12-19T08:41:07Z<p>Created page with "-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template {{yesno}}. return function (val, default) -- If your wiki..."</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 08:41, 19 December 2016</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Pianofortehttps://iopwiki.com/index.php?title=Module:Yesno&diff=7799&oldid=prevMSGJ: recognise "t" for true and "f" for false, per request2015-04-27T10:43:30Z<p>recognise "t" for true and "f" for false, per request</p>
<p><b>New page</b></p><div>-- Function allowing for consistent treatment of boolean-like wikitext input.<br />
-- It works similarly to the template {{yesno}}.<br />
<br />
return function (val, default)<br />
-- If your wiki uses non-ascii characters for any of "yes", "no", etc., you<br />
-- should replace "val:lower()" with "mw.ustring.lower(val)" in the<br />
-- following line.<br />
val = type(val) == 'string' and val:lower() or val<br />
if val == nil then<br />
return nil<br />
elseif val == true <br />
or val == 'yes'<br />
or val == 'y'<br />
or val == 'true'<br />
or val == 't'<br />
or tonumber(val) == 1<br />
then<br />
return true<br />
elseif val == false<br />
or val == 'no'<br />
or val == 'n'<br />
or val == 'false'<br />
or val == 'f'<br />
or tonumber(val) == 0<br />
then<br />
return false<br />
else<br />
return default<br />
end<br />
end</div>MSGJ