Module:GFNav:修订间差异
来自OGAS数据中枢
更多操作
无编辑摘要 |
无编辑摘要 |
||
| 第14行: | 第14行: | ||
local item = nav:tag('div'):addClass('gfl-item') | local item = nav:tag('div'):addClass('gfl-item') | ||
-- | local switchId = 'gfl-switch-' .. i | ||
item:tag(' | |||
item:tag('input') | |||
:addClass('gfl-switch') | |||
:attr('type', 'checkbox') | |||
:attr('id', switchId) | |||
item:tag('label') | |||
:addClass('gfl-title') | |||
:attr('for', switchId) | |||
:wikitext(args['标题' .. i]) | |||
local content = item:tag('div'):addClass('gfl-content') | local content = item:tag('div'):addClass('gfl-content') | ||
local wrap = content:tag('div'):addClass('gfl-links-wrap') | local wrap = content:tag('div'):addClass('gfl-links-wrap') | ||
2026年5月7日 (四) 06:53的版本
此模块的文档可以在Module:GFNav/doc创建
local p = {}
local getArgs = require('Module:Arguments').getArgs
function p.main(frame)
local args = getArgs(frame)
local nav = mw.html.create('div'):addClass('gfl-nav-compact')
if args.LOGO then
nav:tag('div'):addClass('gfl-logo-box'):wikitext(args.LOGO)
end
local i = 1
while args['标题' .. i] do
local item = nav:tag('div'):addClass('gfl-item')
local switchId = 'gfl-switch-' .. i
item:tag('input')
:addClass('gfl-switch')
:attr('type', 'checkbox')
:attr('id', switchId)
item:tag('label')
:addClass('gfl-title')
:attr('for', switchId)
:wikitext(args['标题' .. i])
local content = item:tag('div'):addClass('gfl-content')
local wrap = content:tag('div'):addClass('gfl-links-wrap')
wrap:wikitext(frame:preprocess(args['栏目' .. i] or ''))
i = i + 1
end
return frame:extensionTag('templatestyles', '', {src = 'Template:少女前线:导航/styles.css'}) .. tostring(nav)
end
return p