15,321
个编辑
无编辑摘要 标签:已被回退 |
无编辑摘要 标签:已被回退 |
||
第1行: | 第1行: | ||
table.insert(res_table, string.format("\n{|class=\"%s %s\" ", table_class, "nodesktop")) | |||
table.insert(res_table, string.format("\n{|class=\"%s %s\" ", table_class, " | table.insert(res_table, "style=\"width:100%;line-height:18px;text-align:center;display:table;white-space:normal;font-size:unset;\"\n") | ||
table.insert(res_table, "style=\" | |||
if not playable then table.insert(res_table, string.format("|-\n! colspan=\" | if not playable then table.insert(res_table, string.format("|-\n! colspan=\"2\" |'''%s'''", title)) end | ||
for i = 1, max_pieces do | for i = 1, max_pieces do | ||
第12行: | 第11行: | ||
local piece_cond = mw.text.trim(args["条件" .. i] or "") | local piece_cond = mw.text.trim(args["条件" .. i] or "") | ||
local piece_file = mw.text.trim(args["语音" .. i] or "") | local piece_file = mw.text.trim(args["语音" .. i] or "") | ||
table.insert(res_table, string.format("\n|-\n!style=\"position:sticky;top:0;\"|'''%s'''\n", piece_title)) | |||
table.insert(res_table, string.format("\n!style=\"position:sticky;top:0;width:%dpx;\"|", playable and 60 or 30)) | |||
if piece_file ~= "" then | |||
table.insert(res_table, "|style=\"text-align:left;\"|") | local piece_file_url = frame:callParserFunction{name = 'filepath:' .. piece_file} | ||
local player_args = {icon_width = '27px', src = piece_file_url} | |||
if piece_file_url == "" then | |||
player_args["download_style"] = "display:none;" | |||
player_args["play_style"] = "display:none;" | |||
end | |||
if not playable then player_args["download_style"] = "display:none;" end | |||
table.insert(res_table, frame:callParserFunction{name = '#Widget:MiniAudioPlayer', args = player_args}) | |||
end | |||
table.insert(res_table, string.format("\n|-\n|colspan=\"%d\" style=\"text-align:left;\"|", (playable and 3 or 2))) | |||
if playable and piece_jp ~= "" and piece_cn ~= "" then | if playable and piece_jp ~= "" and piece_cn ~= "" then | ||
第32行: | 第39行: | ||
table.insert(res_table, ((piece_cond ~= "") and string.format("'''(%s)'''</p>", piece_cond) or "</p>")) | table.insert(res_table, ((piece_cond ~= "") and string.format("'''(%s)'''</p>", piece_cond) or "</p>")) | ||
end | end | ||
end | end | ||
table.insert(res_table, "\n|}") |