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