Jump to content

Module:Infobox road/color/sandbox

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Fredddie (talk | contribs) at 06:31, 13 February 2021. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {} 

local format = mw.ustring.format
local insert = table.insert
local concat = table.concat
local getArgs = require('Module:Arguments').getArgs	
local parserModule = require "Module:Road data/parser"
local parser = parserModule.parser

local function location(args)
	local state = args.state or args.province or ''
	args.state = state
	local country
	if args.country and args.country ~= '' then
		country = string.upper(args.country)
	else
		local countryModule = mw.loadData("Module:Road data/countrymask")
		country = countryModule[state] or 'UNK'
	end
	args.country = country
end

function p.header(args, frame)
	local color = parser(args, 'color')
	if color == '' or color == nil then
		return tostring("background:#006A4D; color:#fff;") -- "background:#cedff2;"
	else return color
	end
end

function p.border(args, frame)
	local border = parser(args, 'border')
	if border == '' or border == nil then
		return tostring("#006A4D;") -- "background:#cedff2;"
		else return border
	end
end

return p