Module:Article history: Difference between revisions

Content deleted Content added
add the "messagebox" class to get the proper box width
add code to get action categories
Line 12:
 
-- Load required modules.
require('Module:No globals')
local Category = require('Module:Article history/Category')
local yesno = require('Module:Yesno')
local lang = mw.language.getContentLanguage()
Line 315 ⟶ 317:
 
return row
end
 
function Action:exportCategories(articleHistoryObj)
local categories = self.actionCfg.categories
if type(categories) == 'table' then
local ret = {}
for _, cat in ipairs(categories) do
ret[#ret + 1] = Category.new(cat)
end
return ret
elseif type(categories) == 'function' then
return categories(self, articleHistoryObj)
end
end
 
Line 539 ⟶ 554:
:css('font-size', '110%')
local noticeBarIcons = {}
for i, t in ipairs{notices, collapsiblenoticescollapsibleNotices, actions} do
for j, obj in ipairs(t) do
table.insert(noticeBarIcons, obj:exportNoticeBarIcon())
Line 587 ⟶ 602:
local ret = {}
for i, actionObj in ipairs(self:getActionObjects()) do
for j, categoryObj in ipairs(actionObj:exportCategories(self) or {}) do
ret[#ret + 1] = tostring(categoryObj)
end