Module:RoundN: Difference between revisions

Content deleted Content added
define textcolor when defining a backgroundcolor (for accessibility purposes)
per edit request on talk page - fix the node_function{orphan} bug
 
(6 intermediate revisions by one other user not shown)
Line 294:
else
cell = p.teamBoxPadTab
end
local text = v or f[1] and '' or ' '
if f.bold then
text = mw.ustring.gsub(text, '(%(%[%[[^%[%]]*%]%]%))', '<span style="font-weight:normal">%1</span>')
end
tab.r = rowNum[r]:tag'td'
Line 299 ⟶ 303:
:css(cell)
:attr{rowspan = 2}
:node(mw.html.create(f.bold and 'b'):wikitext(v or f[1] and '' or '&nbsp;'text))
end
end
Line 348 ⟶ 352:
for _, v in ipairs({--more args to boolean
'widescore',
'template',
'article_include',
'color',
'color_repechage',
Line 454 ⟶ 456:
setmetatable(scoreWidth, _scoreWidth)
end
 
if p.template or p.article_include then
p.template = mw.title.new(args.name)
p.templateFixedName = (p.template.namespace == 0 and not p.article_include and 'Template:' or '') .. p.template.fullText
end
p.template = p.template and mw.title.new(args:clean('name', {pattern = ''}))
local head_br = {
count = 0,
Line 486 ⟶ 484:
or p.RD[#p.RD + k - p.tCols - 1]
or ('Round of ' .. math.pow(2, p.tCols - k + 1))
drawHead(head.wt)
k == 1 and p.template and mw.getCurrentFrame():expandTemplate{
title = 'navbar-header',
args = {head.wt, p.templateFixedName}
} or head.wt
)
end
end
Line 527 ⟶ 520:
rowNum[1]:node(c < p.cols and
mw.clone(bumpBase):attr{rowspan = bump}
or p.no_column_head and p.template and
mw.html.create'td':wikitext(mw.getCurrentFrame():expandTemplate{
title = 'navbar-header',
args = {'', p.templateFixedName}
})
)
end
Line 743 ⟶ 731:
end
col.n = 0
col.t2 = nil
for r = bumps + 1, rows, p.unit * 2 do
tab.r = rowNum[r]:tag'td'
Line 751 ⟶ 740:
col.n = col.n + 2
col.t2 = skipMatch[col.tot + col.n / 2 + 1] and 3 or ((skipMatch[col.top + col.n] and 1 or 0) + (skipMatch[col.top + col.n + 1] and 2 or 0))
if col.t == 0 then --draws the ']' when a PAIR of matches needs lines
tab.r
:attr{rowspan = maxSpan(p.unit * 2, r, rows)}
Line 758 ⟶ 747:
['border-left'] = 0
})
else --draws the lines when only top OR bottom match need lines
else
tab.r
:attr{rowspan = maxSpan(p.unit, r, rows)}