用户:攸萨/手册:修订间差异

跳到导航 跳到搜索
删除1,164字节 、​ 2023年11月18日 (星期六)
无编辑摘要
无编辑摘要
标签已被回退
无编辑摘要
标签已被回退
第1行: 第1行:
-- Desktop Table
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, "nomobile"))
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=\"width:835px;max-width:100%;line-height:18px;text-align:center;display:table;white-space:normal;\"\n")
if not playable then table.insert(res_table, string.format("|-\n! colspan=\"3\" |'''%s'''", title)) end
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 "")
local piece_file_cn = mw.text.trim(args["中文语音" .. i] or "")
local piece_lack_file = (piece_file == "")
table.insert(res_table, string.format("\n|-\n!style=\"position:sticky;top:0;\"|'''%s'''\n", piece_title))
local piece_lack_jp = (piece_jp == "" and piece_cn ~= "")
local piece_lack_cn = (piece_jp ~= "" and piece_cn == "")
local piece_lack_info = piece_lack_file or piece_lack_jp or piece_lack_cn
table.insert(res_table, string.format("\n!style=\"position:sticky;top:0;width:%dpx;\"|", playable and 60 or 30))
table.insert(res_table, string.format("\n|-\n!style=\"width:120px;%s\"|'''%s'''\n", (piece_lack_info and "color:#000;" or ""), piece_title))
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>"))
table.insert(res_table, string.format("\n|style=\"width:%dpx;\"|", playable and 80 or 40))
if piece_file ~= "" then
if piece_file == "-" then
table.insert(res_table, "—")
else
local piece_file_url = (path == "") and frame:callParserFunction{name = 'filepath:' .. piece_file} or (path .. piece_file)
local piece_file_url_cn = ""
if piece_file_cn ~= "" then
                        piece_file_url_cn = (path == "") and frame:callParserFunction{name = 'filepath:' .. piece_file_cn} or (path .. piece_file_cn)
                    end
                    local player_args = {icon_width = '36px', 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})
                    if piece_file_url_cn ~= "" then
                    local player_args = {icon_width = '36px', src = piece_file_url_cn}
player_args["download_style"] = "display:none;"
player_args["play_style"] = "display:none;"
                        table.insert(res_table, frame:callParserFunction{name = '#Widget:MiniAudioPlayer', args = player_args})
                    end
end
end
lack_file = lack_file or piece_lack_file
lack_cn = lack_cn or piece_lack_cn
lack_jp = lack_jp or piece_lack_jp
end
end
end
end
table.insert(res_table, "\n|}")
15,321

个编辑

导航菜单