打开主菜单

少前百科GFwiki β

更改

模块:VoiceTable2

添加159字节2022年6月16日 (四) 20:36
添加全局格式参数
local title = mw.text.trim(args["表格标题"] or "")
local path = mw.text.trim(args["目录"] or "")
local suffix = args["格式"]
local lack_file = false
local lack_tran = false
local table_class = playable and "voiceTablevoiceTableBox" or "voiceTable voiceTableBox mw-collapsible mw-collapsed"
-- Table
table.insert(res_table, string.format("\n<div table class=\"%s\" >", table_class)) if not playable then table.insert(res_table, string.format("style<tr><th><div class=\"max-width:100voiceTableFirstTitle\">%;line-height:18px;text-align:center;display:table;white-space:normal;s<\/div><\"/th><\n/tr><tr><td>", title))end
if not playable then table.insert(res_table, string.format("<div class=\"voiceTableFirstTitlevoiceTable\">'''%s'''<\/div>", title)) end
for i = 1, max_pieces do
local piece_title = mw.text.trim(args["标题" .. i] or "")
local sort_title = mw.text.trim(args["分类标题" .. i] or "")
if sort_title ~= "" then
table.insert(res_table, string.format("<div class=\"voiceTableSortTitle\">'''%s'''<\/div>", sort_title)) end
if piece_title ~= "" then
local piece_jp = mw.text.trim(args["日文" .. i] or "")
local piece_lack_info = piece_lack_file or piece_lack_text or piece_lack_tran
table.insert(res_table, string.format("\n<div class=\"voiceTableTitle\" style=\"widthcolor:120px;%s;\">'''<p>%s'''<\/p><\/div>", (piece_lack_info and "color:#3F3F3F;" or "#000000"), piece_title)) table.insert(res_table, "<div class=\"voiceTableContent\">")
if playable and piece_jp ~= "" then
end
table.insert(res_table, "<\/div>")
if playable then
table.insert(res_table, string.format("\n<div class=\"voiceTableContentvoiceTableMedia\">%d", playable and 80 or 40))
if piece_file ~= "" and playable then
if piece_file == "-" then
table.insert(res_table, "—")
else
if not (string.find(piece_file, '.', -4, true)) then piece_file = piece_file .. '.' .. suffix end
local piece_file_url = (path == "") and frame:callParserFunction{name = 'filepath:' .. piece_file} or (path .. piece_file)
local player_args = {icon_width = '36px', src = piece_file_url}
end
table.insert(res_table, "<\/div><\/td><\/tr><\/table>")
return table.concat(res_table)