Jump to content

Module:Protection banner: Difference between revisions

switch to <indicator> tags again - the previous error was because the config module needs to be updated at the same time
(Undid revision 653638001 by Edokter (talk) Getting weird error!)
(switch to <indicator> tags again - the previous error was because the config module needs to be updated at the same time)
Line 825: Line 825:
obj._imageAlt = blurbObj:makeBannerText('alt')
obj._imageAlt = blurbObj:makeBannerText('alt')
obj._imageLink = blurbObj:makeBannerText('link')
obj._imageLink = blurbObj:makeBannerText('link')
obj._right = cfg.padlockPositions[protectionObj.action]
obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]
or cfg.padlockPositions.default
or cfg.padlockIndicatorNames.default
or '55px'
or 'pp-default'
return setmetatable(obj, Padlock)
return setmetatable(obj, Padlock)
end
end


function Padlock:__tostring()
function Padlock:__tostring()
local root = mw.html.create('div')
return mw.getCurrentFrame():extensionTag{
root
name = 'indicator',
:addClass('metadata topicon nopopups')
args = {name = self._indicatorName},
:attr('id', 'protected-icon')
content = self:renderImage()
:css{display = 'none', right = self._right}
}
:wikitext(self:renderImage())
return tostring(root)
end
end


Cookies help us deliver our services. By using our services, you agree to our use of cookies.