Modulo:Mapframe/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
spostata e rivista gestione legenda in getLegenda, +mw.html
use require('strict') instead of require('Module:No globals')
 
(3 versioni intermedie di un altro utente non mostrate)
Riga 1:
require('Module:No globalsstrict')
local getArgs = require('Module:Arguments').getArgs
local mWikidata = require('Module:Wikidata')
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('border-radius', '6px')
:css('border', '2px solid ' .. point.col)
: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')
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
Line 51 ⟶ 59:
local gruppo = args.gruppo or ''
local autozoom = args.autozoom or 's'
local elenco = (args.elenco == '1' or args.elenco == '2') and args.elenco or nil
local dsimbolo = 'medium'
--if sinottico == 1 then dsimbolo = 'small' end
Line 135 ⟶ 144:
-- esclude didascalia per cornice = 0 e per sinottico = 1
if cornice == 1 and sinottico ~= 1 then
m_args.text = (args.didascalia or '') .. (args.elenco and getLegenda(points, args.elenco) or '')
end