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

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

提供: MONACA Wiki
編集の要約なし
タグ: 差し戻し済み
編集の要約なし
タグ: 差し戻し済み
10行目: 10行目:
local width = {} --列幅格納用テーブル
local width = {} --列幅格納用テーブル
local collapsed = false --折りたたみ可否
local collapsed = false --折りたたみ可否
local writer, lyrics, music, arranger, extra1, extra2, extra3, extra4, 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 --基本セル関数
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.extra1 = args.extra1_column
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
credits.extra2 = args.extra2_column
if credits.writing then
credits.lyrics, credits.music = false, false
if credits.writing ~= true then credits.arrangements = false end
end
if credits.music and credits.music ~= true then credits.arrangements = false end
collapsed = (args.collapsed == 'yes')
md = (args.microdata == 'no') and false or args.id
credits.extra3 = args.extra3_column
if credits.writing then
credits.lyrics, credits.music = false, false
if credits.writing ~= true then credits.arrangements = false end
end
if credits.music and credits.music ~= true then credits.arrangements = false end
collapsed = (args.collapsed == 'yes')
md = (args.microdata == 'no') and false or args.id
credits.extra4 = args.extra4_column
if credits.writing then
credits.lyrics, credits.music = false, false
if credits.writing ~= true then credits.arrangements = false end
end
if credits.music and credits.music ~= true then credits.arrangements = false end
collapsed = (args.collapsed == 'yes')
md = (args.microdata == 'no') and false or args.id


--[[
--[[
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 '&nbsp;') .. '</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 '&nbsp;') .. '</td>' end
end
end
if credits.extra1 then
if credits.extra then
--extra1列追加
--extra1列追加
result = result .. '<th scope="col" style="width:' .. (args.extra1_width or width.credits) .. ';">' .. credits.extra1 .. '</th>'
result = result .. '<th scope="col" style="width:' .. (args.extra_width or width.credits) .. ';">' .. credits.extra .. '</th>'
--extra1セル関数再定義
--extra1セル関数再定義
extra1 = function(x) return '<td>' .. (x.extra1 or '&nbsp;') .. '</td>' end
extra = function(x) return '<td>' .. (x.extra or '&nbsp;') .. '</td>' end
end
if credits.extra2 then
--extra2列追加
result = result .. '<th scope="col" style="width:' .. (args.extra2_width or width.credits) .. ';">' .. credits.extra2 .. '</th>'
--extra2セル関数再定義
extra2 = function(x) return '<td>' .. (x.extra2 or '&nbsp;') .. '</td>' end
end
if credits.extra3 then
--extra3列追加
result = result .. '<th scope="col" style="width:' .. (args.extra3_width or width.credits) .. ';">' .. credits.extra3 .. '</th>'
--extra3セル関数再定義
extra3 = function(x) return '<td>' .. (x.extra3 or '&nbsp;') .. '</td>' end
end
if credits.extra4 then
--extra4列追加
result = result .. '<th scope="col" style="width:' .. (args.extra4_width or width.credits) .. ';">' .. credits.extra4 .. '</th>'
--extra4セル関数再定義
extra4 = function(x) return '<td>' .. (x.extra4 or '&nbsp;') .. '</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) ..  extra1(v) .. extra2(v) .. extra3(v) .. extra4(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) ..  extra1(v) .. extra2(v) .. extra3(v) .. extra4(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