Changes
bring changes from sandbox live
local function makeCategoryLink(cat, sort)
return string.format(
'[[%s:%s|%s]]',
cat,
sort
)
end
end
-- Validation function for the expiry and the protection date
local function validateDate(dateString, dateType)
if not lang then lang = lang or mw.language.getContentLanguage() end
local success, result = pcall(lang.formatDate, lang, 'U', dateString)
if success then
end
error(string.format(
'invalid %s (": %s")',
dateType,
tostring(dateString)
end
local toWalk, retval = {[start] = true}, {}
while true do
-- Can't use pairs() since we're adding and removing things as we're iterating
local k = next(toWalk) -- This always gets the "first" key
if k == nil then break return retval end
toWalk[k] = nil
retval[k] = true
for _,v in ipairs(hierarchygraph[k]) do
if not retval[v] then
toWalk[v] = true
end
end
end
else
error(string.format(
'invalid action (": %s")',
tostring(args.action)
), 3)
-- Get the namespace key fragment.
local namespaceFragment do namespaceFragment = cfg.categoryNamespaceKeys[title.namespace] if not namespaceFragment and title.namespace % 2 == 1 then namespaceFragment = 'talk' end
end
-- instead.
--]]
--[[
if level == 'autoconfirmed' then
requestType = 'semi'
elseif level == 'extendedconfirmed' then
requestType = 'extended'
elseif level == 'templateeditor' then
requestType = 'template'
end
return setmetatable(obj, BannerTemplate)
end
return makeFileLink{
file = filename,
size = (self._imageWidth imageWidth or 20) .. 'px',
alt = self._imageAlt,
link = self._imageLink,
caption = self._imageCaptionimageCaption
}
end
function Banner.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj:setImageWidth(.imageWidth = 40) obj:setImageTooltip(.imageCaption = blurbObj:makeBannerText('alt')) -- Large banners use the alt text for the tooltip.
obj._reasonText = blurbObj:makeBannerText('text')
obj._explanationText = blurbObj:makeBannerText('explanation')
function Padlock.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj:setImageWidth(.imageWidth = 20) obj:setImageTooltip(.imageCaption = blurbObj:makeBannerText('tooltip'))
obj._imageAlt = blurbObj:makeBannerText('alt')
obj._imageLink = blurbObj:makeBannerText('link')
local frame = mw.getCurrentFrame()
-- The nowiki tag helps prevent whitespace at the top of articles.
name = 'indicator',
args = {name = self._indicatorName},
content = self:renderImage()
}
end
if protectionObj.action == 'edit' or
args.demolevel or
not walkHierarchygetReachableNodes(
cfg.hierarchy,
protectionObj.level