Module:Message box: Difference between revisions

Content added Content deleted
m (1 revision imported from wikipedia:Module:Message_box)
(Testing)
Line 6:
local getArgs
local yesno = require('Module:Yesno')
local templatestyles = 'Module:Message box/styles.css'
styles = 'Module:Message box/styles.css'
 
-- Get a language object for formatDate and ucfirst.
Line 12 ⟶ 14:
-- 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 268 ⟶ 270:
end
if talkTitle and talkTitle.exists then
local talkText = 'Relevant discussion may be found on'
local talkText
if talkArgIsTalkPage then
if self.isSmall then
talkText = string.format(
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
'%s [[%s|%s]].',
talkText = string.format('([[%s|talk]])', talkLink)
talkText,
else
talk,
talkText = 'Relevant discussion may be found on'
talkTitle.prefixedText
if talkArgIsTalkPage then
)
talkText = string.format(
else
'%s [[%s|%s]].',
talkText = string.format(
talkText,
'%s the [[%s#%s|talk page]].',
talk,
talkText,
talkTitle.prefixedText
talkTitle.prefixedText,
)
talk
else
)
talkText = string.format(
end
'%s the [[%s#%s|talk page]].',
talkText,
talkTitle.prefixedText,
talk
)
end
end
self.talk = talkText
end
Line 303 ⟶ 299:
end
if date then
self.date = string.format(" <spansmall class='date-container'>''(<span class='date'>%s</span>)''</spansmall>", date)
end
self.info = args.info
Line 326 ⟶ 322:
self.imageEmptyCell = cfg.imageEmptyCell
if cfg.imageEmptyCellStyle then
self.imageEmptyCellStyle = 'border:none;padding:00px;width:1px'
end
 
Line 530 ⟶ 526:
: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 544 ⟶ 540:
end
if self.removalNotice then
textCellDiv:tag('spansmall')
:addClass('hide-when-compact')
:tag('i')
Line 612 ⟶ 608:
box:setCategories()
return box:export()
end
local function templatestyles(frame, src)
return mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = templatestyles} }
.. 'CONFIG_MODULE'
end