Module:Sidebar:修订间差异
删除的内容 添加的内容
enwiki>Ahecht Re-add optimizations for child=yes (avoid duplicated templatestyles and categories). Implement :attr('role', 'navigation') per edit request on talk page. |
IdleTap-bot(留言 | 贡献) 导入自求闻百科 |
||
第45行:
Finds whether a sidebar has a subgroup sidebar.
]]
local function
if mw.ustring.find(s, cfg.i18n.pattern.subgroup) then
return true
第81行:
end
return false
name = 'templatestyles', args = { src = templatestyles }▼
end
第116行 ⟶ 第87行:
-- table. then remove all templatestyles markers from the arg
local function move_hiding_templatestyles(args)
local
local gsub = string.gsub
local templatestyles_markers = {}
local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'
for k, arg in pairs(args) do
for marker in
table.insert(templatestyles_markers, marker)
end
第144行 ⟶ 第115行:
root = root:tag('table')
if not child then
root
:addClass(cfg.i18n.class.sidebar)
-- force
:addClass(collapsibleClass == cfg.i18n.class.collapse and cfg.i18n.class.collapse or nil)
:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none or nil)
:addClass(args.float == cfg.i18n.float_left and cfg.i18n.class.float_left or nil)
:addClass(args.wraplinks ~= cfg.i18n.wrap_true and cfg.i18n.class.wraplinks or nil)
:addClass(args.bodyclass or args.class)
:css('width', args.width or nil)
:cssText(args.bodystyle or args.style)
第263行 ⟶ 第232行:
end
for i, num in ipairs(rowNums) do
local heading = args['heading' .. num]
第282行 ⟶ 第250行:
local content = args['content' .. num]
if content then
local baseContentClass = cfg.i18n.class.content▼
root
:tag('tr')
:tag('td')
:addClass(
:addClass(args.contentclass)
:addClass(args['content' .. num .. 'class'])
第320行 ⟶ 第284行:
:tag('td')
:addClass(cfg.i18n.class.navbar)
:css('line-height', '1.6')
:cssText(args.navbarstyle)
:wikitext(require('Module:Navbar')._navbar{
第328行 ⟶ 第293行:
end
local base_templatestyles =
▲ }
local templatestyles = ''
第355行 ⟶ 第317行:
}
end
local differential_names = args.name ~= mw.title.getCurrentTitle().text and mw.title.getCurrentTitle():inNamespace('Template')
return table.concat({
base_templatestyles,
templatestyles,
第364行 ⟶ 第327行:
hiding_templatestyles,
tostring(root),
(
((differential_names and args.tracking ~= 'no') and '[[Category:Name參數和實際不同的導航框]]' or ''),
categorizeTemplatesWithInlineStyles(args)
})
第392行 ⟶ 第356行:
:cssText(args.basestyle)
:cssText(args.listtitlestyle)
:cssText(args['list' .. num .. 'titlestyle'])
:node(title)
第411行 ⟶ 第374行:
cfg.i18n.collapse_title_not_to_add_navbar then
args.navbar = cfg.i18n.navbar_none
args.tracking = 'no'
end
| |||