https://mw-live.lojban.org/index.php?title=Module:Error&feed=atom&action=historyModule:Error - Revision history2024-03-28T09:26:52ZRevision history for this page on the wikiMediaWiki 1.38.4https://mw-live.lojban.org/index.php?title=Module:Error&diff=85265&oldid=prevGleki: 1 revision2014-03-01T11:51:09Z<p>1 revision</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:51, 1 March 2014</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Glekihttps://mw-live.lojban.org/index.php?title=Module:Error&diff=85264&oldid=prevGleki: 1 revision2014-01-29T15:51:01Z<p>1 revision</p>
<p><b>New page</b></p><div>-- This module implements {{error}}.<br />
<br />
local p = {}<br />
<br />
local HtmlBuilder = require('Module:HtmlBuilder')<br />
<br />
local function _error(args)<br />
local message = args.message or args[1] or error('no message specified', 2)<br />
message = tostring(message)<br />
local tag = mw.ustring.lower(tostring(args.tag))<br />
<br />
-- Work out what html tag we should use.<br />
if not (tag == 'p' or tag == 'span' or tag == 'div') then<br />
tag = 'strong'<br />
end<br />
<br />
-- Generate the html.<br />
local root = HtmlBuilder.create(tag)<br />
root<br />
.addClass('error')<br />
.wikitext(message)<br />
<br />
return tostring(root)<br />
end<br />
<br />
function p.error(frame)<br />
local args<br />
if frame == mw.getCurrentFrame() then<br />
-- We're being called via #invoke. The args are passed through to the module<br />
-- from the template page, so use the args that were passed into the template.<br />
args = frame.args<br />
else<br />
-- We're being called from another module or from the debug console, so assume<br />
-- the args are passed in directly.<br />
args = frame<br />
end<br />
-- if the message parameter is present but blank, change it to nil so that Lua will<br />
-- consider it false.<br />
if args.message == "" then<br />
args.message = nil<br />
end<br />
return _error(args)<br />
end<br />
<br />
return p</div>Gleki