有兽档案馆
搜索
切换搜索
切换菜单
切换个人菜单
查看“Module:EditState”的源代码
来自有兽档案馆
阅读
查看源代码
查看历史
模块
讨论
更多操作
←
Module:EditState
因为以下原因,您没有权限编辑该页面:
您所请求的操作,仅限具有
注册用户
、
自动确认用户
、
管理员
、
界面管理员
、
优质编辑者
、
确认用户
、
巡查员
、
档案理事员
等
权限
的
用户
执行。
若您尚未登录有兽档案馆账号,请您
登录
有兽档案馆账号后操作。
您尚未完成电子邮件确认,因此操作受限,请尽快
完成电子邮件确认
。
若您无法完成前述手续,请通过适当渠道请求管理员或档案理事员协助。
您可以查看和复制此页面的源代码。
若您无权编辑本页面,您可以
提出编辑请求
,提请有权限者代为编辑。
local p={} local lib_arg={}; local yesno = {} function p.isPreview() local frame = mw.getCurrentFrame() local check_str = '{{REVISIONID}}' if mw.isSubsting() then check_str = "{{safesubst:REVISIONID}}" end local Preview_mode = frame:preprocess(check_str); -- use magic word to get revision id return (Preview_mode == nil or mw.text.trim(Preview_mode or '') == '') -- if there is a value then this is not a preiview end function p.isCreating() local frame = mw.getCurrentFrame() local check_str = '{{PAGEID}}' if mw.isSubsting() then check_str = "{{safesubst:PAGEID}}" end local Preview_mode = frame:preprocess(check_str); return (Preview_mode == nil or mw.text.trim(Preview_mode or '') == '') end function p.hasParent(layer) local frame = mw.getCurrentFrame() local times = tonumber(layer or '') or 0 local Parent = frame:getParent(); for i=2,tonumber(times) do Parent = Parent:getParent() if Parent == nil then break end end return not (Parent == nil or Parent == '') end function p.getTitle(layer) local frame = mw.getCurrentFrame() local times = tonumber(layer or '') or 0 if times <= 0 then return frame:getTitle()end local Parent = frame:getParent(); for i=2,tonumber(times) do Parent = Parent:getParent() if Parent == nil then return '' end end return Parent:getTitle(); end function p.nextSubst(frame) local args, working_frame if frame == mw.getCurrentFrame() then -- We're being called via #invoke. The args are passed through to the module -- from the template page, so use the args that were passed into the template. if lib_arg.getArgs == nil then lib_arg = require('Module:Arguments') end args = lib_arg.getArgs(frame, { parentFirst=true, trim = false, removeBlanks = false }) working_frame = frame else -- We're being called from another module or from the debug console, so assume -- the args are passed in directly. args = frame working_frame = mw.getCurrentFrame() if type(args) ~= type({}) then args = {frame} end end local input_data = args[1] or args['1'] if mw.text.trim(input_data or '') == '' then return '' end local num_args = {} for key,value in pairs(args) do local num = tonumber(key) or 0 local stored = false if num then if num > 1 then num_args[key - 1] = value stored = true end if num == 1 then stored = true end end if stored ~= true then num_args[key] = value end end local str_args = mw.ustring.sub(require('Module:Template invocation').invocation(input_data, num_args),3,-3) if(mw.isSubsting())then return "{{subst:" .. str_args .. "}}" ; end return working_frame:preprocess("{{safesubst:" .. str_args .. "}}") end return p
该页面使用的模板:
Module:Arguments
(
查看源代码
)
Module:Documentation
(
查看源代码
)
Module:EditState
(
查看源代码
)
Module:EditState/doc
(
查看源代码
)
Module:Fullurl
(
查看源代码
)
Module:No globals
(
查看源代码
)
Module:Page name
(
查看源代码
)
Module:Yesno
(
查看源代码
)
返回
Module:EditState
。