Changes
export classes for testing purposes and a few other tweaks
function Config:getConfigTable(key)
local whitelisted blacklist = { images banners = true, categories = true, categoryNamespaces = true, pagetypeNamespaces = true, errorCategories defaultBanners = true
}
if whitelistednot blacklist[key] then
return self._cfg[key]
else
local ProtectionBanner = {}
local args = mArguments.getArgs(frame)
return ProtectionBanner.exportToLua(args, titleObjtitle)
end
function ProtectionBanner.exportToLua(args, title)
title = title or mw.title.getCurrentTitle()
local pstatus = ProtectionStatus.new(args, title)
local cfg = Config:new()
-- Get the banner template object
local banner
do
local bannerClass
if yesno(args.small) then
bannerClass = Padlock
else
bannerClass = Banner
end
banner = bannerClass:new()
end
end
function ProtectionBanner._exportClasses()
return {
ProtectionStatus = ProtectionStatus,
Config = Config,
Image = Image,
Blurb = Blurb,
BannerTemplate = BannerTemplate,
Banner = Banner,
Padlock = Padlock,
Category = Category,
ProtectionCategory = ProtectionCategory,
ErrorCategory = ErrorCategory,
ExpiryCategory = ExpiryCategory
}
end
return ProtectionBanner