Module:Article history: Difference between revisions

Content deleted Content added
use different message formats for warnings and for errors
split out notice bar icon code into its own method, and add notice bar icons from self.cfg.noticeBarIcons
Line 1,014:
if addSelf then
ret[#ret + 1] = self
end
return ret
end
 
function ArticleHistory:getNoticeBarIcons()
local ret = {}
-- Icons that aren't part of a row.
if self.cfg.noticeBarIcons then
for j_, objdata in ipairs(tself.cfg.noticeBarIcons) do
if data.isActive(self) then
ret[#ret + 1] = renderImage(
data.icon,
endnil,
data.size or self.cfg.defaultNoticeBarIconSize
)
end
end
end
-- Icons in row objects.
for _, obj in ipairs(self:getAllObjects()) do
table.insert(noticeBarIcons,ret[#ret + 1] = obj:exportNoticeBarIcon()self)
end
return ret
Line 1,128 ⟶ 1,149:
-- Notice bar
if isCollapsed then
local noticeBarIcons = {}self:getNoticeBarIcons()
for i, t in ipairs{notices, collapsibleNotices, actions} do
for j, obj in ipairs(t) do
table.insert(noticeBarIcons, obj:exportNoticeBarIcon())
end
end
if #noticeBarIcons > 0 then
local noticeBar = ctHeader:tag('span'):css('float', 'left')