打开/关闭搜索
搜索
打开/关闭菜单
1706
4999
924
6.3万
RIA | Wiki
导航
首页
最近更改
随机页面
MediaWiki帮助
上传文件
RIA社群
RIA官网&红报社
RIA论坛
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
登录
目前wiki关闭了自行注册账号的功能,如需注册账号,请查阅
Help:注册账号
。
查看“︁模块:Iconbar”︁的源代码
来自RIA | Wiki
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
模块:Iconbar
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于这些用户组的用户执行:
用户
、已验证用户
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
local p = {} function p.bar(frame) local args = frame.args or {} local full = args.full local half = args.half or 'Half ' .. full local empty = args.empty or 'Empty ' .. full local value = math.abs(tonumber(args.value) or 0) / 2 local min = math.ceil(math.abs(tonumber(args.min) or 0) / 2) local sizeValue = args.size or '' local title = args.title or '' local reverse = args.reverse or '' if not full then return '错误:缺少必需的full参数' end local titleAttr = '' if title:lower() == 'none' then titleAttr = '' elseif title ~= '' then titleAttr = ' title="' .. title .. '"' else local displayValue = (tonumber(args.value) or 0) titleAttr = ' title="' .. displayValue .. '"' end local sizeParam = '' if sizeValue ~= '' then if tonumber(sizeValue) then sizeParam = '|' .. sizeValue .. 'px' elseif sizeValue:match('em') then local emValue = tonumber(sizeValue:match('([%d%.]+)em')) or 1 local pixelSize = math.floor(emValue * 16) sizeParam = '|' .. pixelSize .. 'px' else sizeParam = '|' .. sizeValue end else sizeParam = '|16px' end local fullIcon = '' local halfIcon = '' local emptyIcon = '' if value == 0 then emptyIcon = '[[File:' .. empty .. sizeParam .. ']]' else local fullCount = math.floor(value) if fullCount > 0 then fullIcon = string.rep('[[File:' .. full .. sizeParam .. ']]', fullCount) end if math.floor(value) ~= value then halfIcon = '[[File:' .. half .. sizeParam .. ']]' end end local emptyCount = min - math.ceil(value) if emptyCount > 0 then emptyIcon = string.rep('[[File:' .. empty .. sizeParam .. ']]', emptyCount) end if reverse ~= '' then return '<span class="pixel-image nowrap"' .. titleAttr .. '>' .. emptyIcon .. halfIcon .. fullIcon .. '</span>' else return '<span class="pixel-image nowrap"' .. titleAttr .. '>' .. fullIcon .. halfIcon .. emptyIcon .. '</span>' end end return p
该页面嵌入的页面:
模板:Documentation
(
查看源代码
)
模块:Arguments
(
查看源代码
)
模块:Documentation
(
查看源代码
)
模块:Documentation/config
(
查看源代码
)
模块:Documentation/i18n
(
查看源代码
)
模块:Documentation/styles.css
(
查看源代码
)
模块:Iconbar/doc
(
查看源代码
)
模块:Message box
(
查看源代码
)
模块:No globals
(
查看源代码
)
模块:Yesno
(
查看源代码
)
返回
模块:Iconbar
。
查看“︁模块:Iconbar”︁的源代码
来自RIA | Wiki