七日内新公告:全站维护公告
  • 你好~!欢迎来到萌娘百科镜像站!如需查看或编辑,请联系本站管理员注册账号。
  • 本镜像站和其他萌娘百科的镜像站无关,请注意分别。

Module:PopupButton

猛汉♂百科,万男皆可猛的百科全书!转载请标注来源页面的网页链接,并声明引自猛汉百科。内容不可商用。
跳转到导航 跳转到搜索
模块文档  [创建] [刷新]
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