"मोड्युल:Protection banner" का संशोधनहरू बिचको अन्तर
Content deleted Content added
सा Changed protection level of Module:Protection banner: High-risk Lua module: request at my talk page ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite)) |
bring changes from sandbox live |
||
पङ्क्ति २०:
local function makeCategoryLink(cat, sort)
local nsText = mw.site.namespaces[14].name▼
return string.format(
'[[%s:%s|%s]]',
cat,
sort
)
▲ elseif cat then
return ''▼
end
end
Line ४१ ⟶ ३२:
-- Validation function for the expiry and the protection date
local function validateDate(dateString, dateType)
lang = mw.language.getContentLanguage() end▼
local success, result = pcall(lang.formatDate, lang, 'U', dateString)
if success then
Line ५० ⟶ ४३:
end
error(string.format(
'invalid %s:
dateType,
tostring(dateString)
Line ६४ ⟶ ५७:
end
-- Given a directed graph formatted as node -> table of direct successors,
local function toTableEnd(t, pos)▼
-- get a table of all nodes reachable from a given node (though always
-- including the given node).
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
end▼
toWalk[k] = nil
retval[k] = true
for _,v in ipairs(
if not retval[v] then
toWalk[v] = true
Line ८४ ⟶ ७६:
end
end
end
Line १२२ ⟶ ११३:
else
error(string.format(
'invalid action:
tostring(args.action)
), 3)
Line २१४ ⟶ २०५:
-- Get the namespace key fragment.
local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace]
namespaceFragment =
▲ if not namespaceFragment and title.namespace % 2 == 1 then
▲ end
end
Line २४४ ⟶ २३२:
-- instead.
--]]
▲ end
--[[
Line ४९५ ⟶ ४७८:
if level == 'autoconfirmed' then
requestType = 'semi'
elseif level == 'extendedconfirmed' then
requestType = 'extended'
elseif level == 'templateeditor' then
requestType = 'template'
Line ७६१ ⟶ ७४६:
end
return setmetatable(obj, BannerTemplate)
end
Line ७७७ ⟶ ७५४:
return makeFileLink{
file = filename,
size = (self.
alt = self._imageAlt,
link = self._imageLink,
caption = self.
}
end
Line ७९३ ⟶ ७७०:
function Banner.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj
obj
obj._reasonText = blurbObj:makeBannerText('text')
obj._explanationText = blurbObj:makeBannerText('explanation')
Line ८२८ ⟶ ८०५:
function Padlock.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj
obj
obj._imageAlt = blurbObj:makeBannerText('alt')
obj._imageLink = blurbObj:makeBannerText('link')
Line ८४१ ⟶ ८१८:
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
Line ८८० ⟶ ८५५:
if protectionObj.action == 'edit' or
args.demolevel or
not
cfg.hierarchy,
protectionObj.level
|