求真百科歡迎當事人提供第一手真實資料,洗刷冤屈,終結網路霸凌。

變更

前往: 導覽搜尋

模块:Sidebar

增加 8 位元組, 7 年前
update from sandbox per discussion on talk page
else
return s
end
end
 
local function hasSubgroup(s)
if mw.ustring.find(s, 'vertical%-navbox%-subgroup') then
return true
else
return false
end
end
local child = args.child and mw.text.trim(args.child) == 'yes'
root = root:tag('table')
if not child then
root = root :tag('table')
:addClass('vertical-navbox')
:addClass(args.wraplinks ~= 'true' and 'nowraplinks' or nil)
:wikitext(args.pretitle)
end
else root :addClass('vertical-navbox-subgroup') :css('width', '100%') :css('margin', '0px') :css('border-spacing', '0px') :addClass(args.bodyclass or args.class) :cssText(args.bodystyle or args.style)
end
root
:wikitext(args.title)
:wikitext('</th></tr>') -- @todo replace this with unclosed again once mw.html gets it
else
root
:wikitext(args.title)
end
end
 
if args.posttitle then
root
:tag('tr')
:tag('td')
:addClass(args.posttitleclass or args.pretitleclass)
:cssText(args.basestyle)
:css('position', 'relative')
:css('padding-top', args.topimage and '0.2em' or '0.4em')
:css('line-height', '1.2em')
:cssText(args.posttitlestyle or args.pretitlestyle)
:wikitext(args.posttitle)
end
:tag('td')
:addClass(args.contentclass)
:css('padding', hasSubgroup(content) and '0.1em 0 0.2em' or '0 0.1em 0.4em')
:cssText(args.contentstyle)
:cssText(args['content' .. num .. 'style'])
end
return tostring(root) .. (child and '[[Category:Pages using sidebar with the child parameter]]' or '')
end