Minecraft Wiki
Advertisement

La documentazione per questo modulo può essere creata in Modulo:Tasti/doc

local p = {}
p.tasti = function( f )
	local args = f
	if f == mw.getCurrentFrame() then
		args = f:getParent().args
	end
	local tasti = {}
	
	for _, tasto in ipairs( args ) do
		tasto = mw.text.trim( tasto )
		if tasto ~= '+' and tasto:find( '%+' ) then
			local comboKeys = {}
			for comboKey in mw.text.gsplit( tasto, '%s*%+%s*' ) do
				table.insert( comboKeys, p.tasto( comboKey ) )
			end
			table.insert( tasti, table.concat( comboKeys, ' + ' ) )
		else
			table.insert( tasti, p.tasto( tasto ) )
		end
	end
	
	return table.concat( tasti )
end

p.tasto = function( tasto )
	if tasto == '' then
		return ''
	end
	
	local symbols = mw.loadData( 'Modulo:Tasti/Simboli' )
	return '<kbd class="key nowrap" style="' .. table.concat( {
		'background-color: #f8f9fa',
		'color: #222',
		'font-size: 80%',
		'font-family: inherit',
		'font-weight: bold',
		'border: 1px solid #c8ccd1',
		'border-radius: 2px',
		'box-shadow: 0 1px 0 rgba(0,0,0,0.2), 0 0 0 2px #fff inset',
		'padding: 0.1em 0.4em',
		'text-shadow: 0 1px 0 #fff',
		'text-align: center'
	}, ';' ) .. '">' .. ( symbols[tasto:lower()] or tasto ) .. '</kbd>'
end
return p
Advertisement