Module:Sports table and Module:Sports table/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
fix text color in dark mode; this generally works but may cause problems, in which case revert or try specifying a different CSS value |
Use Module:Sports results/Chess/sandbox for chess results |
||
Line 37: | Line 37: | ||
local baselink = frame:getParent():getTitle() |
local baselink = frame:getParent():getTitle() |
||
if baselink == 'Module:Excerpt' then baselink = '' end |
if baselink == 'Module:Excerpt' then baselink = '' end |
||
if mw.title.getCurrentTitle(). |
if mw.title.getCurrentTitle().text == baselink then baselink = '' end |
||
local template_name = (baselink ~= '' and (':' .. baselink .. (table_anchor ~= '' and '#' .. table_anchor or ''))) |
local template_name = (baselink ~= '' and (':' .. baselink .. (table_anchor ~= '' and '#' .. table_anchor or ''))) |
||
or '' |
or '' |
||
Line 151: | Line 151: | ||
local match_table = yesno(Args['show_matches'] or 'no') and true or false |
local match_table = yesno(Args['show_matches'] or 'no') and true or false |
||
local p_matches = match_table and |
local p_matches = match_table and |
||
(style_def == 'Chess' and require('Module:Sports results/'..style_def) or require('Module:Sports results')) |
(style_def == 'Chess' and require('Module:Sports results/'..style_def..'/sandbox') or require('Module:Sports results/sandbox')) |
||
-- Custom position column label or note |
-- Custom position column label or note |
||
Line 197: | Line 197: | ||
-- Add empty column header |
-- Add empty column header |
||
t_return.count = t_return.count+1 |
t_return.count = t_return.count+1 |
||
table.insert(t_return.tab_text,'! scope="row" class="unsortable" style="background-color:white |
table.insert(t_return.tab_text,'! scope="row" class="unsortable" style="background-color:white;border-top:white;border-bottom:white;line-width:3pt;"| \n') |
||
-- Add rest of header |
-- Add rest of header |
||
Line 272: | Line 272: | ||
local result_local = Args[respre..'result'..ii] or nil |
local result_local = Args[respre..'result'..ii] or nil |
||
local bg_col = nil |
local bg_col = nil |
||
-- Get local background colour |
-- Get local background colour |
||
if result_local then |
if result_local then |
||
bg_col = result_col[Args[respre..'col_'..result_local]] or Args[respre..'col_'..result_local] or 'inherit' |
bg_col = result_col[Args[respre..'col_'..result_local]] or Args[respre..'col_'..result_local] or 'inherit' |
||
if bg_col == 'inherit' then bg_col = bg_col .. ' |
if bg_col == 'inherit' then bg_col = bg_col .. '; color: inherit' end |
||
⚫ | |||
else |
|||
⚫ | |||
⚫ | |||
⚫ | |||
end |
|||
if not bg_col then bg_col = 'background-color:transparent; color: inherit;' end -- Becomes default if undefined |
if not bg_col then bg_col = 'background-color:transparent; color: inherit;' end -- Becomes default if undefined |
||
Line 422: | Line 419: | ||
-- Get background colour |
-- Get background colour |
||
bg_col = nil |
bg_col = nil |
||
if Args[respre..'result'..ii] then |
if Args[respre..'result'..ii] then |
||
bg_col = result_col[Args[respre..'col_'..result_local]] or Args[respre..'col_'..result_local] or 'inherit' |
bg_col = result_col[Args[respre..'col_'..result_local]] or Args[respre..'col_'..result_local] or 'inherit' |
||
if bg_col == 'inherit' then bg_col = bg_col .. '; color: inherit' |
if bg_col == 'inherit' then bg_col = bg_col .. '; color: inherit' end |
||
⚫ | |||
else |
|||
⚫ | |||
end |
|||
end |
end |
||
if not bg_col then bg_col = 'background-color:transparent; color: inherit;' end -- Becomes default if undefined |
if not bg_col then bg_col = 'background-color:transparent; color: inherit;' end -- Becomes default if undefined |
||
Line 494: | Line 488: | ||
local legs = tonumber(Args['legs']) or 1 |
local legs = tonumber(Args['legs']) or 1 |
||
-- Add empty cell |
-- Add empty cell |
||
table.insert(t,'| style="background-color:white |
table.insert(t,'| style="background-color:white;border-top:white;border-bottom:white;"| \n') |
||
-- Now include note to match results if needed |
-- Now include note to match results if needed |