メニューを切り替える
Toggle preferences menu
個人設定を切り替える
ログインしていません
編集を行うと、IPアドレスが公開されます。

「モジュール:Tracklist」の版間の差分

提供: MONACA Wiki
編集の要約なし
タグ: 差し戻し済み
編集の要約なし
タグ: 手動差し戻し
92行目: 92行目:
md = (args.microdata == 'no') and false or args.id
md = (args.microdata == 'no') and false or args.id
end
end


--[[
--[[
203行目: 204行目:
end
end
if credits.extra then
if credits.extra then
--extra1列追加
--extra列追加
result = result .. '<th scope="col" style="width:' .. (args.extra_width or width.credits) .. ';">' .. credits.extra .. '</th>'
result = result .. '<th scope="col" style="width:' .. (args.extra_width or width.credits) .. ';">' .. credits.extra .. '</th>'
--extra1セル関数再定義
--extraセル関数再定義
extra = function(x) return '<td>' .. (x.extra or '&nbsp;') .. '</td>' end
extra = function(x) return '<td>' .. (x.extra or '&nbsp;') .. '</td>' end
end
end
end
if credits.length then
if credits.length then
--時間列追加
--時間列追加
218行目: 218行目:
length = function(x) return '<td style="padding-right:0.5em; text-align:right; white-space:nowrap;">' .. (x.length and ('<time datetime="'.. string.gsub(x.length, '^(%d+):(%d+)$', 'PT%1M%2S') ..'">' .. x.length .. '</time>') or '&nbsp;') .. '</td>' end
length = function(x) return '<td style="padding-right:0.5em; text-align:right; white-space:nowrap;">' .. (x.length and ('<time datetime="'.. string.gsub(x.length, '^(%d+):(%d+)$', 'PT%1M%2S') ..'">' .. x.length .. '</time>') or '&nbsp;') .. '</td>' end
end
end
end
result = result .. '</tr>'
result = result .. '</tr>'
240行目: 241行目:
for k, v in ipairs(trackA) do
for k, v in ipairs(trackA) do
local color = (v[1] % 2 == 0) and '' or '' --偶数/奇数で別色指定
local color = (v[1] % 2 == 0) and '' or '' --偶数/奇数で別色指定
result = result .. '<tr itemprop="track" itemscope itemtype="http://schema.org/MusicRecording" style="background-color:' .. color .. '; vertical-align:top;"><td style="padding-left:0.5em; text-align:right;"><span itemprop="position">' .. (v['#'] or v[1]) .. '</span>.</td><td>' .. (v.title and ('<span itemprop="name">' .. v.title .. '</span>') or 'タイトルなし') .. (v.note and ('<small>(' .. v.note .. ')</small>') or '') .. '</td>' .. writer(v) .. lyrics(v) .. music(v) .. arranger(v) ..  extra(v) .. length(v) .. '</tr>'
result = result .. '<tr itemprop="track" itemscope itemtype="http://schema.org/MusicRecording" style="background-color:' .. color .. '; vertical-align:top;"><td style="padding-left:0.5em; text-align:right;"><span itemprop="position">' .. (v['#'] or v[1]) .. '</span>.</td><td>' .. (v.title and ('<span itemprop="name">' .. v.title .. '</span>') or 'タイトルなし') .. (v.note and ('<small>(' .. v.note .. ')</small>') or '') .. '</td>' .. writer(v) .. lyrics(v) .. music(v) .. arranger(v) ..  extra(v) .. length(v) .. '</tr>'
end
end
else
else
for k, v in ipairs(trackA) do
for k, v in ipairs(trackA) do
local color = (v[1] % 2 == 0) and '' or ''
local color = (v[1] % 2 == 0) and '' or ''
result = result .. '<tr style="background-color:' .. color .. '; vertical-align:top;"><td style="padding-left:0.5em; text-align:right;">' .. (v['#'] or v[1]) .. '.</td><td>' .. (v.title and ('' .. v.title .. '') or 'タイトルなし') .. (v.note and ('<small>(' .. v.note .. ')</small>') or '') .. '</td>' .. writer(v) .. lyrics(v) .. music(v) .. arranger(v) ..  extra(v) .. length(v) .. '</tr>'
result = result .. '<tr style="background-color:' .. color .. '; vertical-align:top;"><td style="padding-left:0.5em; text-align:right;">' .. (v['#'] or v[1]) .. '.</td><td>' .. (v.title and ('' .. v.title .. '') or 'タイトルなし') .. (v.note and ('<small>(' .. v.note .. ')</small>') or '') .. '</td>' .. writer(v) .. lyrics(v) .. music(v) .. arranger(v) ..  extra(v) .. length(v) .. '</tr>'
end
end
end
end
279行目: 280行目:
total = '<time datetime="PT' .. min .. 'M' .. sec .. 'S">'.. min .. ':' .. sec .. '</time>'
total = '<time datetime="PT' .. min .. 'M' .. sec .. 'S">'.. min .. ':' .. sec .. '</time>'
--合計時間行追加
--合計時間行追加
return '<tr style="text-align:right; font-size:111%;"><th colspan="' .. (col - 1) .. '"><div style="width:7.5em; text-align:left; margin:0 0 0 auto; padding-left:0.5em; white-space:nowrap; font-weight:bold;">合計時間:</div></th><td style="padding-right:0.5em;">'.. total .. '</td></tr>'
return '<tr style="text-align:right; font-size:111%;"><th colspan="' .. (col - 1) .. '"><div style="width:7.5em; text-align:left; margin:0 0 0 auto; padding-left:0.5em; white-space:nowrap; font-weight:bold; outline:1px solid #eee;">合計時間:</div></th><td style="padding-right:0.5em;">'.. total .. '</td></tr>'
else
else
return ''
return ''