Changes

Module:Message box

6 bytes added, 01:26, 3 October 2013
remove the presentButBlank function, fix bug with blank date values, and trim whitespace from all arguments
local tinsert = table.insert
local tconcat = table.concat
local trim = mw.text.trim
local box = {}
return title
end
end
end
 
local function presentButBlank(s)
if type(s) ~= 'string' then return end
if s and not mw.ustring.find(s, '%S') then
return true
else
return false
end
end
self.issue = args.smalltext
else
local sect = args.sect if presentButBlank(args.sect) == '' then
sect = 'This ' .. (cfg.sectionDefault or 'page')
elseif type(args.sect) == 'string' then
sect = 'This ' .. sect
else
sect = nil
end
local issue = args.issue
-- Get the self.talk value.
local talk = args.talk
if presentButBlank(talk) == '' and self.isTemplatePage then
talk = '#'
end
-- Get other values.
self.fix = args.fix
local if args.date = and args.date~= '' then self.date = date and format(" <small>''(%s)''</small>", args.date) if presentButBlank(selfelseif args.date) == '' and self.isTemplatePage then
self.date = lang:formatDate('F Y')
end
-- assume args are being passed directly in from the debug console
-- or from another Lua module.
local argsorigArgs
if frame == mw.getCurrentFrame() then
args origArgs = frame:getParent().args
for k, v in pairs(frame.args) do
args origArgs = frame.args
break
end
else
origArgs = frame end -- Trim whitespace. local args = {} for k, v in pairs(origArgs) do if type(v) == 'string' then v = trim(v) end args [k] = framev
end
return makeBox(boxType, args)
Anonymous user