Autopatrolled users, Bots, Bureaucrats, Confirmed users, Interface administrators, Rollbackers, Administrators, Upload Wizard campaign editors
243
edits
(Rewrite this using Module:Middleclass. It is now more efficient: it only parses parameters when necessary, and caches data with mw.loadData where it can.) |
m (28 revisions imported) Tags: Mobile edit Mobile web edit |
||
(15 intermediate revisions by 13 users not shown) | |||
Line 15:
-- Load required modules
local yesno = require('Module:Yesno')
Line 47 ⟶ 46:
--------------------------------------------------------------------------------
local CategoryHandler =
CategoryHandler.__index = CategoryHandler
function CategoryHandler
local obj = setmetatable({ _data = data, _args = args }, CategoryHandler)
-- Set the title object
do
local pagename =
local success, titleObj
if pagename then
success, titleObj = pcall(mw.title.new, pagename)
end
if success and titleObj then
if titleObj == mw.title.getCurrentTitle() then
obj._usesCurrentTitle = true
end
else
end
end
Line 67 ⟶ 72:
-- Set suppression parameter values
for _, key in ipairs{'nocat', 'categories'} do
local value =
value = trimWhitespace(value, true)
end
do
local subpage =
local category2 =
if type(subpage) == 'string' then
subpage = mw.ustring.lower(subpage)
Line 80 ⟶ 85:
subpage = mw.ustring.lower(category2)
end
end
return obj
end
Line 239 ⟶ 245:
function p._main(args, data)
data = data or mw.loadData('Module:Category handler/data')
local handler = CategoryHandler
if handler:isSuppressed() then
return nil
|