Jump to content

Module:Message box: Difference between revisions

Copy from sandbox per request
m (1 revision imported)
(Copy from sandbox per request)
Line 188: Line 188:
-- Set text style.
-- Set text style.
self.textstyle = args.textstyle
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
-- Find if we are on the template page or not. This functionality is only
Line 264: Line 268:
                 local talkText
                 local talkText
                 if self.isSmall then
                 if self.isSmall then
                     local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. '#' .. talk)
                     local talkLink = talkArgIsTalkPage and talk or (talkTitle.prefixedText .. (talk == '#' and '' or '#') .. talk)
                     talkText = string.format('([[%s|talk]])', talkLink)
                     talkText = string.format('([[%s|talk]])', talkLink)
                 else
                 else
Line 277: Line 281:
                     else
                     else
                         talkText = string.format(
                         talkText = string.format(
                             '%s the [[%s#%s|talk page]].',
                             '%s the [[%s' .. (talk == '#' and '' or '#') .. '%s|talk page]].',
                             talkText,
                             talkText,
                             talkTitle.prefixedText,
                             talkTitle.prefixedText,
Line 519: Line 523:
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
imageLeftCell = imageLeftCell:tag('div'):addClass('mbox-image-div')
end
end
imageLeftCell:wikitext(self.imageLeft or nil)
imageLeftCell
:addClass(self.imageLeftClass)
:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- Some message boxes define an empty cell if no image is specified, and
Line 574: Line 580:
end
end
imageRightCell
imageRightCell
:addClass(self.imageRightClass)
:wikitext(self.imageRight or nil)
:wikitext(self.imageRight or nil)
end
end
Anonymous user