Modul:Sports results: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
kTidak ada ringkasan suntingan |
k update |
||
Baris 47:
-- Load some other modules
local p_sub = require('Module:Sports table/sub')
-- Alternative syntax for team list
if Args['team_order'] and Args['team_order'] ~= '' then
local tlist = mw.text.split(Args['team_order'], '%s*[;,]%s*')
for k, tname in ipairs(tlist) do
if tname ~= '' then
Args['team' .. k] = tname
end
end
end
-- Read in number of consecutive teams (ignore entries after skipping a spot)
Baris 92 ⟶ 102:
team_code_ii = team_list[ii]
team_name = Args['name_'..team_code_ii] or team_code_ii
local ii_style = 'text-align:' .. (Args['team_align'] or 'right') .. ';'
.. (ii and ii == ii_show and 'font-weight:bold;' or '')
.. (Args['team_nowrap'] and 'white-space:nowrap;' or '')
local team_note = Args['note_'..team_code_ii]
if team_note then
notes_exist = true
-- Only when it exist
-- First check for existence of reference for note
if not Args['note_'..team_note] then
-- It's the entry
-- Add random end for unique ID if more tables are present on article (which might otherwise share an ID)
note_id = '"table_note_'..team_code_ii..rand_val..'"'
note_id_list[team_code_ii] = note_id
note_string = frame:expandTemplate{ title = 'efn',
args = { group='lower-alpha', name=note_id, team_note} }
else
-- Check for existence elsewhere
local note_local_num = team_list[team_note] or ii_end + 1
if note_id_list[team_note] or ((note_local_num >= ii_start) and (note_local_num <= ii_end)) then
-- It exists
note_id = '"table_note_'..team_note..rand_val..'"' -- Identifier
note_string = frame:extensionTag{ name = 'ref',
args = { group = 'lower-alpha', name = note_id} }
else
-- Now define the identifier for this
-- Add random end for unique ID
note_id = '"table_note_'..team_note..rand_val..'"'
note_id_list[team_note] = note_id
-- Call refn template
note_string = frame:expandTemplate{ title = 'efn',
args = { group='lower-alpha', name=note_id, Args['note_'..team_note]} }
end
end
-- Now append this to the team_name string
team_name = team_name..note_string
end
-- Team names
table.insert(t,'|- \n') -- New row
Baris 119 ⟶ 162:
note_id_list[team_code_ii..'_'..team_code_jj] = note_id
note_string = frame:expandTemplate{ title = 'efn',
args = { group='
else
-- Check for existence elsewhere
Baris 135 ⟶ 178:
-- Call refn template
note_string = frame:expandTemplate{ title = 'efn',
args = { group='
end
end
Baris 176 ⟶ 219:
if (Args['matches_style'] or '') == 'FBR' then
table.insert(t_footer, Args['team_header']
and '<br />
or '<br />
elseif (Args['matches_style'] or '') == 'BSR' then
table.insert(t_footer, Args['team_header']
and '<br />
or '<br />
end
if Args['a_note'] then
Baris 195 ⟶ 238:
-- As reflist size text
t_footer = '<div class="reflist">'..table.concat(t_footer)..'</div>'
t_footer = t_footer..frame:expandTemplate{ title = 'notelist', args = { group='
else
-- As reflist size text
Baris 210 ⟶ 253:
end
end
return
.. '<div class="noresize overflowbugx" style="overflow:auto">\n'
.. table.concat(t) .. '</div></div>'
end
Baris 226 ⟶ 271:
elseif ss == 'flag' then
n = mw.ustring.gsub(n, '(<span class="flagicon">%s*%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*link=)[^%|%[%]]*(%]%][^<>]*</span>)%s*%[%[([^%[%]%|]*)%|[^%[%]]*%]%]', '%1%3%2')
n = mw.ustring.gsub(n, '(<span class="flagicon">%s*%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*%]%][^<>]*</span>).*', '%1')
n = mw.ustring.gsub(n, ' (</span>)', '%1')
end
Baris 369 ⟶ 415:
end
end
return tt
end
|