Diferencia entre revisiones de «Módulo:Navbar»
m 1 revisión importada |
wikitves>LuchoCR m Protegió «Módulo:Navbar» ([Editar=Solo bibliotecarios] (indefinido) [Trasladar=Solo bibliotecarios] (indefinido)) |
||
Línea 1: | Línea 1: | ||
local p = {} | local p = {} | ||
local cfg = mw.loadData(' | local cfg = mw.loadData('Módulo:Navbar/configuración') | ||
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) | -- error(cfg.invalid_title .. title_text) -- diferente a en la Wikipedia inglesa | ||
return | |||
end | end | ||
local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or '' | local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or '' | ||
Línea 63: | Línea 64: | ||
-- link_descriptions should be easier... | -- link_descriptions should be easier... | ||
local link_descriptions = { | local link_descriptions = { | ||
{ ['mini'] = 'v', ['full'] = ' | { ['mini'] = 'v', ['full'] = 'ver', ['html_title'] = 'Ver esta plantilla', | ||
['link'] = title.fullText, ['url'] = false }, | ['link'] = title.fullText, ['url'] = false }, | ||
{ ['mini'] = 't', ['full'] = ' | { ['mini'] = 't', ['full'] = 'discusión', ['html_title'] = 'Conversar sobre esta plantilla', | ||
['link'] = talkpage, ['url'] = false }, | ['link'] = talkpage, ['url'] = false }, | ||
{ ['mini'] = 'e', ['full'] = ' | { ['mini'] = 'e', ['full'] = 'editar', ['html_title'] = 'Editar esta plantilla', | ||
['link'] = title:fullUrl('action=edit'), ['url'] = true }, | ['link'] = title:fullUrl('action=edit'), ['url'] = true }, | ||
{ ['mini'] = 'h', ['full'] = ' | { ['mini'] = 'h', ['full'] = 'historial', ['html_title'] = 'Historial de esta plantilla', | ||
['link'] = title:fullUrl('action=history'), ['url'] = true }, | ['link'] = title:fullUrl('action=history'), ['url'] = true }, | ||
{ ['mini'] = 'm', ['full'] = ' | { ['mini'] = 'm', ['full'] = 'trasladar', ['html_title'] = 'Trasladar esta plantilla', | ||
['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'] = 'vigilar', ['html_title'] = 'Vigilar esta plantiilla', | ||
['link'] = title:fullUrl('action=watch'), ['url'] = true } | ['link'] = title:fullUrl('action=watch'), ['url'] = true } | ||
} | } | ||
Línea 157: | Línea 158: | ||
function p.navbar(frame) | function p.navbar(frame) | ||
return p._navbar(require(' | return p._navbar(require('Módulo:Arguments').getArgs(frame)) | ||
end | end | ||
return p | return p |