跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
天灾之下:危险连接官网(建设中)
天灾之下:危险连接QQ群
天灾之下:危险连接 Bilibili
冰糖服务器
冰糖服务器QQ群
天灾之下:危险连接资料站
搜索
搜索
中文(中国大陆)
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁模块:RichTab”︁的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
[[雷光]]
外观
移至侧栏
隐藏
←
模块:RichTab
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} function p.render(frame) -- =p.render{args={'a1','a2','b1','b2','c1','c2'}} local args = (frame.getParent and frame:getParent() or frame).args local tabParams = {} local i = 1 while args[i] and args[i + 1] do table.insert(tabParams, args[i]) table.insert(tabParams, args[i + 1]) i = i + 2 end if #tabParams == 0 then return '' end local htmlNav = '' local htmlContent = '' local index = 1 local hash = mw.hash.hashValue('sha1', table.concat(tabParams)) local prefix = 'tab-' .. (args['prefix'] and args['prefix']..'-' or '') .. hash .. '-' local a2 = mw.ext.mustache.render('RichTab/a2', {}) for index = 1,#tabParams,2 do local id = prefix .. (index - 1) / 2 local state = index==1 and 'active' or '' local a1 = mw.ext.mustache.render('RichTab/a1', {tabId=id}) htmlNav = htmlNav..'<li role="presentation" class="'..state..'">'..a1..mw.getCurrentFrame():preprocess(tabParams[index])..a2..'</li>' htmlContent = htmlContent..'<div role="tabpanel" class="tab-pane '..state..'" id="'..id..'">'..mw.getCurrentFrame():preprocess(tabParams[index + 1])..'</div>' end return '<div>' ..'<ul class="nav '..(args['class'] or 'nav-tabs')..'" role="tablist">' ..htmlNav ..'</ul>' ..'<div class="tab-content">' ..htmlContent ..'</div>' ..'</div>' end return p
该页面嵌入的页面:
模块:RichTab/doc
(
查看源代码
)
返回
模块:RichTab
。
搜索
搜索
查看“︁模块:RichTab”︁的源代码
添加语言
添加话题