Jump to content

Module:Protection banner: Difference between revisions

undo for now - the code looks good, but we will need to change everything over at the same time to avoid it looking like a giant mess
m (switch back to the main config module)
(undo for now - the code looks good, but we will need to change everything over at the same time to avoid it looking like a giant mess)
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._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]
obj._right = cfg.padlockPositions[protectionObj.action]
or cfg.padlockIndicatorNames.default
or cfg.padlockPositions.default
or 'pp-default'
or '55px'
return setmetatable(obj, Padlock)
return setmetatable(obj, Padlock)
end
end


function Padlock:__tostring()
function Padlock:__tostring()
return mw.getCurrentFrame():extensionTag{
local root = mw.html.create('div')
name = 'indicator',
root
args = {name = self._indicatorName},
:addClass('metadata topicon nopopups')
content = self:renderImage()
:attr('id', 'protected-icon')
}
: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.