「モジュール:Tracklist」の版間の差分
提供: MONACA Wiki
その他の操作
今川 凌 (MONACA) (トーク | 投稿記録) 編集の要約なし |
今川 凌 (MONACA) (トーク | 投稿記録) 編集の要約なし |
||
| 167行目: | 167行目: | ||
--見出し行追加(#列・タイトル列追加) | --見出し行追加(#列・タイトル列追加) | ||
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>' | result = result .. '<tr style="text-align:left; background-color:#ff9800; 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 | ||
| 238行目: | 238行目: | ||
function (a, b) return a[1] < b[1] end | function (a, b) return a[1] < b[1] end | ||
) | ) | ||
if md then | |||
for k, v in ipairs(trackA) do | |||
local color = (v[1] % 2 == 0) and '#f7f7f7' or '#fff' --偶数/奇数で別色指定 | |||
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 | |||
else | |||
for k, v in ipairs(trackA) do | |||
local color = (v[1] % 2 == 0) and '#f7f7f7' or '#fff' | |||
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 | |||
return result | return result | ||
end | end | ||
| 269行目: | 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; outline:1px solid #eee;">合計時間:</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; background-color:#eee; outline:1px solid #eee;">合計時間:</div></th><td style="padding-right:0.5em; background-color:#ff9800;">'.. total .. '</td></tr>' | ||
else | else | ||
return '' | return '' | ||