Module:Lua banner: Difference between revisions

Jump to navigation Jump to search
Created page with "-- This module implements the {{lua}} template. local yesno = require('Module:Yesno') local mList = require('Module:List') local mTableTools = require('Module:TableTools') local mMessageBox = require('Module:Message box') local p = {} function p.main(frame) local origArgs = frame:getParent().args local args = {} for k, v in pairs(origArgs) do v = v:match('^%s*(.-)%s*$') if v ~= '' then args[k] = v end end return p._main(args) end function p._main(args)..."
imported>Fayenatic london
(Created page with "-- This module implements the {{lua}} template. local yesno = require('Module:Yesno') local mList = require('Module:List') local mTableTools = require('Module:TableTools') local mMessageBox = require('Module:Message box') local p = {} function p.main(frame) local origArgs = frame:getParent().args local args = {} for k, v in pairs(origArgs) do v = v:match('^%s*(.-)%s*$') if v ~= '' then args[k] = v end end return p._main(args) end function p._main(args)...")
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 [[Stiles.casa Wiki:Lua|Lua]]:\n' .. moduleList
boxArgs.text = 'This template  uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
end
end
end
end
Line 110: Line 110:
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
for i, module in ipairs(modules) do
for i, module in ipairs(modules) do
if module ~= "SW:libraryUtil" then
if module ~= "WP:libraryUtil" then
local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
local moduleProt = mw.title.new(module).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

Navigation menu