Modul:Football box: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
kTidak ada ringkasan suntingan |
Tidak ada ringkasan suntingan |
||
Baris 1:
--
local p = {}
local lang = nil
local delink = require('
local eventschema = "http://schema.org/SportsEvent"
local teamschema = "http://schema.org/SportsTeam"
local placeschema = "http://schema.org/Place"
local penalties = '[[
local aet = '[[Perpanjangan waktu (sepak bola)|p.w.]]'
local asdet = '[[:en:Sudden death (sport)#Association football|p.w.s.d.]]'
local agget = '[[Perpanjangan waktu (sepak bola)|p.w.]]/[[Gol emas|g.e.]]'
local asget = '[[Perpanjangan waktu (sepak bola)|p.w.]]/[[Gold perak|g.p.]]'
local attendance = 'Penonton:'
local referee = 'Wasit:'
local templatestyles = 'Modul:Football box/styles.css'
local tracking, preview
local function checkarg(k,v)
if not k
▲ elseif k == 'size' or k == 'bg' or k == 'id' or k == 'event' or
k == 'referee' or k == 'stack' or k == 'section' or k == 'transcludesection' then
-- tidak valid
local vlen = mw.ustring.len(k) end▼
end
end
local function timestamp(d, t)
if not d then return nil end
end▼
end
return nil▼
end
Baris 59 ⟶ 61:
s = mw.ustring.gsub(s, '%[%[ *[%?-] *| *(.-) *%]%]', '%1')
if mw.ustring.sub(s, 1, 1) == '*' then
-- juga dapat mengembangkan plainlist di sini
return tostring(mw.html.create('div'):addClass('plainlist'):newline():wikitext(s))▼
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles', args = { src = 'Plainlist/styles.css' }
end
return s
Baris 65 ⟶ 70:
local function makelink(s,t)
if s:match('^
return '[' .. s .. ' ' .. t .. ']'
end
Baris 84 ⟶ 89:
function p.main(frame)
-- Keluar lebih awal jika menggunakan transklusi bagian untuk bagian yang berbeda
local args = require('Module:Arguments').getArgs(frame)▼
local tsection = frame:getParent().args['transcludesection'] or frame:getParent().args['section'] or ''
local bsection = frame.args['section'] or ''
if( tsection ~= '' and bsection ~= '' ) then
if( tsection ~= bsection ) then
▲ end
local id = getid(args['id'])
local d = timestamp(args['date'], args['time'])
Baris 96 ⟶ 110:
end
local score = '
if args['score1'] or args['score2
score = (args['score1
elseif
score = args['score
end
if args['aet'] then
score = score .. ' (' .. aet .. ')'
elseif args['asdet'] then
score = score .. ' (' .. asdet .. ')'
elseif args['agget'] then
score = score .. ' (' .. agget .. ')'
elseif args['asget'] then
score = score .. ' (' .. asget .. ')'
end
if args['scorenote'] then
Baris 109 ⟶ 129:
end
--
local root =
mw.html.create('div')
Baris 126 ⟶ 146:
end
--
block = root:tag('div')
:addClass('fleft')
Baris 136 ⟶ 155:
timetag:tag('div')
:addClass('fdate')
:wikitext(args['date'])
Baris 142 ⟶ 160:
if args['time'] then
timetag:tag('div')
:addClass('ftime')
:wikitext(args['time'])
Baris 149 ⟶ 166:
if args['round'] then
block:tag('div')
:addClass('frnd')
:wikitext(args['round'])
end
--
--
local rtable = root:tag('table')
:addClass('fevent')
Baris 189 ⟶ 205:
row:newline()
row:tag('td')
:wikitext(makelink(args['report'] or '', '
row:newline()
row:tag('td')
Baris 217 ⟶ 233:
row:newline()
end
--
--
block = root:tag('div')
:addClass('fright')
if args['stadium
local sdiv = block:tag('div')
:attr('itemprop', 'location')
Baris 232 ⟶ 247:
sdiv:tag('span')
:attr('itemprop', 'name')
:wikitext(args['stadium
sdiv:wikitext(', ')
sdiv:tag('span')
Baris 240 ⟶ 255:
sdiv:tag('span')
:attr('itemprop', 'name address')
:wikitext(args['stadium
end
end
if args['attendance
block:tag('div'):wikitext(attendance ..' ' .. args['attendance'])
end
Baris 252 ⟶ 267:
local trackstr = (#tracking > 0) and table.concat(tracking, '') or ''
if #preview > 0
trackstr =
}) .. trackstr
▲ :wikitext('Unknown parameters: ' .. table.concat(preview, '; ')))
end
|