Anonymous user
Module:Protection banner: Difference between revisions
try different format for behaviors table
Enwikipedia>Mr. Stradivarius (beautify the categories table) |
Enwikipedia>Mr. Stradivarius (try different format for behaviors table) |
||
Line 6:
--------------------------------------------------------------------------------
local
cfg.reasons = {
blp = {
},
dispute = {
},
},
sock = {
behavior = 'reasonFirst'
},
behavior = 'namespaceFirst'
},
}▼
cfg.protectionLevels = {
foo
}
cfg.categories = {
-- The key strings follow this format:
-- type, level, ns, reason, expiry
Line 52 ⟶ 76:
}
[2] = 'user',
[3] = 'user',
Line 63 ⟶ 87:
}
▲ vandalism = 'namespaceFirst',
▲ dispute = 'reasonFirst',
▲ blp = 'reasonFirst',
▲ sock = 'reasonFirst',
▲ office = 'reasonFirst',
▲}
▲local pagetypeNamespaces = {
[0] = 'article',
[6] = 'file',
Line 128 ⟶ 144:
return nil
end
local nskey = cfg.categoryNamespaces[ns]
if not nskey and ns % 2 == 1 then
nskey = 'talk'
Line 141 ⟶ 157:
-- reason for protection, and the expiry date.
--]]
cats = cats or cfg.categories
--[[
Line 167 ⟶ 183:
behavior = 'reasonFirst'
else
behavior =
end
if behavior == 'namespaceFirst' then
|