„Modul:Message box” változatai közötti eltérés – Wikiforrás


Article Images

Tartalom törölve Tartalom hozzáadva

13. sor:

local tinsert = table.insert

local tconcat = table.concat

local trim = mw.text.trim

local box = {}

24 ⟶ 25 sor:

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

219 ⟶ 211 sor:

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

240 ⟶ 230 sor:

-- Get the self.talk value.

local talk = args.talk

if presentButBlank(talk) == '' and self.isTemplatePage then

talk = '#'

end

267 ⟶ 257 sor:

-- Get other values.

self.fix = args.fix

localif args.date =and args.date ~= '' then

self.date = date and format(" <small>''(%s)''</small>", args.date)

ifelseif presentButBlank(selfargs.date) == '' and self.isTemplatePage then

self.date = lang:formatDate('F Y')

end

536 ⟶ 526 sor:

-- assume args are being passed directly in from the debug console

-- or from another Lua module.

local argsorigArgs

if frame == mw.getCurrentFrame() then

argsorigArgs = frame:getParent().args

for k, v in pairs(frame.args) do

argsorigArgs = frame.args

break

end

else

argsorigArgs = frame

end

-- Trim whitespace.

local args = {}

for k, v in pairs(origArgs) do

if type(sv) ~== 'string' then return end

sectv = niltrim(v)

return true end

elseargs[k] = v

end

return makeBox(boxType, args)