Editing Module:Sidebar
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
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 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 405: | Line 333: | ||
local contentArgs = {} | local contentArgs = {} | ||
local is_centered_list_titles | local is_centered_list_titles | ||
if args['centered list titles'] and args['centered list titles'] ~= '' then | if args['centered list titles'] and args['centered list titles'] ~= '' then | ||
is_centered_list_titles = true | is_centered_list_titles = true | ||
else | |||
is_centered_list_titles = false | |||
end | end | ||