Diferencia entre revisiones de «Módulo:Navbar»
wikitves>Onwa Actualización, sincronizando con los últimos cambios en enwiki; pronto actualizaré las plantillas colaterales y los artículos que las utilizan todas |
wikitves>Izno remove unnecessary line |
||
Línea 1: | Línea 1: | ||
local p = {} | local p = {} | ||
local cfg = mw.loadData(' | local cfg = mw.loadData('Module:Navbar/configuration') | ||
local function get_title_arg(is_collapsible, template) | local function get_title_arg(is_collapsible, template) | ||
Línea 56: | Línea 56: | ||
local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace) | local title = mw.title.new(mw.text.trim(title_text), cfg.title_namespace) | ||
if not title then | if not title then | ||
error(cfg.invalid_title .. title_text) | |||
end | end | ||
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or '' | local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or '' | ||
Línea 64: | Línea 63: | ||
-- link_descriptions should be easier... | -- link_descriptions should be easier... | ||
local link_descriptions = { | local link_descriptions = { | ||
{ ['mini'] = 'v', ['full'] = ' | { ['mini'] = 'v', ['full'] = 'view', ['html_title'] = 'View this template', | ||
['link'] = title.fullText, ['url'] = false }, | ['link'] = title.fullText, ['url'] = false }, | ||
{ ['mini'] = 't', ['full'] = ' | { ['mini'] = 't', ['full'] = 'talk', ['html_title'] = 'Discuss this template', | ||
['link'] = talkpage, ['url'] = false }, | ['link'] = talkpage, ['url'] = false }, | ||
{ ['mini'] = 'e', ['full'] = ' | { ['mini'] = 'e', ['full'] = 'edit', ['html_title'] = 'Edit this template', | ||
['link'] = title:fullUrl('action=edit'), ['url'] = true }, | ['link'] = title:fullUrl('action=edit'), ['url'] = true }, | ||
{ ['mini'] = 'h', ['full'] = ' | { ['mini'] = 'h', ['full'] = 'hist', ['html_title'] = 'History of this template', | ||
['link'] = title:fullUrl('action=history'), ['url'] = true }, | ['link'] = title:fullUrl('action=history'), ['url'] = true }, | ||
{ ['mini'] = 'm', ['full'] = ' | { ['mini'] = 'm', ['full'] = 'move', ['html_title'] = 'Move this template', | ||
['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true }, | ['link'] = mw.title.new('Special:Movepage'):fullUrl('target='..title.fullText), ['url'] = true }, | ||
{ ['mini'] = 'w', ['full'] = ' | { ['mini'] = 'w', ['full'] = 'watch', ['html_title'] = 'Watch this template', | ||
['link'] = title:fullUrl('action=watch'), ['url'] = true } | ['link'] = title:fullUrl('action=watch'), ['url'] = true } | ||
} | } | ||
Línea 158: | Línea 157: | ||
function p.navbar(frame) | function p.navbar(frame) | ||
return p._navbar(require(' | return p._navbar(require('Module:Arguments').getArgs(frame)) | ||
end | end | ||
return p | return p |