Module:Article history: Difference between revisions

Content deleted Content added
split out notice bar icon code into its own method, and add notice bar icons from self.cfg.noticeBarIcons
cache the result of ArticleHistory:getAllObjects
Line 767:
obj.isSmall = yesno(obj.args.small) or false
 
-- Define theobject error tablestructure.
obj.errors = {}
obj._allObjectsCache = {}
-- Format the config
Line 997 ⟶ 998:
 
function ArticleHistory:getAllObjects(addSelf)
local cacheKey = addSelf and 'addSelf' or 'default'
local ret = {}
local statusObjret = self:getStatusObj()._allObjectsCache[cacheKey]
if statusObjnot ret then
ret[#ret + 1] = statusObj{}
local statusObj = self:getStatusObj()
end
if addSelfstatusObj then
local objTables = {
ret[#ret + 1] = objstatusObj
self:getNoticeObjects(),
self:getActionObjects(),
self:getCollapsibleNoticeObjects()
}
for i, t in ipairs(objTables) do
for j, obj in ipairs(t) do
ret[#ret + 1] = obj
end
local retobjTables = {}
end
self:getNoticeObjects(),
if addSelf then
self:getActionObjects(),
ret[#ret + 1] = self
self:getCollapsibleNoticeObjects()
}
for i, t in ipairs(objTables) do
for j, obj in ipairs(t) do
ret[#ret + 1] = obj
end
end
if addSelf then
ret[#ret + 1] = self
end
self._allObjectsCache[cacheKey] = ret
end
return ret