查看“模块:Toolbar”的源代码
←
模块:Toolbar
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
该页面已被保护以防止编辑和其他操作。
您必须确认您的电子邮件地址才能编辑页面。请通过
系统设置
设置并确认您的电子邮件地址。
您可以查看与复制此页面的源代码。
local p = {} local function getArgNums(args) -- Get the keys of the numerical arguments that are present. local nums = {} local tinsert = table.insert for k, v in pairs(args) do if type(k) == 'number' then tinsert(nums, k) end end table.sort(nums) return nums end local function makeToolbarItems(args) local nums = getArgNums(args) local sep = (args.separator or 'pipe') .. '-separator' sep = mw.message.new(sep):plain() local ret = {} local tinsert = table.insert for i, v in ipairs(nums) do tinsert(ret, args[v]) end if #ret > 0 then return table.concat(ret, sep) end end function p._main(args) local toolbarItems = makeToolbarItems(args) if not toolbarItems then return '' end -- Return the blank string if no arguments were specified, rather than returning empty brackets return mw.ustring.format( '<span class="plainlinks%s"%s>(%s)</span>', type(args.class) == 'string' and ' ' .. args.class or '', type(args.style) == 'string' and mw.ustring.format(' style="%s"', args.style) or '', toolbarItems ) end function p.main(frame) -- If called via #invoke, use the args passed into the invoking template. -- Otherwise, for testing purposes, assume args are being passed directly in. local origArgs if frame == mw.getCurrentFrame() then origArgs = frame:getParent().args for k, v in pairs(frame.args) do origArgs = frame.args break end else origArgs = frame end -- Strip whitespace and remove nil values local args = {} for k, v in pairs(origArgs) do if type(v) == 'string' then v = mw.text.trim(v) end if v ~= '' then args[k] = v end end return p._main(args) end return p
该页面使用的模板:
模块:Toolbar/doc
(
查看源代码
)
返回至
模块:Toolbar
。
导航菜单
个人工具
创建账户
登录
命名空间
模块
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
所有条目
分类索引
PV政策
PV人物
PV电站
PV企业
PV技术
PV标准
PV工艺
PV导航
最近更改
随机页面
帮助
编辑规范
新手速成
编辑手册
能库部署
帮助
链接
光伏們
坎德拉学院
关于
我们的目标
关于能库
工具
链入页面
相关更改
特殊页面
页面信息