编辑“
Module:EditState
”
跳转到导航
跳转到搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
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.previewNotice(frame) if mw.isSubsting() then return '' end local text = '' if type(frame) == type('string') then --type('string') avoid version change text = mw.text.trim(frame) else if type((frame or {}).args) ~= type({}) then frame.args = {} end text = mw.text.trim(frame.args['1'] or frame.args[1] or frame.args.text or frame['1'] or frame[1] or frame.text or '') end text = mw.text.trim(text) if text ~= '' then mw.addWarning(text) end return '' 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
摘要:
请注意,您对Positive WiKi的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Positive WiKi:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
Module:EditState/doc
(
编辑
)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
模块
讨论
English
查看
阅读
编辑源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息