Anonymous user
Module:Message box: Difference between revisions
These can just go, the first for being very Wikipedia-specific, and the second for being almost impossible to import properly
m (1 revision imported: updating our documentation module pages with WMF updates) |
(These can just go, the first for being very Wikipedia-specific, and the second for being almost impossible to import properly) |
||
Line 6:
local getArgs
local yesno = require('Module:Yesno')
local templatestyles = 'Module:Message box/styles.css'
-- Get a language object for formatDate and ucfirst.
Line 12 ⟶ 13:
-- Define constants
local CONFIG_MODULE = 'Module:Message box/configuration'
local DEMOSPACES = {user = 'tmbox', talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}
--------------------------------------------------------------------------------
Line 162 ⟶ 163:
self.typeClass = typeData.class
self.typeImage = typeData.image
-- Find whether we are using a small message box.
Line 268 ⟶ 266:
end
if talkTitle and talkTitle.exists then
'%s [[%s|%s]].',
talkText,
talk,
▲ talkText = 'Relevant discussion may be found on'
▲ if talkArgIsTalkPage then
else
talkText,
▲ talkTitle.prefixedText
talk
)
end▼
▲ '%s the [[%s#%s|talk page]].',
▲ talkTitle.prefixedText,
self.talk = talkText
end
Line 303 ⟶ 295:
end
if date then
self.date = string.format(" <
end
self.info = args.info
▲ end
end
Line 326 ⟶ 315:
self.imageEmptyCell = cfg.imageEmptyCell
if cfg.imageEmptyCellStyle then
self.imageEmptyCellStyle = 'border:none;padding:
end
Line 438 ⟶ 427:
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end▼
end
end
Line 473 ⟶ 459:
function MessageBox:export()
local root = mw.html.create()
▲ :wikitext(string.format(
▲ ))
-- Create the box table.
Line 530 ⟶ 506:
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) and not self.isSmall then
textCellDiv:tag('span')
:addClass('hide-when-compact')
Line 542 ⟶ 518:
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
else
Line 612 ⟶ 582:
box:setCategories()
return box:export()
▲ end
local function templatestyles(frame, src)
return mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = templatestyles} }
.. 'CONFIG_MODULE'
end
|