https://iopwiki.com/index.php?title=Module:Yesno&feed=atom&action=history Module:Yesno - Revision history 2024-03-28T10:55:57Z Revision history for this page on the wiki MediaWiki 1.32.2 https://iopwiki.com/index.php?title=Module:Yesno&diff=7800&oldid=prev Pianoforte: 1 revision imported 2016-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> Pianoforte https://iopwiki.com/index.php?title=Module:Yesno&diff=7667&oldid=prev Pianoforte: 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 &quot;-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template {{yesno}}. return function (val, default) -- If your wiki...&quot;</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> Pianoforte https://iopwiki.com/index.php?title=Module:Yesno&diff=7799&oldid=prev MSGJ: recognise "t" for true and "f" for false, per request 2015-04-27T10:43:30Z <p>recognise &quot;t&quot; for true and &quot;f&quot; 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 &quot;yes&quot;, &quot;no&quot;, etc., you<br /> -- should replace &quot;val:lower()&quot; with &quot;mw.ustring.lower(val)&quot; 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