「モジュール:Tracklist」の版間の差分
提供: MONACA Wiki
その他の操作
今川 凌 (MONACA) (トーク | 投稿記録) 編集の要約なし |
今川 凌 (MONACA) (トーク | 投稿記録) 編集の要約なし |
||
| 167行目: | 167行目: | ||
--見出し行追加(#列・タイトル列追加) | --見出し行追加(#列・タイトル列追加) | ||
result = result .. '<tr style="text-align:left | result = result .. '<tr style="text-align:left; font-size:111%;"><th scope="col" style="width:2em; padding-right:0.3em; text-align:right; white-space:nowrap;">#</th><th scope="col" style="width:' .. width.title .. '; padding-left:0.9em; white-space:nowrap;">タイトル</th>' | ||
if credits.writing then | if credits.writing then | ||
| 240行目: | 240行目: | ||
if md then | if md then | ||
for k, v in ipairs(trackA) do | for k, v in ipairs(trackA) do | ||
local color = (v[1] % 2 == 0) and ' | 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 ' | 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 | ||
| 280行目: | 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 | 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 '' | ||