Modulo:Discendenza: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
risistemazione con utilizzo mw.html |
m ottimizzazione |
||
Riga 219:
local xx, xp
local stileDiv = { ['width'] = largo..'px', ['padding'] = '3px', ['background'] = '#FFF', ['border'] = '1px solid #C8CCD1' }
local stileTabella = { ['border-collapse'] = 'separate', ['text-align'] = 'center', ['font-size'] = '95%', ['line-height'] = '105%', ['margin'] = '0px auto !important', }
local xy = massimoXY(pid, {0, 0})
local lg = math.floor(100/(xy[1]+2))
Riga 246:
if (n==1) then
for m=1,(xy[1]+2) do
end
else
:css('border-right','1px solid #000')
:cssIf(n1 == xp,'border-top','1px solid #000')
:attrIf(xx-posx[1]>0,'colspan',xx+1-posx[1])
:wikitext(' ')
)
n1 = xp
posx[1] = xx + 1
end
if (xx-posx[2]>0) then
:attrIf(xx-posx[2]>1,'colspan',xx-posx[2])
:wikitext(' ')
end
:attr('colspan','2')
:wikitextIf(pers[v].nota=='-', pers[v].testo, string.format('%s<br/><span style="font-size:90%%"><i>%s</i></span>',pers[v].testo,pers[v].nota))
)
posx[2] = xx + 2
if (n<xy[2]) then
if (#pers[v].figli > 0) then
:css('border-right','1px solid #000')
:attrIf(xx-posx[3]>0,'colspan',xx+1-posx[3])
:wikitext(' ')
)
posx[3] = xx + 1
end
end
Line 289 ⟶ 288:
bDiv:node(bTabella)
if (allinea == 'destra' and not (dida=='')) then
:css({['font-size'] = '87%', ['font-style'] = 'normal', ['border-top'] = '1px solid #c8ccd1', ['margin'] = '8px 2px 3px'})
:wikitext(dida)
)
end
return tostring(bDiv)
Line 324 ⟶ 323:
)
end
riga1
:node(mw.html.create('td') :css('width','6px'))
:css({['border-left']='1px solid #666',['border-bottom']='1px solid #666',['width']='10px',['line-height']='3px',['height']='12px'}))
:wikitext(' ')
:attr({['colspan']=2*a-1, ['rowspan']=2})
:css('padding', '0px 3px 2px 1px')
:wikitextIf(pers[pid].nota=='', pers[pid].testo, pers[pid].testo..' - '..pers[pid].nota))
riga2
:node(mw.html.create('td'))
Riga 340:
bTabella:node(riga1):node(riga2)
else
local riga1 = mw.html.create('tr')▼
:
:css('padding','0px 0px 2px 2px')
:wikitextIf(pers[pid].nota=='',pers[pid].testo,pers[pid].testo..' - '..pers[pid].nota )
▲ bTabella:node(riga1)
)
end
if (pers[pid].sp > 0) then
|