Module:Protection banner: Difference between revisions

some more work on the Blurb class
Enwikipedia>Mr. Stradivarius
(make some image tweaks and start a function for substituting blurb parameters)
Enwikipedia>Mr. Stradivarius
(some more work on the Blurb class)
Line 164:
local Blurb = class('Blurb')
 
function Blurb:initialize(bannerConfigconfigObj, protectionStatusObj, namespace)
self._config_configObj = bannerConfigconfigObj
self._protectionStatusObj = protectionStatusObj
self._bannerConfig = configObj:getBannerConfig(protectionStatusObj)
self._namespace = namespace
end
 
function Blurb:_substituteParameters_makeIntroParameter(msg, configObj)
end
 
function Blurb:_makePagetypeParameter()
local pagetypes = self._configObj:getConfigTable('pagetypeNamespaces')
return pagetypes[self._namespace] or pagetypes.default or 'page'
end
 
function Blurb:_substituteParameters(msg)
if not self._params then
local params, parameterFuncs = {}, {}
Line 183 ⟶ 194:
parameterFuncs[1] = function ()
return self:_makeIntroParameter()
return 'This page is currently [[Help:Protection|protected]] from editing'
end
 
-- TODO: Write parameter functions
self._params = params