Module:Lua banner: Difference between revisions

Jump to navigation Jump to search
93 bytes added ,  01:08, 19 February 2025
m
1 revision imported: importing tree chart
en>Uzume
(Module:Citation has been blanked since Wikipedia:Templates for discussion/Log/2018 May 13; remove special handling)
m (1 revision imported: importing tree chart)
 
(7 intermediate revisions by 5 users not shown)
Line 35: Line 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
Line 47: Line 47:
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
boxArgs.text = 'This module depends on the following other modules:' .. moduleList
else
else
boxArgs.text = 'This template  uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
boxArgs.text = 'This template  uses [[Wikipedia:Lua (programming language)|Lua]]:\n' .. moduleList
end
end
end
end
Line 110: Line 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 moduleProt = mw.title.new(module).protectionLevels["edit"][1]
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

Navigation menu