Content deleted Content added
turn the Header class into a Row class, and add methods to it |
set a different icon size if we are outputting a small template |
||
Line 60:
-------------------------------------------------------------------------------
-- Row class
-- This
-------------------------------------------------------------------------------
Line 69:
local obj = setmetatable({}, Row)
obj.cfg = data.cfg
obj.isSmall = data.isSmall
obj.categories = {}
return obj
Line 85 ⟶ 86:
self.icon = icon
self.caption = caption
self.
end
Line 94 ⟶ 95:
function Row:exportHtml()
local html = mw.html.create('tr')
-- Render the icon link.
local icon
local iconSize
if self.isSmall then
iconSize = self.iconSize or self.cfg.defaultSmallIconSize or '15px'
else
end
icon = self.renderImage(self.icon, self.caption, iconSize)
end
-- Render the HTML
html
:tag('td')
:addClass('mbox-image')
:wikitext(
▲ self.icon,
▲ self.size or self.cfg.defaultIconSize or '30px'
:done()
:tag('td')
:addClass('mbox-text')
:wikitext(self.text)
return html
end
|