Diferencia entre revisiones de «Módulo:Lua banner»
m
1 revision imported
m (1 revisión importada) |
m (1 revision imported) |
||
Línea 35: | Línea 35: | ||
moduleLinks[i] = string.format('[[:%s]]', module) | moduleLinks[i] = string.format('[[:%s]]', module) | ||
local maybeSandbox = mw.title.new(module .. '/sandbox') | local maybeSandbox = mw.title.new(module .. '/sandbox') | ||
if maybeSandbox.exists then | if maybeSandbox and maybeSandbox.exists then | ||
moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText) | moduleLinks[i] = moduleLinks[i] .. string.format(' ([[:%s|sandbox]])', maybeSandbox.fullText) | ||
end | end | ||
Línea 85: | Línea 85: | ||
['Module:Math'] = 'Templates based on the Math Lua module', | ['Module:Math'] = 'Templates based on the Math Lua module', | ||
['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module', | ['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module', | ||
['Module:Citation'] = 'Templates based on the Citation/CS1 Lua module' | ['Module:Citation/CS1'] = 'Templates based on the Citation/CS1 Lua module' | ||
} | } | ||
category = modules[1] and categories[modules[1]] | category = modules[1] and categories[modules[1]] | ||
category = category or 'Lua-based templates' | category = category or 'Lua-based templates' | ||
Línea 111: | Línea 110: | ||
for i, module in ipairs(modules) do | for i, module in ipairs(modules) do | ||
if module ~= "WP:libraryUtil" then | if module ~= "WP:libraryUtil" then | ||
local | local moduleTitle = mw.title.new(module) | ||
local moduleProt = moduleTitle and moduleTitle.protectionLevels["edit"][1] | |||
if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end | if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end | ||
if moduleProt < currentProt then | if moduleProt < currentProt then |