打开/关闭搜索
搜索
打开/关闭菜单
1K
5.2K
4
8.2K
星砂岛百科
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
上传文件
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
本站正在进行早期测试,目前仍存在许多内容的缺失。
查看“︁模块:Common”︁的源代码
来自星砂岛百科
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
模块:Common
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:已验证邮箱用户
您没有权限编辑
模块
命名空间内的页面。
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
local p = {} local cache = {} function p.trim(value) if value == nil then return '' end return mw.text.trim(tostring(value)) end function p.getArg(frame, key, default) local value = frame.args[key] if value == nil and frame:getParent() then value = frame:getParent().args[key] end value = p.trim(value) if value == '' then return default or '' end return value end function p.toText(value, sep) if value == nil then return '' end if type(value) == 'boolean' then return value and '是' or '否' end if type(value) == 'table' then local parts = {} for _, item in ipairs(value) do parts[#parts + 1] = tostring(item) end return table.concat(parts, sep or '、') end return tostring(value) end function p.normalizeKey(value) return mw.ustring.lower(p.trim(value)) end function p.readJsonPage(titleText) local pageName = p.trim(titleText) if pageName == '' then return nil end if cache[pageName] ~= nil then return cache[pageName] end local title = mw.title.new(pageName) if not title then cache[pageName] = nil return nil end local content = title:getContent() if not content or content == '' then cache[pageName] = nil return nil end local ok, data = pcall(mw.text.jsonDecode, content) if not ok or type(data) ~= 'table' then cache[pageName] = nil return nil end cache[pageName] = data return data end function p.getCurrentTitleText() return mw.title.getCurrentTitle().text end return p
该页面嵌入的页面:
模块:Common/doc
(
查看源代码
)
返回
模块:Common
。
查看“︁模块:Common”︁的源代码
来自星砂岛百科