Diferencia entre revisiones de «Módulo:Ficha»
Sin resumen de edición |
Sin resumen de edición |
||
| (No se muestran 67 ediciones intermedias de 22 usuarios) | |||
| Línea 5: | Línea 5: | ||
local p = {} | local p = {} | ||
local HtmlBuilder = require('Module:HtmlBuilder') | |||
-- local CategorizacionAByAD = require('Módulo:Categorización de buenos y destacados') -- DESACTIVADO: Causa de error si el módulo o Wikidata no existen. | |||
local marco = {} | local marco = {} | ||
local args | local args | ||
local root | local root | ||
local anchoImagen = ' | local anchoImagen = '320px' | ||
function union(t1, t2) | function union(t1, t2) | ||
-- devuelve la unión de los valores de dos tablas, como una secuencia | -- devuelve la unión de los valores de dos tablas, como una secuencia | ||
| Línea 40: | Línea 41: | ||
table.sort(nums) | table.sort(nums) | ||
return nums | return nums | ||
end | end | ||
| Línea 53: | Línea 46: | ||
if rowArgs.seccion then | if rowArgs.seccion then | ||
root | root | ||
.tag('tr') | |||
.tag('th') | |||
.attr('colspan', 3) | |||
.addClass(rowArgs.clasefila) | |||
.css('text-align', 'center') | |||
.cssText(rowArgs.estiloseccion or args.estiloseccion) | |||
.wikitext(rowArgs.seccion) | |||
elseif rowArgs.datos then | elseif rowArgs.datos then | ||
local fila = root | local fila = root.tag('tr') | ||
fila.addClass(rowArgs.clasefila) | fila.addClass(rowArgs.clasefila) | ||
if rowArgs.etiqueta then | if rowArgs.etiqueta then | ||
fila | fila | ||
.tag('th') | |||
.attr('scope', 'row') | |||
.css('text-align', 'left') | |||
.addClass(rowArgs.clasefila) | |||
.cssText (rowArgs.estiloetiqueta or args.estiloetiqueta) | |||
.wikitext(rowArgs.etiqueta) | |||
.done() | |||
end | end | ||
local datosCelula = fila | local datosCelula = fila.tag('td') | ||
if rowArgs.etiqueta then | if rowArgs.etiqueta then | ||
datosCelula | datosCelula | ||
.attr('colspan', 2) | |||
else | else | ||
datosCelula | datosCelula | ||
.attr('colspan', 3) | |||
.css('text-align', 'center') | |||
end | end | ||
datosCelula | datosCelula | ||
.addClass(rowArgs.clase) | |||
.cssText (rowArgs.estilodatos or args.estilodatos) | |||
-- Se añade un salto de línea porque si no se hace así y por ejemplo en los | |||
-- datos hay una lista con asteriscos en el primer elemento se muestra | |||
-- un asterisco. | |||
-- Se trata de un error que ya ocurre con tablas normales sin LUA. Por ejemplo | |||
-- {| | |||
-- | * elemento1 | |||
-- * elemento2 | |||
-- |} | |||
-- El salto de línea ya se producía en la plantilla Ficha/fila | |||
.wikitext('\n' .. rowArgs.datos) | |||
--.newline() | |||
end | end | ||
end | end | ||
| Línea 92: | Línea 97: | ||
local function hacerTitulo() -- Cabecera de la ficha | local function hacerTitulo() -- Cabecera de la ficha | ||
if not args.titulo then return end | if not args.titulo then return end | ||
local cabecera = {} | local cabecera = {} | ||
if args.media == 'si' and args.clasetitulo then | if args.media == 'si' and args.clasetitulo then | ||
cabecera = 'media ' .. args['clasetitulo'] | cabecera = 'media ' .. args['clasetitulo'] | ||
| Línea 105: | Línea 110: | ||
end | end | ||
root | root | ||
.tag('tr') | |||
.tag('th') | |||
.attr('colspan', 3) | |||
.addClass(cabecera) | |||
.css('text-align', 'center') | |||
.css('background-color', args.colorfondo or args.colorfondotitulo or 'transparent') | |||
.css('color', args.colortexto or 'inherit') | |||
.cssText(args.estilotitulo) | |||
.wikitext(args.titulo) | |||
end | end | ||
local function hacerFilaArriba() | local function hacerFilaArriba() | ||
| Línea 119: | Línea 124: | ||
root | root | ||
.tag('tr') | |||
.tag('th') | |||
.attr('colspan', 3) | |||
.addClass(args.clasearribaor or args.clasetitulo2) | |||
.css('text-align', 'center') | |||
.css('font-size', '125%') | |||
.css('font-weight', 'bold') | |||
.cssText(args.estiloarriba or args.estilotitulo2) | |||
.wikitext(args.arriba or args.titulo2) | |||
end | end | ||
| Línea 134: | Línea 139: | ||
root | root | ||
.tag('tr') | |||
.tag('td') | |||
.attr('colspan', '3') | |||
.addClass(args.clasepiedetabla) | |||
.css('text-align', 'center') | |||
.cssText(args.estilopiedetabla) | |||
.wikitext(args.piedetabla) | |||
end | end | ||
local function hacerImagenInferior()-- Imagen que aparecerá en la parte inferior de la tabla | local function hacerImagenInferior()-- Imagen que aparecerá en la parte inferior de la tabla | ||
if not args.imageninferior then return end | if not args.imageninferior then return end | ||
imageninferior = {} | |||
if args['tamañoimageninferior'] == nil or args['tamañoimageninferior'] == '' then | |||
args['tamañoimageninferior'] = anchoImagen | |||
end | |||
if string.find(args.imageninferior, '[{[]') == nil then | |||
imageninferior = ('[[Archivo:' .. args.imageninferior .. '|'.. args['tamañoimageninferior'] .. ']]' ) | |||
else | |||
imageninferior = args.imageninferior | |||
end | |||
root | root | ||
.tag('tr') | |||
.tag('td') | |||
.attr('colspan', '3') | |||
.addClass('imagen ' .. (args.claseimageninferior or '') ) | |||
.css('text-align', 'center') | |||
.cssText(args.estiloimageninferior) | |||
.newline() | |||
.wikitext(imageninferior) | |||
.tag('br', {selfClosing = true}) | |||
.done() | |||
.tag('div') | |||
.css('display','inline') | |||
.cssText(args.estilopieinferior) | |||
.wikitext(args.pieinferior) | |||
.done() | |||
.newline() | |||
end | end | ||
local function hacerImagenSuperior()-- Imagen que aparecerá en la parte superior de la tabla | local function hacerImagenSuperior()-- Imagen que aparecerá en la parte superior de la tabla | ||
if not args.imagensuperior then return end | if not args.imagensuperior then return end | ||
if args[' | if args['tamañoimagensuperior'] == nil or args['tamañoimagensuperior'] == '' then | ||
args['tamañoimagensuperior'] = anchoImagen | args['tamañoimagensuperior'] = anchoImagen | ||
end | end | ||
imagensuperior = {} | imagensuperior = {} | ||
if string.find(args.imagensuperior, '[{[]') == nil then | |||
imagensuperior = ('[[Archivo:' .. args.imagensuperior .. '|'.. args['tamañoimagensuperior'] .. ']]' ) | |||
else | |||
imagensuperior = args.imagensuperior | |||
end | |||
root | root | ||
.tag('tr') | |||
.tag('td') | |||
.attr('colspan', '3') | |||
.addClass('imagen ' .. (args.claseimagensuperior or '') ) | |||
.css('text-align', 'center') | |||
.cssText(args.estiloimagensuperior) | |||
.newline() | |||
.wikitext(imagensuperior) | |||
.tag('br', {selfClosing = true}) | |||
.done() | |||
.tag('div') | |||
.css('display','inline') | |||
.cssText(args.estilopiesuperior) | |||
.wikitext(args.piesuperior) | |||
.done() | |||
.newline() | |||
end | end | ||
| Línea 240: | Línea 249: | ||
local function hacerImageneslaterales() | local function hacerImageneslaterales() | ||
-- Imagenes que apareceran arriba de forma geminada por ejemplo escudos y banderas | -- Imagenes que apareceran arriba de forma geminada por ejemplo escudos y banderas | ||
if args['tamañoimagenizquierda'] == "" or args['tamañoimagenizquierda'] == nil then | if args['tamañoimagenizquierda'] == "" or args['tamañoimagenizquierda'] == nil then | ||
args['tamañoimagenizquierda'] = '100px' | args['tamañoimagenizquierda'] = '100px' | ||
end | |||
if args['tamañoimagenderecha'] == "" or args['tamañoimagenderecha'] == nil then | |||
args['tamañoimagenderecha'] = '100px' | args['tamañoimagenderecha'] = '100px' | ||
end | |||
if args.imagenderecha and args.imagenizquierda then | if args.imagenderecha and args.imagenizquierda then | ||
if args.pieizquierdo then brcondicionalizquierdo = 'br' end | |||
if args.piederecho then brcondicionalderecho = 'br' end | |||
root | |||
-- | .tag('tr') | ||
-- | .tag('td') | ||
--.attr('cellspacing', '0em') | |||
--.attr('padding','0em') | |||
.attr('colspan', '3') | |||
.css('align', 'center') | |||
.tag('table') -- tiene que ir dentro de una tabla para que las filas no lo deformen | |||
.css('width', '100%') | |||
.addClass('mergedrow') | |||
.tag('tr') | |||
.tag('td') | |||
.css('text-align', 'center') | |||
.css('background-color', 'transparent') | |||
.addClass(args.claseimagenizquierda) | |||
.css('align', 'center')-- Se alinea en el centro horizontal | |||
.css('text-align', 'center') -- Se alinea en el centro horizontal | |||
.css('vertical-align', 'middle')-- Se alinea en el centro vertical | |||
.cssText(args.estiloimagenizquierda) | |||
.wikitext('[[Archivo:' .. args.imagenizquierda .. '|' .. args['tamañoimagenizquierda'] .. ']]' ) | |||
.tag(brcondicionalizquierdo) | |||
.tag('div') | |||
.css('display','inline') | |||
.cssText(args.estilopieizquierdo) | |||
.wikitext(args.pieizquierdo) | |||
.done() | |||
.tag('td') | |||
.css('text-align', 'center')-- Se alinea en el centro horizontal | |||
.css('align', 'center')-- Se alinea en el centro horizontal | |||
.css('vertical-align', 'middle')-- Se alinea en el centro vertical | |||
.css('background-color', 'transparent') | |||
.addClass(args.claseimagenderecha) | |||
.cssText(args.estiloimagenderecha) | |||
.wikitext('[[Archivo:' .. args.imagenderecha .. '|' .. args['tamañoimagenderecha'] .. ']]' ) | |||
.tag(brcondicionalderecho) | |||
.tag('div') | |||
.css('display','inline') | |||
.cssText(args.estilopiederecho) | |||
.wikitext(args.piederecho) | |||
.done() | |||
.newline() | |||
elseif args.imagenderecha or args.imagenizquierda then | |||
-- Si solo una de las dos, la imagen que aparezca estará en el centro | -- Si solo una de las dos, la imagen que aparezca estará en el centro | ||
imagenL = {} | |||
if args.imagenderecha ~= '' and args.imagenderecha ~= nil then | if args.imagenderecha ~= '' and args.imagenderecha ~= nil then | ||
imagenL = 'imagenderecha' | imagenL = 'imagenderecha' | ||
| Línea 294: | Línea 309: | ||
imagenL = 'imagenizquierda' | imagenL = 'imagenizquierda' | ||
end | end | ||
pieL = {} | |||
if args.imagenderecha then | |||
pieL = 'piederecho' | pieL = 'piederecho' | ||
elseif args.imagenizquierda then | |||
pieL = 'pieizquierdo' | pieL = 'pieizquierdo' | ||
end | |||
root | |||
.tag('tr') | |||
.tag('td') | |||
.attr('colspan', '3') | |||
.addClass(args['clase' .. imagenL]) | |||
.css('text-align', 'center') | |||
.cssText(args['estilo' .. imagenL]) | |||
.newline() | |||
.wikitext('[[Archivo:' .. args[imagenL] .. '|'.. args['tamaño'..imagenL] .. ']]' ) | |||
.tag('br') | |||
.tag('div') | |||
.css('display','inline') | |||
.cssText(args['estilo' .. pieL]) | |||
.wikitext(args[pieL]) | |||
.done() | |||
end | end | ||
end | end | ||
local function hacerImagenes() -- Puede crear un número infinito de imágenes | local function hacerImagenes() -- Puede crear un número infinito de imágenes | ||
if args.imagen then | if args.imagen then | ||
| Línea 322: | Línea 340: | ||
if args['tamañoimagen'] then | if args['tamañoimagen'] then | ||
args['tamañoimagen1'] = args['tamañoimagen'] | args['tamañoimagen1'] = args['tamañoimagen'] | ||
end | |||
if args['imagenmodooscuro'] then | |||
args['imagenmodooscuro1'] = args['imagenmodooscuro'] | |||
end | |||
if args.pie then | if args.pie then | ||
| Línea 333: | Línea 354: | ||
local flotante = args['imagenflotante' .. num] or false | local flotante = args['imagenflotante' .. num] or false | ||
if args['tamañoimagen'..num] == nil then | if args['tamañoimagen'..num] == nil then | ||
args['tamañoimagen'..num] = | args['tamañoimagen'..num] = anchoImagen | ||
end | end | ||
-- Comprobamos si se ha activado el argumento imagenmodooscuro para esta imagen | |||
local claseInversion = args['imagenmodooscuro' .. num] and 'class=skin-invert-image' or '' | |||
imagen = {} | imagen = {} | ||
local cadenaBusqueda = mw.ustring.gsub(args['imagen'..num],'UNIQ','[') -- Para que no de problemas con ciertas plantillas | local cadenaBusqueda = mw.ustring.gsub(args['imagen'..num],'UNIQ','[') -- Para que no de problemas con ciertas plantillas | ||
if mw.ustring.find(cadenaBusqueda, '[{[|]') == nil then -- Comprueba si hay [ o { para no añadir prefijo | if mw.ustring.find(cadenaBusqueda, '[{[|]') == nil then -- Comprueba si hay [ o { para no añadir prefijo | ||
imagen = ('[[Archivo:' .. args['imagen' .. num] .. '|'.. args['tamañoimagen' ..num] .. ']]' ) | imagen = ('[[Archivo:' .. args['imagen' .. num] .. '|'.. args['tamañoimagen' ..num] .. '|' .. claseInversion .. ']]' ) | ||
else | else | ||
imagen = args['imagen'..num] | imagen = args['imagen'..num] | ||
end | end | ||
local datos = | local datos = HtmlBuilder.create().wikitext(imagen) | ||
if pie and not flotante then | if pie and not flotante then | ||
datos | datos | ||
.tag('br', {selfClosing = true}) | |||
.done() | |||
end | end | ||
if pie then | if pie then | ||
datos | datos | ||
.tag('div') | |||
.css('display','inline') | |||
.cssText(args.estilopie) | |||
.wikitext(pie) | |||
.done() | |||
end | end | ||
anadirfila({ | anadirfila({ | ||
datos = tostring(datos), | datos = tostring(datos), | ||
estilodatos = args.estiloimagen, | estilodatos = args.estiloimagen, | ||
clase = args.claseimagen, | clase = 'imagen ' .. (args.claseimagen or ''), | ||
clasefila = args['claseimagen' .. num] | clasefila = args['claseimagen' .. num] | ||
}) | }) | ||
| Línea 406: | Línea 433: | ||
function anadirSucesion(argumentosSucesion) | function anadirSucesion(argumentosSucesion) | ||
local | local filaGen = root.tag('tr') | ||
filaGen.css('font-size', '88%') | |||
filaGen.css('text-align', 'center') | |||
local celda | local celda | ||
| Línea 415: | Línea 442: | ||
width = '33%' | width = '33%' | ||
celda = fila | local celdaGen = filaGen.tag('td').attr('colspan', 3).css('padding', 0) | ||
local tablaSuc = celdaGen.tag('table') | |||
tablaSuc.css('width', '100%') | |||
local fila = tablaSuc.tag('tr') | |||
celda = fila.tag('td') | |||
celda | celda | ||
.css('width', width) | |||
.css('padding', '0.2em 0.1em 0.2em 0') | |||
.css('vertical-align', 'middle') | |||
if argumentosSucesion['estilo fuente'] then | if argumentosSucesion['estilo fuente'] then | ||
celda | |||
.tag('div') | |||
.css('display','inline') | |||
.css('font-style', argumentosSucesion['estilo fuente']) | |||
.wikitext(argumentosSucesion.anterior) | |||
.done() | |||
else | else | ||
celda | celda.wikitext(argumentosSucesion.anterior) | ||
end | end | ||
if argumentosSucesion['año anterior'] then | if argumentosSucesion['año anterior'] then | ||
celda | celda | ||
.tag('br') | |||
.wikitext('(' .. argumentosSucesion['año anterior'] .. ')') | |||
end | end | ||
celda = fila | celda = fila.tag('td') | ||
celda | celda | ||
.css('width', width) | |||
.css('padding', '0.2em 0.1em') | |||
.css('vertical-align', 'middle') | |||
.css('background-color', argumentosSucesion.color or '#E6E8FA') | |||
celda | celda | ||
.tag('div') | |||
.css('display','inline') | |||
.css('font-weight', 'bold') | |||
.css('font-style', argumentosSucesion['estilo fuente'] or '') | |||
.wikitext(argumentosSucesion.actual or args.titulo) | |||
.done() | |||
if argumentosSucesion['año'] then | if argumentosSucesion['año'] then | ||
celda | celda | ||
.tag('br') | |||
.wikitext('(' .. argumentosSucesion['año'] .. ')') | |||
end | end | ||
celda = fila | celda = fila.tag('td') | ||
celda | celda | ||
.css('width', width) | |||
.css('padding', '0.2em 0 0.2em 0.1em') | |||
.css('vertical-align', 'middle') | |||
if argumentosSucesion['estilo fuente'] then | if argumentosSucesion['estilo fuente'] then | ||
celda | |||
.tag('div') | |||
.css('display','inline') | |||
.css('font-style', argumentosSucesion['estilo fuente']) | |||
.wikitext(argumentosSucesion.siguiente) | |||
.done() | |||
else | else | ||
celda | celda.wikitext(argumentosSucesion.siguiente) | ||
end | end | ||
if argumentosSucesion['año siguiente'] then | if argumentosSucesion['año siguiente'] then | ||
celda | celda | ||
.tag('br') | |||
.wikitext('(' .. argumentosSucesion['año siguiente'] .. ')') | |||
end | end | ||
end | end | ||
| Línea 488: | Línea 526: | ||
if tituloSeccion then | if tituloSeccion then | ||
anadirfila({ | anadirfila({ | ||
estiloseccion = fila['estilotitulo'] or fila['estilotítulo'], | |||
seccion | seccion = tituloSeccion | ||
}) | |||
end | end | ||
hacerFilasTabla(fila) | hacerFilasTabla(fila) | ||
| Línea 506: | Línea 544: | ||
}) | }) | ||
elseif fila.tipo == 'dos columnas' then -- FALTA | elseif fila.tipo == 'dos columnas' then -- FALTA | ||
elseif fila.tipo == 'tres columnas' then -- FALTA | elseif fila.tipo == 'tres columnas' then -- FALTA | ||
else | else -- Etiqueta + Datos o solo Datos | ||
anadirfila({ | anadirfila({ | ||
etiqueta = depurarVacias(fila[1]) or depurarVacias(fila['etiqueta']), | etiqueta = depurarVacias(fila[1]) or depurarVacias(fila['etiqueta']), | ||
datos = depurarVacias(fila[2]) or depurarVacias(fila['datos']), | datos = depurarVacias(fila[2]) or depurarVacias(fila['datos']), | ||
estiloetiqueta = fila['estiloetiqueta'], | estiloetiqueta = fila['estiloetiqueta'] or tabla['estiloetiqueta'], | ||
estilodatos = fila['estilodatos'], | estilodatos = fila['estilodatos'] or tabla['estilodatos'], | ||
clase = fila['clase'], | clase = fila['clase'] or tabla['clase'], | ||
clasefila = fila['clasefila'] | clasefila = fila['clasefila'] or tabla['clasefila'] | ||
}) | }) | ||
end | end | ||
end | end | ||
end | end | ||
| Línea 525: | Línea 563: | ||
root | root | ||
.tag('tr') | |||
.tag('td') | |||
.attr('colspan', '3') | |||
.css('text-align', 'right') | |||
.wikitext(mw.getCurrentFrame():expandTemplate({ | |||
title = 'navbar', | title = 'navbar', | ||
args = { args.nombre, mini = 1 } | args = { args.nombre, mini = 1 } | ||
| Línea 536: | Línea 574: | ||
local function hacerBarraWikidata()-- Crea en la parte inferior un enlace al ítem de Wikidata | local function hacerBarraWikidata()-- Crea en la parte inferior un enlace al ítem de Wikidata | ||
local enlacePagina = mw.title.getCurrentTitle(). | local enlacePagina = mw.title.getCurrentTitle().prefixedText | ||
local etiquetaPagina = mw.ustring.gsub(enlacePagina,'%s%(.*%)','') | local etiquetaPagina = mw.ustring.gsub(enlacePagina,'%s%(.*%)','') | ||
local entidad = wikibase. | local entidad = mw.wikibase and mw.wikibase.getEntity and mw.wikibase.getEntity() or nil | ||
local textoPie = "" | local textoPie = "" | ||
if (args.child == 'si' or args.integrada == 'sí' or args.wikidata == 'no') or (mw.title.getCurrentTitle().namespace ~= 0 and mw.title.getCurrentTitle().namespace ~= 104) then | if (args.child == 'si' or args.integrada == 'sí' or args.wikidata == 'no') or (mw.title.getCurrentTitle().namespace ~= 0 and mw.title.getCurrentTitle().namespace ~= 104 and not args.entidad) then | ||
textoPie = '' | textoPie = '' | ||
elseif entidad ~= "" and entidad ~= nil then | elseif entidad ~= "" and entidad ~= nil then | ||
textoPie = '< | textoPie = '<div class="plainlinks wikidata-link" style="font-size: 0.85em">[[[d:' .. tostring(entidad) .. '|editar datos en Wikidata]]]</div>' | ||
if (entidad ~= mw.wikibase.getEntityIdForCurrentPage()) and (mw.title.getCurrentTitle().namespace == 0 or mw.title.getCurrentTitle().namespace == 104) then | |||
textoPie = textoPie .. '[[Categoría:Wikipedia:Artículos con fichas que utilizan acceso arbitrario]]' | |||
end | |||
else | else | ||
textoPie = "<small>'''Página no enlazada a [[Wikidata]]'''\n".. | textoPie = "<small>'''Página no enlazada a [[Wikidata]]'''\n".. | ||
| Línea 553: | Línea 595: | ||
if textoPie ~= '' then | if textoPie ~= '' then | ||
root | root | ||
.tag('tr') | |||
.tag('td') | |||
.addClass('noprint') | |||
.attr('colspan', '3') | |||
.css('text-align', 'left') | |||
.wikitext(textoPie) | |||
end | end | ||
end | end | ||
local function hacerCategoriasSeguimiento() | local function hacerCategoriasSeguimiento() | ||
if args.decat ~= 'si' and #(getArgNums('datos')) == 0 and not args[1] and mw.title.getCurrentTitle().namespace == 0 then | if args.decat ~= 'si' and #(getArgNums('datos')) == 0 and not args[1] and mw.title.getCurrentTitle().namespace == 0 then | ||
root | root.wikitext('[[Categoría:Wikipedia:Artículos que usan ficha sin datos en filas]]') | ||
end | end | ||
if CategorizacionAByAD.hasAnyBadge() == '1' then | |||
root.wikitext(CategorizacionAByAD.badgesCategories()) | |||
end | |||
end | end | ||
function _infobox() | function _infobox() | ||
if args.child ~= 'si' and args.integrada ~= 'sí' then | if args.child ~= 'si' and args.integrada ~= 'sí' then | ||
root = | root = HtmlBuilder.create('table') | ||
root -- Estilo de toda la ficha | root -- Estilo de toda la ficha | ||
.addClass('infobox') | |||
.addClass(args.clase) | |||
.cssText('width:22.7em; line-height: 1.4em; text-align:left; padding:.23em') -- Lo mismo que la plantilla:Ficha | |||
.cssText(args.estilo) | |||
if args.estilo then | if args.estilo and (mw.title.getCurrentTitle().namespace == 10) then -- Para que sólo lo añada en el espacio de nombres plantilla | ||
root | root.wikitext('[[Categoría:Wikipedia:Fichas con el parámetro estilo]]') | ||
end | end | ||
| Línea 582: | Línea 629: | ||
hacerFilaArriba() | hacerFilaArriba() | ||
else | else | ||
root = | root = HtmlBuilder.create() | ||
if args.titulo then | if args.titulo then | ||
root | root.wikitext("'''" .. args.titulo .. "'''") | ||
end | end | ||
end | end | ||
| Línea 602: | Línea 649: | ||
hacerPieDeTabla() | hacerPieDeTabla() | ||
hacerBarraDeNavegacion() | hacerBarraDeNavegacion() | ||
hacerBarraWikidata() | -- hacerBarraWikidata() -- DESACTIVADO: Causa de error si Wikidata no está configurado. | ||
hacerCategoriasSeguimiento() | -- hacerCategoriasSeguimiento() -- DESACTIVADO: Causa de error si Wikidata no está configurado. | ||
return tostring(root) | return mw.getCurrentFrame():extensionTag{ name = 'templatestyles', args = { src = 'Plantilla:Ficha/imagelimit.css' } } .. tostring(root) | ||
end | end | ||
local function touchParameters(prefixTable, origArgs, step) | local function touchParameters(prefixTable, origArgs, step) | ||
| Línea 623: | Línea 670: | ||
for j,v in ipairs(prefixTable) do | for j,v in ipairs(prefixTable) do | ||
if not type(v) == "string" then | if not type(v) == "string" then | ||
error("Detectado un valor que no es | error("Detectado un valor que no es string en el prefijo de la tabla por la función touchParameters.", 2) | ||
end | end | ||
temp = origArgs[v] | temp = origArgs[v] | ||
| Línea 643: | Línea 690: | ||
local origArgs | local origArgs | ||
marco = frame | marco = frame | ||
-- Si se llama a través de #invoke, utilice los argumentos pasados | -- Si se llama a través de #invoke, utilice los argumentos pasados a la plantilla de invocación. | ||
-- De lo contrario, para fines de prueba, asume args que se pasan directamente como parámetros. | -- De lo contrario, para fines de prueba, asume args que se pasan directamente como parámetros. | ||
if frame == mw.getCurrentFrame() then | if frame == mw.getCurrentFrame() then | ||