Module:Message box: Difference between revisions
Content added Content deleted
(Reverting) |
(username removed) m (1 revision imported from loginwiki:Module:Message_box: Updating template with latest edits from loginwiki) |
||
Line 6: | Line 6: | ||
local getArgs |
local getArgs |
||
local yesno = require('Module:Yesno') |
local yesno = require('Module:Yesno') |
||
local templatestyles = 'Module:Message box/styles.css' |
|||
-- Get a language object for formatDate and ucfirst. |
-- Get a language object for formatDate and ucfirst. |
||
Line 13: | Line 12: | ||
-- Define constants |
-- Define constants |
||
local CONFIG_MODULE = 'Module:Message box/configuration' |
local CONFIG_MODULE = 'Module:Message box/configuration' |
||
local DEMOSPACES = { |
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'} |
||
-------------------------------------------------------------------------------- |
-------------------------------------------------------------------------------- |
||
Line 269: | Line 268: | ||
end |
end |
||
if talkTitle and talkTitle.exists then |
if talkTitle and talkTitle.exists then |
||
local talkText |
|||
⚫ | |||
if self.isSmall then |
|||
⚫ | |||
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk) |
|||
⚫ | |||
talkText = string.format('([[%s|talk]])', talkLink) |
|||
'%s [[%s|%s]].', |
|||
else |
|||
talkText, |
|||
⚫ | |||
talk, |
|||
⚫ | |||
⚫ | |||
⚫ | |||
) |
|||
'%s [[%s|%s]].', |
|||
else |
|||
talkText, |
|||
⚫ | |||
talk, |
|||
⚫ | |||
⚫ | |||
talkText, |
|||
) |
|||
⚫ | |||
else |
|||
talk |
|||
⚫ | |||
) |
|||
⚫ | |||
end |
|||
talkText, |
|||
⚫ | |||
talk |
|||
) |
|||
end |
|||
end |
|||
self.talk = talkText |
self.talk = talkText |
||
end |
end |
||
Line 298: | Line 303: | ||
end |
end |
||
if date then |
if date then |
||
self.date = string.format(" < |
self.date = string.format(" <span class='date-container'>''(<span class='date'>%s</span>)''</span>", date) |
||
end |
end |
||
self.info = args.info |
self.info = args.info |
||
Line 321: | Line 326: | ||
self.imageEmptyCell = cfg.imageEmptyCell |
self.imageEmptyCell = cfg.imageEmptyCell |
||
if cfg.imageEmptyCellStyle then |
if cfg.imageEmptyCellStyle then |
||
self.imageEmptyCellStyle = 'border:none;padding: |
self.imageEmptyCellStyle = 'border:none;padding:0;width:1px' |
||
end |
end |
||
Line 525: | Line 530: | ||
:addClass('mbox-text-span') |
:addClass('mbox-text-span') |
||
:wikitext(self.issue or nil) |
:wikitext(self.issue or nil) |
||
if (self.talk or self.fix) |
if (self.talk or self.fix) then |
||
textCellDiv:tag('span') |
textCellDiv:tag('span') |
||
:addClass('hide-when-compact') |
:addClass('hide-when-compact') |
||
Line 539: | Line 544: | ||
end |
end |
||
if self.removalNotice then |
if self.removalNotice then |
||
textCellDiv:tag(' |
textCellDiv:tag('span') |
||
:addClass('hide-when-compact') |
:addClass('hide-when-compact') |
||
:tag('i') |
:tag('i') |
||
Line 607: | Line 612: | ||
box:setCategories() |
box:setCategories() |
||
return box:export() |
return box:export() |
||
end |
|||
local function templatestyles(frame, src) |
|||
return mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = templatestyles} } |
|||
.. 'CONFIG_MODULE' |
|||
end |
end |
||