Module:Protection banner: Difference between revisions

Fixing content model
(add hack to prevent indicator tags producing whitespace at the top of articles)
(Fixing content model)
Line 825:
obj._imageAlt = blurbObj:makeBannerText('alt')
obj._imageLink = blurbObj:makeBannerText('link')
obj._indicatorName_right = cfg.padlockIndicatorNamespadlockPositions[protectionObj.action]
or cfg.padlockIndicatorNamespadlockPositions.default
or 'pp-default55px'
return setmetatable(obj, Padlock)
end
 
function Padlock:__tostring()
local frameroot = mw.getCurrentFramehtml.create('div')
root
-- The nowiki tag helps prevent whitespace at the top of articles.
:addClass('metadata topicon nopopups')
local nowiki = frame:extensionTag{name = 'nowiki'}
:attr('id', 'protected-icon')
local indicator = frame:extensionTag{
:css{display = 'none', right = self._right}
name = 'indicator',
content = :wikitext(self:renderImage())
args = {name = self._indicatorName},
return tostring(root)
content = self:renderImage()
}
return nowiki .. indicator
end
 
Anonymous user