Module:Notice:修订间差异
来自Vocawiki
更多操作
删除的内容 添加的内容
小 有笨蛋 |
小无编辑摘要 |
||
| (未显示2个用户的5个中间版本) | |||
| 第5行: | 第5行: | ||
local type = args.type or "info" |
local type = args.type or "info" |
||
-- |
-- 自定义图标(icon) |
||
local icon = args.icon |
|||
local iconClass = "" |
|||
if icon and icon ~= "" then |
|||
iconClass = " notice-icon-" .. icon |
|||
| ⚫ | |||
-- 无标题模式(text) |
|||
local textContent = args.text or args[1] |
|||
if textContent and textContent ~= "" then |
|||
return string.format([[ |
return string.format([[ |
||
| ⚫ | |||
<div class="notice notice-%s"> |
|||
]], type, iconClass, textContent) |
|||
| ⚫ | |||
<div class="notice-text text-base"> |
|||
| ⚫ | |||
</div> |
|||
</div> |
|||
]], type, args.text) |
|||
end |
end |
||
-- 列表 |
-- 列表(list) |
||
local listItems = {} |
local listItems = {} |
||
for i = 1, 50 do |
for i = 1, 50 do |
||
| 第28行: | 第31行: | ||
local listHtml = "" |
local listHtml = "" |
||
if #listItems > 0 then |
if #listItems > 0 then |
||
listHtml = "<ul class=\"notice-list text-sm\">" .. table.concat(listItems, " |
listHtml = "<ul class=\"notice-list text-sm\">" .. table.concat(listItems, "") .. "</ul>" |
||
elseif args.list and args.list ~= "" then |
elseif args.list and args.list ~= "" then |
||
listHtml = "<ul class=\"notice-list text-sm\">" .. args.list .. "</ul>" |
listHtml = "<ul class=\"notice-list text-sm\">" .. args.list .. "</ul>" |
||
end |
|||
-- 列表标题(lt) |
|||
local ltHtml = "" |
|||
if args.lt and args.lt ~= "" then |
|||
| ⚫ | |||
end |
|||
-- 详细说明(detail) |
|||
local detailHtml = "" |
|||
if args.detail and args.detail ~= "" then |
|||
| ⚫ | |||
end |
end |
||
return string.format([[ |
return string.format([[ |
||
| ⚫ | |||
<div class="notice notice-%s"> |
|||
| ⚫ | |||
| ⚫ | |||
<div class="notice-text text-base"> |
|||
<div class="notice-title text-base">%s</div> |
|||
| ⚫ | |||
| ⚫ | |||
</div> |
|||
</div> |
|||
| ⚫ | |||
end |
end |
||