模組討論:Infobox
跳至導覽
跳至搜尋
編輯請求 - 淮南皓月 - 2023.02.25
由淮南皓月提出的對模塊:Infobox的編輯請求:
- 狀態: 完成
將以下內容:
-- Line 2:
local inner_args = { ["wrapper"] = true, ["m-style"] = true, ["font-size"] = true, ["text-align"] = true, ["width"] = true, ["max-width"] = true, ["float"] = true, ["bg-color"] = true, ["m-bcolor"] = true, ["m-color"] = true,
-- Line 45:
:addClass("infobox")
-- Line 64:
local td_title = box:tag("tr"):tag("td"):attr("colspan", "2")
-- Line 73-74:
:wikitext(_chk_arg("Title", "title", "标题") or mw.title.getCurrentTitle().fullText)
end
-- Line 81:
local td_top = box:tag("tr"):tag("td"):attr("colspan", "2")
-- Line 94:
td_top:wikitext("[[Image:" .. arg_image .. "|" .. size .. "]]")修改為:
-- Line 2:
local inner_args = { ["wrapper"] = true, ["class"] = true, ["m-style"] = true, ["font-size"] = true, ["text-align"] = true, ["width"] = true, ["max-width"] = true, ["float"] = true, ["bg-color"] = true, ["m-bcolor"] = true, ["m-color"] = true,
-- Line 45:
:addClass("infobox"):addClass(_chk_arg("class") or "")
-- Line 64:
local td_title = box:tag("tr"):addClass("infobox-title"):tag("td"):css("padding", "0"):attr("colspan", "2")
-- Line 73-74:
end
td_title:wikitext(_chk_arg("Title", "title", "标题") or mw.title.getCurrentTitle().fullText)
-- Line 81:
local td_top = box:tag("tr"):tag("td"):attr("colspan", "2")
-- Line 94:
td_top:wikitext("[[Image:" .. arg_image .. "|" .. size .. "|class=infobox-image]]")- 修復
top-style不為空時沒有標題文字的bug; - 給標題行和配圖行添加與其他信息欄一致的class;
- 增加一個
class參數,允許給表格添加額外的class(比如運維喜歡的moe-infobox)。
主要是修bug,後兩條是順帶的。〔巡〕淮南皓月 🌙 2023年2月25日 (六) 02:28 (CST)
編輯請求 - 淮南皓月 - 2023.05.23
由淮南皓月提出的對模塊:Infobox的編輯請求:
- 狀態: 完成
將以下內容:
td_title:wikitext(_chk_arg("Title", "title", "标题") or mw.title.getCurrentTitle().fullText)
修改為:
td_title:wikitext(_chk_arg("Title", "title", "标题", "標題") or mw.title.getCurrentTitle().fullText)
另外在第四行加一個["標題"] = true。
理由:
- 不合旁的參數名(如「標題背景色」)都支持繁簡,單標題不支持。
附言: