Module:Protection banner: Difference between revisions

get rid of unnecessary wrapper functions
(finish making blurb parameter functions)
(get rid of unnecessary wrapper functions)
Line 147: Line 147:
local param
local param
if parameterFuncs[k] then
if parameterFuncs[k] then
param = parameterFuncs[k]()
param = parameterFuncs[k](self)
end
end
param = param or ''
param = param or ''
Line 155: Line 155:
})
})
parameterFuncs[1] = function ()
parameterFuncs[1] = self._makeIntroParameter
return self:_makeIntroParameter()
parameterFuncs[2] = self._makeUntilParameter
end
parameterFuncs[3] = self._makeDisputesParameter
parameterFuncs[4] = self._makePagetypeParameter
parameterFuncs[2] = function ()
parameterFuncs[5] = self._makeProtectionDateParameter
return self:_makeUntilParameter()
parameterFuncs[6] = self._makeVandalTemplateParameter
end
parameterFuncs[7] = self._makeProtectionLevelParameter
parameterFuncs[8] = self._makeExpiryParameter
parameterFuncs[3] = function ()
parameterFuncs[9] = self._makeDisputeLinkParameter -- A link to the page history or the move log
return self:_makeDisputesParameter()
parameterFuncs[10] = self._makeProtectionLogParameter
end
parameterFuncs[11] = self._makeTalkLinkParameter
parameterFuncs[12] = self._makeEditRequestParameter
parameterFuncs[4] = function ()
parameterFuncs[13] = self._makeRequestUnprotectionParameter
return self:_makePagetypeParameter()
parameterFuncs[14] = self._makeSubjectPageLinksParameter -- Adds links to edit requests and the talk page if we are on a subject page
end
parameterFuncs[15] = self._makeDeletionBlurbParameter
parameterFuncs[16] = self._makeDeletionDiscussionLinkParameter
parameterFuncs[5] = function ()
parameterFuncs[17] = self._makeDeletionLogParameter
return self:_makeProtectionDateParameter()
end
 
parameterFuncs[6] = function ()
return self:_makeVandalTemplateParameter()
end
 
parameterFuncs[7] = function ()
return self:_makeProtectionLevelParameter()
end
 
parameterFuncs[8] = function ()
return self:_makeExpiryParameter()
end
 
parameterFuncs[9] = function ()
-- A link to the page history or the move log
return self:_makeDisputeLinkParameter()
end
 
parameterFuncs[10] = function ()
return self:_makeProtectionLogParameter()
end
 
parameterFuncs[11] = function ()
return self:_makeTalkLinkParameter()
end
 
parameterFuncs[12] = function ()
return self:_makeEditRequestParameter()
end
 
parameterFuncs[13] = function ()
return self:_makeRequestUnprotectionParameter()
end
 
parameterFuncs[14] = function ()
-- Adds links to edit requests and the talk page if we are on a
-- subject page
return self:_makeSubjectPageLinksParameter()
end
parameterFuncs[15] = function ()
return self:_makeDeletionBlurbParameter()
end
 
parameterFuncs[16] = function ()
return self:_makeDeletionDiscussionLinkParameter()
end
 
parameterFuncs[17] = function ()
return self:_makeDeletionLogParameter()
end
self._params = params
self._params = params
Anonymous user