Jump to content

Module:Clickable button

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 10:09, 10 June 2014 (start work on a replacement for Template:Clickable button 2). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

-- 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