「モジュール:Tracklist」の版間の差分
提供: MONACA Wiki
その他の操作
今川 凌 (MONACA) (トーク | 投稿記録) 編集の要約なし |
今川 凌 (MONACA) (トーク | 投稿記録) 編集の要約なし |
||
| 10行目: | 10行目: | ||
local width = {} --列幅格納用テーブル | local width = {} --列幅格納用テーブル | ||
local collapsed = false --折りたたみ可否 | local collapsed = false --折りたたみ可否 | ||
local writer, lyrics, music, arranger, strings_arrange, brass_arrange, horn_arrange, orchestra_arrange, singer | local writer, lyrics, music, arranger, strings_arrange, brass_arrange, horn_arrange, orchestra_arrange, remix, singer, extra, length = function() return '' end, function() return '' end, function() return '' end, function() return '' end, function() return '' end, function() return '' end, function() return '' end, function() return '' end, function() return '' end, function() return '' end, function() return '' end, function() return '' end --基本セル関数 | ||
local md = true --microdata on/off | local md = true --microdata on/off | ||
| 225行目: | 225行目: | ||
-- オーケストラアレンジセル関数再定義 | -- オーケストラアレンジセル関数再定義 | ||
orchestra_arrange = function(x) return '<td>' .. (x.orchestra_arrange or ' ') .. '</td>' end | orchestra_arrange = function(x) return '<td>' .. (x.orchestra_arrange or ' ') .. '</td>' end | ||
end | |||
if credits.remix then | |||
-- リミックス列追加 | |||
result = result .. '<th scope="col" style="width:' .. (args.remix_width or width.credits) .. ';">リミックス</th>' | |||
-- オーケストラアレンジセル関数再定義 | |||
remix = function(x) return '<td>' .. (x.remix or ' ') .. '</td>' end | |||
end | end | ||
if credits.singer then | if credits.singer then | ||
| 231行目: | 237行目: | ||
-- オーケストラアレンジセル関数再定義 | -- オーケストラアレンジセル関数再定義 | ||
singer = function(x) return '<td>' .. (x.singer or ' ') .. '</td>' end | singer = function(x) return '<td>' .. (x.singer or ' ') .. '</td>' end | ||
end | end | ||
if credits.extra then | if credits.extra then | ||
| 276行目: | 276行目: | ||
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) .. strings_arrange(v) .. brass_arrange(v) .. horn_arrange(v) .. orchestra_arrange(v) .. | 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) .. strings_arrange(v) .. brass_arrange(v) .. horn_arrange(v) .. orchestra_arrange(v) .. remix(v) .. singer(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) .. strings_arrange(v) .. brass_arrange(v) .. horn_arrange(v) .. orchestra_arrange(v) .. | 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) .. strings_arrange(v) .. brass_arrange(v) .. horn_arrange(v) .. orchestra_arrange(v) .. remix(v) .. singer(v) .. extra(v) .. length(v) .. '</tr>' | ||
end | end | ||
end | end | ||
| 353行目: | 353行目: | ||
if credits.horn_arrange then col = col + 1 end | if credits.horn_arrange then col = col + 1 end | ||
if credits.orchestra_arrange then col = col + 1 end | if credits.orchestra_arrange then col = col + 1 end | ||
if credits.remix then col = col + 1 end | |||
if credits.singer then col = col + 1 end | if credits.singer then col = col + 1 end | ||
return col | return col | ||
end | end | ||