Anonymous user
Module:Protection banner: Difference between revisions
comment tweaks
(get rid of a few more unnecessary local variables) |
(comment tweaks) |
||
Line 682:
function BannerTemplate:initialize(protectionObj, cfg)
self._cfg = cfg
-- Set the image filename.
local imageFilename = protectionObj.bannerConfig.image
if imageFilename then
self._imageFilename = imageFilename
else
-- If an image filename isn't specified explicitly in the banner config,
-- generate it from the protection status and the namespace.
local action = protectionObj.action
local level = protectionObj.level
Line 692 ⟶ 696:
-- Deal with special cases first.
if (namespace == 10 or namespace == 828)
and action == 'edit'
and level == 'sysop'
Line 741 ⟶ 745:
function Banner:initialize(protectionObj, blurbObj, cfg)
BannerTemplate.initialize(self, protectionObj, cfg) --
self:setImageWidth(40)
self:setImageTooltip(blurbObj:makeAltText()) -- Large banners use the alt text for the tooltip.
self._reasonText = blurbObj:makeReasonText()
self._explanationText = blurbObj:makeExplanationText()
self._page = protectionObj.title.prefixedText --
end
Line 774 ⟶ 778:
function Padlock:initialize(protectionObj, blurbObj, cfg)
BannerTemplate.initialize(self, protectionObj, cfg) --
self:setImageWidth(20)
self:setImageTooltip(blurbObj:makeTooltipText())
|