查看“Module:SafeCate”的源代码
←
Module:SafeCate
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
local module = {} local function _isvalid(value) return value ~= nil and type(value) == "string" and mw.text.trim(value) ~= "" end function module.main(frame) local strict = frame local parent = frame:getParent() if not _isvalid(frame.args[1]) then if not (parent and _isvalid(parent.args[1])) then return end local title = parent:getTitle() if title == "Template:SafeCate" then strict, frame = parent, parent elseif mw.title.new(title).namespace == 10 and frame.args["strict"]=="1" then frame = parent else return end end local cate = frame.args[1] local mod = frame.args[2] local nsMap = { } local bExclude, nsids = false, nil if strict.args["nsid"] then nsids = mw.text.split(strict.args["nsid"], ",", true) elseif strict.args["nsidExclude"] then bExclude = true nsids = mw.text.split(strict.args["nsidExclude"], ",", true) end if nsids then for _, value in ipairs(nsids) do nsMap[tonumber(value)] = true end else nsMap[0] = true end local noSubpage = (strict).args["noSubpage"]=="1" local title = mw.title.getCurrentTitle() local curNsid = title.namespace if ((nsMap[curNsid] and (not bExclude)) or ((not nsMap[curNsid]) and bExclude)) and ((not noSubpage) or (not title.isSubpage)) then if curNsid == 10 and title.isSubpage and title.subpageText == "doc" then return end if mod then return "[[Category:"..cate.."|"..mod.."]]" else return "[[Category:"..cate.."]]" end end end return module
该页面使用的模板:
Template:Template link
(
查看源代码
)
Template:Tl
(
查看源代码
)
Module:SafeCate/doc
(
查看源代码
)
返回
Module:SafeCate
。
导航菜单
个人工具
中文
创建账号
登录
命名空间
模块
讨论
English
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
最新文件
随机页面
官方Discord
浏览NeuroWiki
人物列表
直播记录
梗列表
事件列表
物品列表
场景列表
辟谣专区
帮助
帮助
沙盒
NeuroWiki政策文件
编辑规范
怎么正确编辑&更新?
工具
链入页面
相关更改
上传文件
特殊页面
页面信息