Module:Notice:修订间差异
来自Vocawiki
更多操作
删除的内容 添加的内容
小无编辑摘要 |
小无编辑摘要 |
||
| (未显示同一用户的1个中间版本) | |||
| 第5行: | 第5行: | ||
local type = args.type or "info" |
local type = args.type or "info" |
||
-- 自定义 |
-- 自定义图标(icon) |
||
local icon = args.icon |
local icon = args.icon |
||
local iconClass = "" |
local iconClass = "" |
||
| 第12行: | 第12行: | ||
end |
end |
||
-- |
-- 无标题模式(text) |
||
local textContent = args.text or args[1] |
local textContent = args.text or args[1] |
||
if textContent and textContent ~= "" then |
if textContent and textContent ~= "" then |
||
return string.format([[ |
return string.format([[ |
||
| ⚫ | |||
<div class="notice notice-%s"> |
|||
| ⚫ | |||
<div class="notice-text text-base"> |
|||
| ⚫ | |||
</div> |
|||
</div> |
|||
]], type, iconClass, textContent) |
]], type, iconClass, textContent) |
||
end |
end |
||
-- 列表 |
-- 列表(list) |
||
local listItems = {} |
local listItems = {} |
||
for i = 1, 50 do |
for i = 1, 50 do |
||
| 第36行: | 第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>" |
||
| ⚫ | |||
-- 列表标题(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 |
||