Module:Clickable button 2

From escforumwiki
Revision as of 10:09, 10 June 2014 by en>Mr. Stradivarius (start work on a replacement for Template:Clickable button 2)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:Clickable button 2/doc

-- This module implements {{clickable button 2}}.

local p = {}

function p.main(frame)
	local args = require('Module:Arguments').getArgs(frame)
	return p.luaMain(args)
end

function p.luaMain(args)
end

function p.renderUrlButton(data)
end

function p.renderWikilinkButton(data)
end

function p.renderDisplaySpan(data)
	local span = mw.html.create('span')
	for i, class in ipairs(data.classes or {}) do
		span:addClass(class)
	end
	span
		:attr('role', 'button')
		:attr('aria-disabled', 'false')
		:css{
			['background-color'] = data.backgroundColor,
			color = data.color
		}
	if data.style then
		span:cssText(style)
	end
	span:wikitext(data.display)
	return tostring(span)
end

return p