Content deleted Content added
use self.cfg here |
IznoPublic (talk | contribs) leftimage |
||
(13 intermediate revisions by 2 users not shown) | |||
Line 155:
self.typeClass = typeData.class
self.typeImage = typeData.image
self.typeImageNeedsLink = typeData.imageNeedsLink
-- Find if the box has been wrongly substituted.
Line 187 ⟶ 188:
-- Set text style.
self.textstyle = args.textstyle
-- Set image classes.
self.imageRightClass = args.imagerightclass or args.imageclass
self.imageLeftClass = args.imageleftclass or args.imageclass
-- Find if we are on the template page or not. This functionality is only
Line 263 ⟶ 268:
local talkText
if self.isSmall then
local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. (talk == '#' and '' or '#') .. talk)
talkText = string.format('([[%s|talk]])', talkLink)
else
Line 276 ⟶ 281:
else
talkText = string.format(
'%s the [[%s' .. (talk == '#' and '' or '#') .. '%s|talk page]].',
talkText,
talkTitle.prefixedText,
Line 329 ⟶ 334:
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s
or '
end
end
Line 342 ⟶ 347:
-- set templatestyles
-- DIV MIGRATION CONDITIONAL
if cfg.
self.base_templatestyles = cfg.div_templatestyles
else
Line 500 ⟶ 505:
-- Create the box table.
local
for i, class in ipairs(self.classes or {}) do
end
mbox
:cssText(self.style or nil)
if self.attrs then
end
-- Add the left-hand image.
if self.imageLeft then
local imageLeftCell =
imageLeftCell
end▼
▲ imageLeftCell:wikitext(self.imageLeft or nil)
▲ :addClass('mbox-empty-cell')
end
-- Add the text.
local textCell =
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
Line 575 ⟶ 563:
-- Add the right-hand image.
if self.imageRight then
local imageRightCell =
imageRightCell
:addClass(self.imageRightClass)
:wikitext(self.imageRight or nil)
end
Line 587 ⟶ 571:
-- Add the below row.
if self.below then
:addClass('mbox-text')
:cssText(self.textstyle or nil)
Line 610 ⟶ 594:
function MessageBox:export()
-- DIV MIGRATION CONDITIONAL▼
if self.cfg.div_structure then▼
return MessageBox:exportDiv()▼
-- END DIV MIGRATION CONDITIONAL▼
local root = mw.html.create()
Line 668 ⟶ 647:
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
imageLeftCell
:addClass(self.imageLeftClass)
:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
Line 723 ⟶ 704:
end
imageRightCell
:addClass(self.imageRightClass)
:wikitext(self.imageRight or nil)
end
Line 769 ⟶ 751:
box:setParameters()
box:setCategories()
▲ -- DIV MIGRATION CONDITIONAL
▲ -- END DIV MIGRATION CONDITIONAL
return box:export()
end
|