Différences entre les versions de « Module:Bundles »

Aller à la navigation Aller à la recherche
2 octets supprimés ,  24 octobre 2021 à 21:45
aucun résumé de modification
Ligne 6 : Ligne 6 :
currentRow = mw.text.split(currentRow, ';')
currentRow = mw.text.split(currentRow, ';')
objects = table.getn(currentRow)
objects = table.getn(currentRow)
rowGroup = {}
rowGroup = ''
for k, v in ipairs(currentRow) do
for k, v in ipairs(currentRow) do
vs = mw.text.split(v, '-')
vs = mw.text.split(v, '-')
Ligne 12 : Ligne 12 :
object = mw.html.create('span')
object = mw.html.create('span')
:wikitext(icon.icon(vs[1], vs[2], nil, 'no'))
:wikitext(icon.icon(vs[1], vs[2], nil, 'no'))
table.insert(rowGroup, k, object)
rowGroup = rowGroup .. tostring(object)
if k ~= objects then
if k ~= objects then
object = mw.html.create('span')
object = mw.html.create('span')
Ligne 18 : Ligne 18 :
:wikitext(' + ')
:wikitext(' + ')
end
end
table.insert(rowGroup, k+0.5, object)
rowGroup = rowGroup .. tostring(object)
end
end
for k, v in pairs(rowGroup) do
for k, v in pairs(rowGroup) do
Ligne 25 : Ligne 25 :
result = mw.html.create('div')
result = mw.html.create('div')
result:addClass('bundle-row bundle-col-' .. objects)
result:addClass('bundle-row bundle-col-' .. objects)
result:wikitext(tostring(rowGroup))
result:wikitext(rowGroup)
return result
return result
1 124

modifications

Menu de navigation