Module:Navbar/sandbox: Difference between revisions

Content deleted Content added
extract the right way
m Removed protection from "Module:Navbar/sandbox"
 
(32 intermediate revisions by 8 users not shown)
Line 52:
end
 
local function make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace)
Line 68:
['link'] = talkpage, ['url'] = false },
{ ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template',
['link'] = title'Special:fullUrl(EditPage/'action=edit') .. title.fullText, ['url'] = truefalse },
{ ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template',
['link'] = title'Special:fullUrl(PageHistory/'action=history') .. title.fullText, ['url'] = truefalse },
{ ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template',
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true },
Line 134:
local title_arg = get_title_arg(is_collapsible, template)
local title_text = args[title_arg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
local links = ''
local list = make_list(title_text, has_brackets, displayed_links, font_style)
if args.vte_links_override then
div:node(list)
links = args.vte_links_override
div:wikitext(links)
else
local list links = make_list(title_text, has_brackets, displayed_links, is_mini, font_style)
div:node(listlinks)
end
 
if is_collapsible then
Line 150 ⟶ 156:
:wikitext(args[1])
end
 
local frame = mw.getCurrentFrame()
-- TODO: Support some limited parameters worth of templatestyles so that
-- hlist -> navbar is best-effort to preserve old Common.css ordering.
-- these styles can be easily overridden if desired.
return mw.getCurrentFrame()frame:extensionTag{
name = 'templatestyles', args = { src = cfg.hlist_templatestyles }
} .. frame:extensionTag{
name = 'templatestyles', args = { src = cfg.templatestyles }
} .. tostring(div:done())