Module:MLB standings: Difference between revisions

Content deleted Content added
add comments
modify to use classes defined in Template:MLB standings/styles.css
 
(3 intermediate revisions by the same user not shown)
Line 18:
--
-- readTeamInfo: table of input parsers
-- Keys are the input formats, values are functions that parse the unnamed parameters
-- that were passed to the template. and return a table holding the team name
-- and the win-loss records (either overall, or home and away, depending on the
-- input format).
-- The parsers take the following parameters:
-- args: table holding the parmetersparameters (indexed by numeric position)
-- currentIdx: the current index from where the next set of data should be parsed
-- returnData: table that the parser will update to pass additional data back to the caller.
-- returnData.cIndicesRead is updated with the number of parameters that were parsed
--
Line 73 ⟶ 76:
default = function(tableHeaderInfo)
return
'{| class="wikitable MLBStandingsTable" style="text-align:center;"\
|+ style="text-align:center;" |' .. tableHeaderInfo.navbarText .. '[[' .. tableHeaderInfo.divisionLink
.. '|' .. tableHeaderInfo.division .. ']]\
|- \
Line 89 ⟶ 92:
winLossOnly = function(tableHeaderInfo)
return
'{| class="wikitable MLBStandingsTable" style="text-align:center;"\
|+ style="text-align:center;" |' .. tableHeaderInfo.navbarText .. tableHeaderInfo.division .. '\
|- \
! width="66%" | Team\
Line 101 ⟶ 104:
wildCard2012 = function(tableHeaderInfo)
return
'{| class="wikitable MLBStandingsTable" style="text-align:center;"\
|+ style="text-align:center;" |' .. tableHeaderInfo.navbarText .. 'Wild Card teams<br><small>(Top 2 teams qualify for postseason)</small>\
|- \
! width="64%" | Team \
Line 120 ⟶ 123:
end
return
'{| class="wikitable MLBStandingsTable" style="text-align:center;"\
|+ style="text-align:center;" |' .. tableHeaderInfo.navbarText .. 'Wild Card ' .. teamText .. '<br><small>(Top ' .. numberOfTeamsText ..
' for postseason)</small>\
|- \
Line 262 ⟶ 265:
-- - winLossOnly: overall win-loss records displayed, no games behind column
-- - wildCard: wildcard standings table displayed
-- - wildCard2012: wildcard standings table displayed (effectively the same as wildcard for years from 2012-2021; kept for backwards compatibility)
--
-- frame.args.template_name: name of standings template
Line 443 ⟶ 446:
if (seedInfo[teamInfo.name] ~= nil) then
teamRowInfo.seedText = '<sup>(' .. seedInfo[teamInfo.name] .. ')</sup>&nbsp;'
teamRowInfo.rowStyle = ' styleclass="background:#CCFFCCMLBStandingsHighlightedRow"'
end
 
if (teamsToHighlight[teamInfo.name]) then
teamRowInfo.rowStyle = ' styleclass="background:#CCFFCCMLBStandingsHighlightedRow"'
end