Modulo:Mapframe/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
spostata e rivista gestione legenda in getLegenda, +mw.html
utilizzo del tag code per la legenda
Riga 23:
 
for _, point in ipairs(points) do
local pNode = mw.html.create('p'):cssTextcss('font-size:', '90%;border-left:4px solid ' .. point.col)
local codeNode = mw.html.create('code')
local text
:css('font-weight', 'bold')
:css('color', 'white')
:css('background', point.col)
if point.simb:find('-number') == 1 then
text = string.formatcodeNode:wikitext('&nbsp;<b>%d</b>.', currNum)
currNum = currNum + 1
elseif point.simb:find('-letter') == 1 then
text = string.formatcodeNode:wikitext('&nbsp;<b>%s</b>.', currChar)
currChar = ('ABCDEFGHIJKLMNOPQRSTUVWXYZA'):match(currChar .. '(.)')
elseif point.simb == '' then
text = ''
else
codeNode
text = string.format('[[File:Maki2-%s-18.svg|18px]]', point.simb)
:css('padding-left', '0')
:css('padding-right', '0')
:css('background', 'white')
:css('border', '2px solid ' .. point.col)
text = codeNode:wikitext(string.format('[[File:Maki2-%s-18.svg|18px]]', point.simb))
end
pNode:node(codeNode):wikitext(text .. ' &nbsp;' .. point.nome)
divNode:node(pNode)
end