「モジュール:Tracklist」の版間の差分
提供: MONACA Wiki
その他の操作
今川 凌 (MONACA) (トーク | 投稿記録) 編集の要約なし タグ: 差し戻し済み |
今川 凌 (MONACA) (トーク | 投稿記録) 編集の要約なし タグ: 差し戻し済み |
||
| 10行目: | 10行目: | ||
local width = {} --列幅格納用テーブル | local width = {} --列幅格納用テーブル | ||
local collapsed = false --折りたたみ可否 | local collapsed = false --折りたたみ可否 | ||
local writer, lyrics, music, arranger, | local writer, lyrics, music, arranger, extra, length = 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 | ||
| 83行目: | 83行目: | ||
end | end | ||
credits. | credits.extra = args.extra_column | ||
if credits.writing then | if credits.writing then | ||
credits.lyrics, credits.music = false, false | credits.lyrics, credits.music = false, false | ||
| 92行目: | 92行目: | ||
md = (args.microdata == 'no') and false or args.id | md = (args.microdata == 'no') and false or args.id | ||
end | end | ||
--[[ | --[[ | ||
| 229行目: | 202行目: | ||
arranger = function(x) return '<td>' .. (x.arranger or all.arrangements and all.arrangements[2] or all.producing and all.producing[2] or all.all and all.all[2] or ' ') .. '</td>' end | arranger = function(x) return '<td>' .. (x.arranger or all.arrangements and all.arrangements[2] or all.producing and all.producing[2] or all.all and all.all[2] or ' ') .. '</td>' end | ||
end | end | ||
if credits. | if credits.extra then | ||
--extra1列追加 | --extra1列追加 | ||
result = result .. '<th scope="col" style="width:' .. (args. | result = result .. '<th scope="col" style="width:' .. (args.extra_width or width.credits) .. ';">' .. credits.extra .. '</th>' | ||
--extra1セル関数再定義 | --extra1セル関数再定義 | ||
extra = function(x) return '<td>' .. (x.extra or ' ') .. '</td>' end | |||
end | end | ||
end | end | ||
| 285行目: | 240行目: | ||
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) .. | 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) .. | 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 | ||