Edición de «Módulo:Infobox»

Advertencia: no has iniciado sesión. Tu dirección IP se hará pública si haces cualquier edición. Si inicias sesión o creas una cuenta, tus ediciones se atribuirán a tu nombre de usuario, además de otros beneficios.

Puedes deshacer la edición. Antes de deshacer la edición, comprueba la siguiente comparación para verificar que realmente es lo que quieres hacer, y entonces publica los cambios para así efectuar la reversión.

Revisión actual Tu texto
Línea 6: Línea 6:
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local category_in_empty_row_pattern = '%[%[%s*[Cc][Aa][Tt][Ee][Gg][Oo][Rr][Yy]%s*:[^]]*]]'
local has_rows = false
local has_rows = false
local lists = {
plainlist_t = {
patterns = {
'^plainlist$',
'%splainlist$',
'^plainlist%s',
'%splainlist%s'
},
found = false,
styles = 'Plainlist/styles.css'
},
hlist_t = {
patterns = {
'^hlist$',
'%shlist$',
'^hlist%s',
'%shlist%s'
},
found = false,
styles = 'Hlist/styles.css'
}
}
local function has_list_class(args_to_check)
for _, list in pairs(lists) do
if not list.found then
for _, arg in pairs(args_to_check) do
for _, pattern in ipairs(list.patterns) do
if mw.ustring.find(arg or '', pattern) then
list.found = true
break
end
end
if list.found then break end
end
end
end
end


local function fixChildBoxes(sval, tt)
local function fixChildBoxes(sval, tt)
Línea 150: Línea 112:
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
if rowArgs.header and rowArgs.header ~= '_BLANK_' then
has_rows = true
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class, args.headerclass })
root
root
:tag('tr')
:tag('tr')
Línea 170: Línea 130:
)
)
end
end
elseif rowArgs.data and rowArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
elseif rowArgs.data and rowArgs.data:gsub(
category_in_empty_row_pattern, ''
):match('^%S') then
has_rows = true
has_rows = true
has_list_class({ rowArgs.rowclass, rowArgs.class })
local row = root:tag('tr')
local row = root:tag('tr')
row:addClass(rowArgs.rowclass)
row:addClass(rowArgs.rowclass)
Línea 207: Línea 167:


has_rows = true
has_rows = true
has_list_class({args.titleclass})
root
root
:tag('caption')
:tag('caption')
Línea 216: Línea 174:
:cssText(args.titlestyle)
:cssText(args.titlestyle)
:wikitext(args.title)
:wikitext(args.title)
end
end


Línea 223: Línea 180:


has_rows = true
has_rows = true
has_list_class({ args.aboveclass })
root
root
:tag('tr')
:tag('tr')
Línea 240: Línea 195:


has_rows = true
has_rows = true
has_list_class({ args.belowclass })
root
root
:tag('tr')
:tag('tr')
Línea 257: Línea 210:
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
subheaderArgs.data:gsub(category_in_empty_row_pattern, ''):match('^%S') then
has_rows = true
has_rows = true
has_list_class({ subheaderArgs.rowclass, subheaderArgs.class })
local row = root:tag('tr')
local row = root:tag('tr')
row:addClass(subheaderArgs.rowclass)
row:addClass(subheaderArgs.rowclass)
Línea 301: Línea 252:


has_rows = true
has_rows = true
has_list_class({ imageArgs.rowclass, imageArgs.class })
local row = root:tag('tr')
local row = root:tag('tr')
row:addClass(imageArgs.rowclass)
row:addClass(imageArgs.rowclass)
Línea 414: Línea 363:
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
root:wikitext(require('Module:Italic title')._main({}))
root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
end
end
end
end
Línea 454: Línea 403:
local function loadTemplateStyles()
local function loadTemplateStyles()
local frame = mw.getCurrentFrame()
local frame = mw.getCurrentFrame()
local hlist_templatestyles = ''
if lists.hlist_t.found then
hlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.hlist_t.styles }
}
end
local plainlist_templatestyles = ''
if lists.plainlist_t.found then
plainlist_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = lists.plainlist_t.styles }
}
end
-- See function description
-- See function description
Línea 475: Línea 410:


local templatestyles = ''
local templatestyles = ''
if args['templatestyles'] then
if args['templatestyles'] then templatestyles = frame:extensionTag{
templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['templatestyles'] }
name = 'templatestyles', args = { src = args['templatestyles'] }
}
}
Línea 482: Línea 416:
local child_templatestyles = ''
local child_templatestyles = ''
if args['child templatestyles'] then
if args['child templatestyles'] then child_templatestyles = frame:extensionTag{
child_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['child templatestyles'] }
name = 'templatestyles', args = { src = args['child templatestyles'] }
}
}
Línea 489: Línea 422:
local grandchild_templatestyles = ''
local grandchild_templatestyles = ''
if args['grandchild templatestyles'] then
if args['grandchild templatestyles'] then grandchild_templatestyles = frame:extensionTag{
grandchild_templatestyles = frame:extensionTag{
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
name = 'templatestyles', args = { src = args['grandchild templatestyles'] }
}
}
end
end
 
return table.concat({
return table.concat({
-- hlist -> plainlist -> base is best-effort to preserve old Common.css ordering.
base_templatestyles, -- see function description
-- this ordering is not a guarantee because the rows of interest invoking
-- each class may not be on a specific page
hlist_templatestyles,
plainlist_templatestyles,
base_templatestyles,
templatestyles,
templatestyles,
child_templatestyles,
child_templatestyles,
Línea 533: Línea 460:
-- @deprecated next; target .infobox-<name>
-- @deprecated next; target .infobox-<name>
:cssText(args.bodystyle)
:cssText(args.bodystyle)
has_list_class({ args.bodyclass })


renderTitle()
renderTitle()
Ten en cuenta que todas las contribuciones a Wiki TVenserio pueden ser editadas, modificadas o eliminadas por otros colaboradores. Si no deseas que las modifiquen sin limitaciones, no las publiques aquí.
Al mismo tiempo, asumimos que eres el autor de lo que escribiste, o lo copiaste de una fuente en el dominio público o con licencia libre (véase Wiki TVenserio:Derechos de autor para más detalles). ¡No uses textos con copyright sin permiso!
Cancelar Ayuda de edición (se abre en una ventana nueva)