打开/关闭搜索
搜索
打开/关闭菜单
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:getParent().args or {} -- 先检查所有必需参数 if not args.full then local debug_info = "接收到的参数:" for k, v in pairs(args) do debug_info = debug_info .. k .. "=" .. tostring(v) .. ", " end return '错误:缺少必需的full参数。' .. debug_info end 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 size = args.size or '' local title = args.title or '' local reverse = args.reverse or '' -- 添加调试信息 local debug_info = "" for k, v in pairs(args) do debug_info = debug_info .. k .. "=" .. tostring(v) .. ", " end -- 检查full参数 if not args.full then return '错误:full参数为nil。接收到的参数:' .. debug_info end if title:lower() == 'none' then title = '' elseif title ~= '' then title = ' title="' .. title .. '"' else title = ' title="' .. value .. '"' end local fullIcon = '' local halfIcon = '' local emptyIcon = '' if tonumber( size ) then size = '|' .. size .. 'px' elseif size ~= '' then size = '|' .. size end if value == 0 then emptyIcon = '[[File:' .. empty .. size .. ']]' else fullIcon = string.rep( '[[File:' .. full .. size .. ']]', math.floor( value ) ) if math.floor( value ) ~= value then halfIcon = '[[File:' .. half .. size .. ']]' end end if min - value >= 1 then emptyIcon = string.rep( '[[File:' .. empty .. size .. ']]', min - math.ceil( value ) ) end if reverse ~= '' then return '<span class="pixel-image nowrap"' .. title .. '>' .. emptyIcon .. halfIcon .. fullIcon .. '</span>' else return '<span class="pixel-image nowrap"' .. title .. '>' .. 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