Module:Category handler: திருத்தங்களுக்கு இடையிலான வேறுபாடு
உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
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. |
apply changes from sandbox as requested by Jackmcbarn which removes middleclass dependency |
||
வரிசை 15:
-- Load required modules
local yesno = require('Module:Yesno')
வரி 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 = pcall(mw.title.new, pagename)
if success and titleObj then
else
end
end
வரி 67 ⟶ 66:
-- 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)
வரி 80 ⟶ 79:
subpage = mw.ustring.lower(category2)
end
end
return obj
end
வரிசை 239:
function p._main(args, data)
data = data or mw.loadData('Module:Category handler/data')
local handler = CategoryHandler
if handler:isSuppressed() then
return nil
| |||