Anonymous user
Module:Protection banner: Difference between revisions
Jump to navigation
Jump to search
use a __tostring metamethod to render the banner objects
(move the category methods to the Protection class, and get rid of all the category objects) |
(use a __tostring metamethod to render the banner objects) |
||
Line 794:
:caption(self._imageCaption)
:render()
end▼
end
Line 820 ⟶ 815:
end
function Banner:
-- Module:Message box if the page specified is not the current page.
self._page = s
▲end
function Banner:__tostring()
-- Renders the banner.
▲ -- The page parameter specifies the page to generate the banner for, for
mMessageBox = mMessageBox or require('Module:Message box')
local reasonText = self._reasonText or error('no reason text set')
local explanationText = self._explanationText
local mbargs = {
page =
type = 'protection',
image = self:renderImage(),
Line 863 ⟶ 862:
end
function Padlock:
local root = mw.html.create('div')
root
Line 921 ⟶ 920:
end
-- Set the text fields and the page name.
if not isPadlock then
bannerObj:setReasonText(blurbObj:makeReasonText())
bannerObj:setExplanationText(blurbObj:makeExplanationText())
bannerObj:setPage(titleObj.prefixedText)
end
ret[#ret + 1] =
end
|