Content deleted Content added
m slightly less shrink if not widescore = yes |
new feature: p.branch_upwards; also 3rdplace revamped to support multi-scores; various bug fixes |
||
Line 65:
notTop = {[isTop and 1 or 0] = p.reuseStr.solid}
for k = 0, 1 do
tab.r = rowNum[
:css(notTop[k] and
{[isTop and 'border-top' or 'border-bottom'] = notTop[k]}
Line 77:
text = nil
end
m.available =
else
return nil
Line 97:
local h = p.getNodeFunc()
if m.available then
tab.r = rowNum[
:attr{
rowspan = 6,
Line 103:
}
h.addText(h.nonFunc)
m.available =
return x
else
Line 317:
'flex_tree',
'no_column_head',
'short_brackets',
'branch_upwards'
}) do
if args[v] and (p[v] == nil or type(p[v]) == 'boolean') then
Line 333 ⟶ 334:
local nodeArgs = {
score = p.scoreBoxes - sumBox,
team = {offset = 1 + p.scoreBoxes - sumBox}
}
nodeArgs.all = 1 + nodeArgs.team.offset * 2
end▼
return s - (p.scoreSumBox and #t == 3 and 2 or 0)▼
end
end
▲
end▼
}
nodeArgs.team[1] = 1--constant to be replaced later by new param
Line 366 ⟶ 370:
}
fontSize, fontUnit = {fontSize * fontUnit}
end
end
tab
:cssText(table.concat{args.scroll_height and 'padding' or 'margin', ':',
:attr{cellpadding = 0, cellspacing = 0}
if not p.no_column_head then--headings row
Line 407 ⟶ 410:
end
}
p.branch_upwards = p.branch_upwards and 0
for k = 1, p.cols do
if k > 1 then
Line 442 ⟶ 446:
args.line_px:rep(2):gsub('(%a)(%d)', '%1 %2', 1)
}
for r = 1, rows do▼
rowNum.third = p['3rdplace'] and
(math.max(rows + (rows - 18) / 2, 7) + (p.no_column_head and 8 or 10))
or rows
newRow(r)
end
Line 449 ⟶ 457:
for c = 1, p.cols do
col.c = c
local bumps = bump
if c > 1 then
col.tot = col.tot + math.pow(2, p.tCols - c)
if p.branch_upwards then
bumps = 0
else
rowNum[1]:node(c < p.cols and
mw.clone(bumpBase):attr{rowspan = bump}
Line 459 ⟶ 472:
})
)
end
end
▲ local bumps = bump
col.top = m.num
nodeFunc.bridge.lay[c] = {}
p.span = p.tCols > c and bump * 2 or c == p.tCols and p.branch_upwards or math.max((bump - 1) / 2, 2)
local colorFinal, bumpMid = p.color and p.cols == p.tCols and c == p.cols, p.span > 0 and mw.clone(bumpBase):attr{rowspan = p.span} or nil
for r = 1, col.show3rd or rows, 2 do
▲ col.r = r + bumps
m.r = r + bumps
if col.show3rd or rowNum[
if m.phase == 0 then
m.showBox = setmetatable({1,
if nodeFunc:scanPattern(args, step) then
nodeFunc.called = {}
m.available = true
else
m.available = nil
end
end
Line 484 ⟶ 500:
end
end
local
rowNum[
elseif m.phase == 2 then
if nodeFunc.pattern and (nodeFunc.called.bridge or nodeFunc.called.canvas) then
Line 491 ⟶ 507:
end
m.num = m.num + 1
step = step + (p.omit_blanks and 0 or
bumps = bumps + (col.show3rd and 0 or maxSpan(p.span,
end
elseif m.phase == 0 then
Line 501 ⟶ 517:
end
end
if
m.showBox = nodeArgs.blank
step = step + 1
Line 507 ⟶ 523:
end
if m.showBox[1] then
if col.show3rd then
dpBox(nodeFunc.pattern and nodeFunc.nonFunc or args[step], col.r, skipMatch[m.num])▼
col.show3rd = (m.num - col.top) * 2
if col.show3rd == 2 then
if rowNum[rows + 1] and p.cols > 1 then --if 3rd place extends below bottom cell▼
rowNum[rows + 1]:tag'td':attr{
colspan = (p.cols - 1) * 4▼
}
end
if p.tCols == 1 then
bumps = bumps + 3
elseif p.branch_upwards then
r = 7
bumps = 2
end
m.r = r + bumps
bumps = bumps + 2
m.r = r + bumps
end
end
if p.previewnumbers then
p.namespace = p.namespace or mw.title.getCurrentTitle().namespace
Line 555 ⟶ 592:
else
if m.showBox[m.phase] then
local base = {color = colorFinal, phase = m.phase + (col.show3rd or 0)}
teamBox(args[step + nodeArgs.team[m.phase]],
if p.colspan then
if #m.nonEmpty == 0 then
for s = 1, p.scoreBoxes do
teamBox('',
end
else
Line 568 ⟶ 605:
local thinLeft = p.scoreSumBox and {[1] = {}, [#m.nonEmpty] = {'0 1ex'}} or {}
for s, i in ipairs(m.nonEmpty) do
teamBox(args[i[m.phase]],
end
end
Line 581 ⟶ 618:
'<table>',
tostring(sp.row), '<tr>',
tostring(rowNum[
tostring(rowNum[
tostring(rowNum[
}
end
Line 589 ⟶ 626:
skipMatch[m.num] = 'orphan'
end
step = step +
m.num = m.num + 1
if bump > 0 and rowNum[
bumps = bumps + p.span
rowNum[
end
r = r + (col.show3rd or bump)
end
end
col.show3rd = nil
else
m.phase = (m.phase + 1) % 3
▲ end
end
end
Line 604 ⟶ 645:
p.unit = bump + 3
bump = (rows - rows / math.pow(2, c)) / math.pow(2, p.tCols - c)
bumps = p.branch_upwards and 4 or (p.unit + 1)
rowNum[1]
:tag'td':attr{rowspan = bumps}
if not p.branch_upwards then
rowNum[1]:tag'td'
:attr{rowspan = (p.branch_upwards or bump) + 4}
:css(nodeFunc.bridge.lay[c][0] and
{['border-right'] = p.reuseStr.solid}
or {}
)
end▼
col.n = 0
for r = bumps + 1, rows, p.unit * 2 do
Line 641 ⟶ 684:
)
:node(col.t == 1 and interval > 0 and not nodeFunc.bridge.lay[c][col.n - 2] and p.cornerDiv)
rowNum[r + (p.branch_upwards and (4 - bump) or p.unit)]:tag'td'
:attr{rowspan = maxSpan(p.unit, r + p.unit, rows)}
:cssText(col.t == 1 and
Line 657 ⟶ 700:
rowNum[r + p.unit * 5] and col.t2 < 3 or false
}
rowNum[r + (p.branch_upwards or p.unit)]:tag'td'
:attr{rowspan = maxSpan(p.unit * 4, r + (p.branch_upwards and (4 - bump) or p.unit), rows)}
:css(interval == 0 and (col.t[1] or col.t[2]) and {
['border-width'] = table.concat{tab.line[1][col.t[1]], ' 0 ', tab.line[1][col.t[2]]},
Line 672 ⟶ 715:
end
end
▲ end
▲ end
▲ if p.tCols == p.cols and (p['3rdplace'] or p.cols > 3 and p['3rdplace'] == nil and not p.no_column_head) then--begin 3rd place
▲ end
▲ if rowNum[rows + 1] and p.cols > 1 then --if 3rd place extends below bottom cell
▲ rowNum[rows + 1]:tag'td':attr{
▲ rowspan = col.r + 7 - rows,
▲ colspan = (p.cols - 1) * 4
▲ }
▲ end
▲ drawHead(args.Consol or args['RD' .. (p.cols + 1)] or p.RD[4], col.r)
▲ for k, v in ipairs({
end
end
|