Module:Clickable button 2: Difference between revisions

formatting tweaks
(fix data.style variable name)
(formatting tweaks)
Line 6:
 
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:Clickable button 2'})
wrappers = 'Template:Clickable button 2'
})
return p.luaMain(args)
end
Line 47 ⟶ 49:
local success, linkTitle = pcall(mw.title.new, args[1])
if success and mw.title.equals(currentTitle, linkTitle) then
if class == 'ui-button-blue' or class == 'mw-ui-progressive' then
or class == 'mw-ui-progressive'
then
data.backgroundColor = '#2962CB'
elseif class == 'ui-button-green' or class == 'mw-ui-constructive' then
or class == 'mw-ui-constructive'
then
data.backgroundColor = '#008B6D'
elseif class == 'ui-button-red' or class == 'mw-ui-destructive' then
or class == 'mw-ui-destructive'
then
data.backgroundColor = '#A6170F'
else
Line 61 ⟶ 69:
end
 
-- Get the link and display values, and find whether we are outputting a wikilink or a URL.
-- wikilink or a URL.
if args.url then
data.isUrl = true