Editing Module:Sidebar
Appearance
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
require(' | -- | ||
-- This module implements {{Sidebar}} | |||
-- | |||
require('Module:No globals') | |||
local cfg = mw.loadData('Module:Sidebar/configuration') | local cfg = mw.loadData('Module:Sidebar/configuration') | ||
Line 51: | Line 54: | ||
return false | return false | ||
end | end | ||
end | end | ||
Line 138: | Line 65: | ||
args = getArgs(frame) | args = getArgs(frame) | ||
end | end | ||
local root = mw.html.create() | local root = mw.html.create() | ||
local child = args.child and mw.text.trim(args.child) == cfg.i18n.child_yes | local child = args.child and mw.text.trim(args.child) == cfg.i18n.child_yes | ||
Line 151: | Line 77: | ||
:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none 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.float == cfg.i18n.float_left and cfg.i18n.class.float_left or nil) | ||
:addClass(args.wraplinks | :addClass(args.wraplinks == cfg.i18n.wrap_true and cfg.i18n.class.wraplinks or nil) | ||
:addClass(args.bodyclass or args.class) | :addClass(args.bodyclass or args.class) | ||
:css('width', args.width or nil) | :css('width', args.width or nil) | ||
Line 309: | Line 235: | ||
end | end | ||
if not child and | if not child then | ||
if args.navbar ~= cfg.i18n.navbar_none and args.navbar ~= cfg.i18n.navbar_off and | |||
(args.name or frame:getParent():getTitle():gsub(cfg.i18n.pattern.sandbox, '') ~= | |||
cfg.i18n.title_not_to_add_navbar) then | |||
root | |||
:tag('tr') | |||
:tag('td') | |||
:addClass(cfg.i18n.class.navbar) | |||
:cssText(args.navbarstyle) | |||
:wikitext(require('Module:Navbar')._navbar{ | |||
args.name, | |||
mini = 1, | |||
fontstyle = args.navbarfontstyle | |||
}) | |||
end | |||
end | end | ||
Line 348: | Line 278: | ||
return table.concat({ | return table.concat({ | ||
base_templatestyles, | base_templatestyles, | ||
templatestyles, | templatestyles, | ||
child_templatestyles, | child_templatestyles, | ||
grandchild_templatestyles, | grandchild_templatestyles, | ||
tostring(root), | tostring(root), | ||
(child and cfg.i18n.category.child or ''), | (child and cfg.i18n.category.child or ''), | ||
Line 383: | Line 311: | ||
:cssText(args.basestyle) | :cssText(args.basestyle) | ||
:cssText(args.listtitlestyle) | :cssText(args.listtitlestyle) | ||
:cssText(args['list' .. num .. 'titlestyle']) | :cssText(args['list' .. num .. 'titlestyle']) | ||
:node(title) | :node(title) | ||
Line 406: | Line 333: | ||
local contentArgs = {} | local contentArgs = {} | ||
local is_centered_list_titles | local is_centered_list_titles | ||
if args['centered | if args['centered collapsible titles'] and args['centered collapsible titles'] ~= '' then | ||
is_centered_list_titles = true | is_centered_list_titles = true | ||
else | |||
is_centered_list_titles = false | |||
end | end | ||