Documentation for this module may be created at Module:PopupButton/doc
local util_args = require('Module:ArgsUtil')
local h = {}
local p = {}
function p.main(frame)
local args = util_args.merge(true)
if args.type == 'standings' then
return p.standings(nil, args.page)
elseif args.type == 'tth' then
return p.tth(nil, args.link, args.display, args.team)
end
end
function p.tth(tbl, link, display, team)
if not tbl then tbl = mw.html.create() end
tbl:tag('div')
:addClass('popup-button') -- general styling for outer table
:addClass('popup-button-tth') -- for js
:attr('data-tth-team', team)
:attr('data-tth-page', link)
:attr('data-tth-display', display)
return tbl
end
function p.standings(tbl, page, right)
if not tbl then tbl = mw.html.create() end
local div = tbl:tag('div')
:addClass('popup-button') -- for styling
:addClass('popup-button-standings') -- for js
:attr('data-standings-page', page)
if right then
div:addClass('popup-right')
end
return tbl
end
return p