Jump to content

Module:Road data/size/sandbox: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
use require('strict') instead of require('Module:No globals')
Syncing sandbox code with main template (sync-template-sandbox.js)
Line 1: Line 1:
require("strict")

local p = {}
local p = {}


require('strict')
local getArgs = require('Module:Arguments').getArgs
local getArgs = require('Module:Arguments').getArgs
local format = mw.ustring.format
local format = mw.ustring.format
Line 7: Line 8:
local function main(args)
local function main(args)
local style = args.style
local style = args.style
if style == 'infobox' then
if style == 'infobox' then
return '70', '150'
return '72px'
elseif style == 'small' then
elseif style == 'small' then
return '40', '90'
return '40px'
elseif style == 'list' then
elseif style == 'list' then
return '25', '60'
return '32px'
elseif style == 'rdt' then
else
return '20', '50'
return '17px'
else return '24px'
end
end
end
end

Revision as of 07:04, 22 August 2024

require("strict")

local p = {}

local getArgs = require('Module:Arguments').getArgs
local format = mw.ustring.format

local function main(args)
	local style = args.style
	if style == 'infobox' then
		return '72px'
	elseif style == 'small' then
		return '40px'
	elseif style == 'list' then
		return '32px'
	elseif style == 'rdt' then
		return '17px'
	else return '24px'
	end
end

function p._size(args)
	return main(args)
end

function p.size(frame)
	local args = getArgs(frame)
	return p._size(args);
end

return p