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) -- Maybe we don't need the namespace check?
and action == 'edit'
and level == 'sysop'
Line 741 ⟶ 745:
 
function Banner:initialize(protectionObj, blurbObj, cfg)
BannerTemplate.initialize(self, protectionObj, cfg) -- thisThis doesn't need the blurb.
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 -- ThisOnly onlymakes affectsa Module:Messagedifference boxin if the page specified is not the current pagetesting.
end
 
Line 774 ⟶ 778:
 
function Padlock:initialize(protectionObj, blurbObj, cfg)
BannerTemplate.initialize(self, protectionObj, cfg) -- thisThis doesn't need the blurb.
self:setImageWidth(20)
self:setImageTooltip(blurbObj:makeTooltipText())
Anonymous user