Autopatrolled users, Bots, Bureaucrats, Confirmed users, Interface administrators, Rollbackers, Administrators, Upload Wizard campaign editors
243
edits
(add a getArgKeys function, so that we can have multiple keys for each argument (helpful for localisation) and so that we only have to create that table once per page) |
m (31 revisions imported) Tags: Mobile edit Mobile web edit |
||
(27 intermediate revisions by 18 users not shown) | |||
Line 13:
end
-- This allows wikis to customise parameter names in the cfg table while
▲ -- Returns a table of parameters to query for each default parameter name.
▲ -- values can be added as a string, or as an array of strings.
'demopage'
for i, defaultKey in ipairs(defaultKeys) do
local cfgValueType = type(cfgValue)▼
argKeys[defaultKey] = {defaultKey}
if cfgValueType == 'string' then▼
addKey(t, cfgValue, defaultKey)▼
elseif cfgValueType == 'table' then▼
▲ end
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.▼
end
end
Line 53 ⟶ 57:
-- }
--]]
local subjectNamespaces = mw.site.subjectNamespaces▼
local mappings = {}
mainNsName = mw.ustring.lower(mainNsName)
mappings[talk] = {talk}▼
mappings[mainNsName] = mw.clone(argKeys.main)
if nsid ~= 0 then -- Exclude main namespace.
local nsname =
local canonicalName =
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
end
for _, alias in ipairs(ns.aliases) do
end
end
Line 77 ⟶ 79:
return {
argKeys =
cfg = cfg,
mappings = getParamMappings()
|