Content deleted Content added
No edit summary |
No edit summary |
||
(42 intermediate revisions by the same user not shown) | |||
Line 10:
local team_width = Args['teamwidth'] or '190'
local sort_text = ''
local sort_table_val = Args['sortable_table'] or '
if yesno(sort_table_val) then sort_text = 'sortable' end
table.insert(t,'{|class="wikitable '..sort_text..'" style="text-align:center;"\n') -- Open table
-- Custom header options
-- Table header
local table_header = Args['table_header']
if table_header then
table.insert(t,'|+'..table_header..'\n')
end
--Column headers
local
local
local
local group_head_text = Args['group_header'] or '<abbr title="Group">Grp</abbr>'
▲ local tie_head_text = Args['tie_header'] or '<abbr title="Tie">T</abbr>'
▲ local tiebr_head_text = Args['tiebr_header'] or '<abbr title="Regulation and overtime wins">ROW</abbr>'
▲ local gp_head_text = Args['played_header'] or '<abbr title="Games played">GP</abbr>'
-- Use points instead of goals for/against
local for_against_style = Args['for_against_style'] or 'goals'
Line 46 ⟶ 48:
-- True if exist, false otherwise
if yesno(use_ratio_val) then do_ratio = true end
-- Whether
local use_tiebr_val = Args['
local do_tiebr = false
if yesno(use_tiebr_val) then do_tiebr = true end
-- Ties and OTL
local use_tieOTL_val = Args['use_ties'] or 'no'
local do_ties = false
if yesno(use_tieOTL_val) then do_ties = true end
-- Initialize
Line 60 ⟶ 67:
-- Add group header
if full_table and group_col then
tt = p_sub.colhead(tt,
end
tt = p_sub.colhead(tt,team_width,'Team'..VTE_text) -- Team col
tt = p_sub.colhead(tt,32,
if full_table then
tt = p_sub.colhead(tt,32,'<abbr title="Won">W</abbr>') -- Win col
tt = p_sub.colhead(tt,32,'<abbr title="Lost">L</abbr>') -- Loss col
tt = p_sub.colhead(tt,32,tie_head_text)▼
tt = p_sub.colhead(tt,32,'<abbr title="
▲ if not do_tiebr then
▲ tt = p_sub.colhead(tt,32,'<abbr title="'..fa_word_plur..' for">'..fa_letter..'F</abbr>') -- For col
if not do_ratio then▼
end
tt = p_sub.colhead(tt,32,OTloss_head_text)
end
tt = p_sub.colhead(tt,32,'<abbr title="'..fa_word_plur..' for">'..fa_letter..'F</abbr>') -- For col
tt = p_sub.colhead(tt,32,'<abbr title="'..fa_word_plur..' against">'..fa_letter..'A</abbr>') -- Against col
Line 105 ⟶ 107:
-- Get custom/default options for in table
local win_points = tonumber(Args['winpoints']) or 2
local tie_points = tonumber(Args['tiepoints']) or 1▼
local loss_points = tonumber(Args['losspoints']) or 0
local OTloss_points = tonumber(Args['OTlosspoints']) or 1
-- Get some input
local wins = tonumber(Args['win_'..team_code_ii]) or 0
local ties = tonumber(Args['tie_'..team_code_ii]) or 0▼
local losses = tonumber(Args['loss_'..team_code_ii]) or 0
if not do_tiebr then▼
local
local gfor = tonumber(Args['gf_'..team_code_ii]) or tonumber(Args['pf_'..team_code_ii]) or 0
local gaig = tonumber(Args['ga_'..team_code_ii]) or tonumber(Args['pa_'..team_code_ii]) or 0
Line 119 ⟶ 122:
local hth_local = Args['hth_'..team_code_ii] or nil
-- Then calculate some values
local matches = wins +
local points = win_points*wins +
▲ local hth_local = Args['hth_'..team_code_ii] or nil
end▼
-- Comparison of for against
Line 152 ⟶ 146:
gcomp='−'..-gcomp
end
-- Whether to use tiebreak
local use_tiebr_val = Args['use_tiebreak'] or 'yes'
local do_tiebr = false
if yesno(use_tiebr_val) then do_tiebr = true end
-- Ties and OTL
local use_tieOTL_val = Args['use_ties'] or 'no'
local do_ties = false
if yesno(use_tieOTL_val) then do_ties = true end
-- Some local vars
Line 166 ⟶ 170:
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..wins..'\n') -- Won
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..losses..'\n') -- Lost
if do_ties then
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..ties..'\n')
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..OTlosses..'\n') -- Lost in OT
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..tiebr_val..'\n') -- Tiebreaker value
end
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gfor..'\n') -- GF
table.insert(t,'| style="'..ii_fw..bg_col..'" |'..gaig..'\n') -- GA
Line 190 ⟶ 200:
-- ------------------------------------------------------------
local status_code, status_called = {}
status_code = {
X='Clinched playoff spot', Y='Clinched division', Z='Clinched conference'}
local status_letters = '
-- Status position (before or after read and default)
Line 204 ⟶ 214:
status_position = 'after'
end
return {code=status_code, called=status_called, letters=status_letters, position=status_position}
|