打开/关闭搜索
搜索
打开/关闭菜单
通知
打开/关闭个人菜单
查看“Module:LineList”的源代码
爱来自氢气工艺喵!(づ。◕◡◡◕。)づ
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
Module:LineList
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于这些用户组的用户执行:
用户
、admin
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
-- -- 柠檬写的 230909 -- local p = {} function p.infobox(frame) local args = frame:getParent().args local lineName = args.Name local lineColor = args.Color local company = args.Company local ticket = args.Ticket local firstTrain = args.FirstTrain local lastTrain = args.LastTrain local output = mw.html.create("div") output:addClass("infobox-card") if args.Clear ~= nil then output:cssText('clear: unset;') end local header = output:tag("div"):addClass("header") header:tag("div"):addClass("line-name"):wikitext(lineName) local detail = header:tag("div"):addClass("detail") detail:tag("div"):addClass("company"):wikitext(company) local time = header:tag("div"):addClass("time") time:tag("div"):addClass("first-train"):wikitext(firstTrain) time:tag("div"):addClass("last-train"):wikitext(lastTrain) time:tag("div"):addClass("ticket"):wikitext(ticket) local stationList = output:tag("ul"):addClass("station-list") if args.Direction then local direction = args.Direction stationList:tag("div"):addClass("direction"):wikitext(direction) end stationList:wikitext("<div class='line' style='background-color:" .. lineColor .. ";'></div>") local maxStationIndex = 0 for key, _ in pairs(args) do local stationIndex = tonumber(key:match("^Sta(%d+)$")) if stationIndex and stationIndex > maxStationIndex then maxStationIndex = stationIndex end end for stationIndex = 1, maxStationIndex do local stationInfo = args["Sta" .. stationIndex] if stationInfo then local li = stationList:tag("li") local stationDiv = li:tag("div"):addClass("name") local stationDivCircle = stationDiv:tag("div"):addClass("circle"):cssText('border: 4px solid ' .. lineColor .. ';') local expandedText = frame:preprocess(stationInfo) stationDiv:wikitext(expandedText) -- 未开放 if args["Sta" .. stationIndex .. "Unopen"] then stationDiv:cssText('color: var(--color-base--subtle);') stationDivCircle:cssText('border: 4px solid var(--color-surface-4);') end -- 单向运营 local way = args["Sta" .. stationIndex .. "Way"] if way then if string.lower(way) == "up" then stationDiv:addClass("dir-tag__up") elseif string.lower(way) == "down" then stationDiv:addClass("dir-tag__down") end end end end return tostring(output) end return p
本页使用的模板:
Module:LineList/doc
(
查看源代码
)
返回
Module:LineList
。
为了让您的浏览体验更加高效、方便和个性化,遵照《中华人民共和国网络安全法》和《信息安全技术个人信息安全规范》,我们需要您允许本站使用Cookies。在某些情况下,Cookies是使网站正常运行的必要条件。
了解并同意