Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Tt

From BlazBlue Wiki

Documentation for this module may be created at Module:Tt/doc

local p = {}
local cargo = mw.ext.cargo

function p.Main( frame )
	text = frame.args[1] or ''
	tooltip = frame.args[2] or ''
	line = frame.args['line'] or ''
	align = frame.args['align'] or 'default'
	
	if line == 'false' then
		tooltip_style = 'border-bottom: 0;'
	else
		tooltip_style = ''
	end
	
	parts = {
		'<span class="tooltip" style="',tooltip_style,'">',
		text,
		'<span class="tooltiptext" style="text-align:',align,'">',
		tooltip,
		'</span></span>'
	}
	mw.log(concatvalues(parts,""))
	return concatvalues(parts,"")
end

-- concat all the strings in table s together with the given delimiter
function concatvalues(s,delimiter)
    local t = { }
    for k,v in ipairs(s) do
        t[#t+1] = tostring(v)
    end
    return table.concat(t,delimiter)
end

return p