Content deleted Content added
SocietyBox (talk | contribs) m add border-collapse:separate to fix mobile view |
clean whitespace and some globals; see talk |
||
Line 154:
end
local function newRow(bodyRow)
local first = p.flex_tree.merge and mw.clone(p.flex_tree.cell) or p.flex_tree.cell
tab.r = tab:tag'tr'
Line 167:
end
local function drawHead(text, row3rd)
local td = (row3rd and rowNum[row3rd]:tag'td':attr{rowspan = 2}
or head.row:tag'td')
Line 180:
end
local function spacer(width)
tab.r:tag'td'
:attr{width = width}
Line 186:
end
local function dpBox(v, r)
p.dpBoxBase = p.dpBoxBase or mw.html.create'td':attr{rowspan = 2, colspan = p.colspan}
if not v then
Line 215:
end,
spin = function(self, v)
table.insert(self, v)
return self
end,
Line 249:
}
local function boldWin(s1, s2)
return setmetatable(
p.bold and s1 ~= s2 and (math[({'min', 'max'})[p.bold]](s1, s2) == s1 and {true} or {[2] = true}) or callableEmpty,
Line 256:
end
local function maxSpan(span, start, rows)
return math.min(span, math.max(0, rows - start + 1))
end
Line 262:
--in case of templates like RDseed need padding value
p.teamBoxPadding = function()
return '.6ex'
end
p.teamBoxPadTab = {padding = '0 ' .. p.teamBoxPadding()}
p.teamBoxNormal = {border = '1px solid #aaa', background = p.bgColor[4]}
local function teamBox(v, r, f)
if p.flex_tree.merge and not v and f.phase == 2 then
for i = -2, 0 do
Line 322:
local mType, mNum = string.match(k, '^(%l+)match(%d*)$')
mType, mNum = ({skip = skipMatch, manualbold = unBold})[mType], tonumber(mNum)
if mType then
if mNum then
mType[mNum] = args:clean(k) == 'yes' or args[k] == 'true'
Line 378:
{__call = function() return 0 end}
)
)
or setmetatable({}, {__call = function() return nil end})
p.colspan = p.scoreBoxes > 0 and (p.scoreBoxes + 1) or nil
Line 429:
:css{['white-space'] = args.scroll_height and 'nowrap'}
newRow()
else
tab.r = tab:tag'tr'
tab.r:tag'td'
Line 651:
else
if m.showBox[m.phase] then
p.teamBoxCSS = colorFinal and
{border = p.teamBoxNormal.border, background = p.bgColor[m.phase + (col.show3rd or 0)]}
or p.teamBoxNormal
Line 740:
tab.r
:attr{rowspan = maxSpan(p.unit, r, rows)}
:cssText(col.t == 2 and
p:saveStr('topRight', 'border-width:', tab.line[2], ' 0 0;border-style:solid')
or col.t == 1 and (nodeFunc.bridge.lay[c](col.n - 2) and
Line 823:
function p.seed(frame)
local parent = frame:getParent() or frame
local function arg(k, alt)
return parent.args[k] or frame.args[k] or alt
end
|