恪別𡧲版𢯢𢷮𧵑「模庉:Message box」

造張㵋貝內容「-- This is a meta-module for producing message box templates, including -- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}. -- Load necessary modules. require('Mô đun:No globals') local getArgs local categoryHandler = require('Mô đun:Category handler')._main local yesno = require('Mô đun:Yesno') -- Get a language object for formatDate and ucfirst. local lang = mw.language.getContentLanguage() -- Set aliases for often-used functi…」
 
n 𠊝替文本-「Bản mẫu:」成「Template:」
𥮋𢯢𢷮移動 Mobile web edit
 
(空顯示5番版𧵑2𠊛用於𡧲)
𣳔3: 𣳔3:


-- Load necessary modules.
-- Load necessary modules.
require('Mô đun:No globals')
require('Module:No globals')
local getArgs
local getArgs
local categoryHandler = require('Mô đun:Category handler')._main
local categoryHandler = require('Module:Category handler')._main
local yesno = require('Mô đun:Yesno')
local yesno = require('Module:Yesno')


-- Get a language object for formatDate and ucfirst.
-- Get a language object for formatDate and ucfirst.
𣳔145: 𣳔145:
end
end
if sort then
if sort then
cat = string.format('[[Thể loại:%s|%s]]', cat, sort)
cat = string.format('[[體類:%s|%s]]', cat, sort)
else
else
cat = string.format('[[Thể loại:%s]]', cat)
cat = string.format('[[體類:%s]]', cat)
end
end
self.categories[ns] = self.categories[ns] or {}
self.categories[ns] = self.categories[ns] or {}
𣳔216: 𣳔216:
'^[bB][aẢ][nN][%s_]+[mM][ẫẪ][uU][%s_]*:[%s_]*(.*)$'
'^[bB][aẢ][nN][%s_]+[mM][ẫẪ][uU][%s_]*:[%s_]*(.*)$'
) or self.name
) or self.name
templateName = 'Bản mẫu:' .. templateName
templateName = 'Template:' .. templateName
self.templateTitle = getTitleObject(templateName)
self.templateTitle = getTitleObject(templateName)
end
end
𣳔338: 𣳔338:
and (cfg.imageSmallSize or '30x30px')
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
or '40x40px'
self.imageLeft = format('[[Tập tin:%s|%s|link=|alt=]]', self.typeImage
self.imageLeft = format('[[Image:%s|%s|link=|alt=]]', self.typeImage
or 'Commons-emblem-notice.svg', imageSize)
or 'Commons-emblem-notice.svg', imageSize)
end
end
𣳔377: 𣳔377:
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
self:addCat(0, catTitle)
catTitle = getTitleObject('Thể loại:' .. catTitle)
catTitle = getTitleObject('體類:' .. catTitle)
if not catTitle or not catTitle.exists then
if not catTitle or not catTitle.exists then
self:addCat(0, 'Tham số bản mẫu ngày tháng không hợp lệ')
self:addCat(0, 'Tham số bản mẫu ngày tháng không hợp lệ')
𣳔454: 𣳔454:
function MessageBox:renderCategories()
function MessageBox:renderCategories()
-- Convert category tables to strings and pass them through
-- Convert category tables to strings and pass them through
-- [[Mô đun:Category handler]].
-- [[Module:Category handler]].
return categoryHandler{
return categoryHandler{
main = table.concat(self.categories[0] or {}),
main = table.concat(self.categories[0] or {}),
𣳔472: 𣳔472:
:addClass('error')
:addClass('error')
:wikitext(string.format(
:wikitext(string.format(
'Bản mẫu <code>%s[[Bản mẫu:%s|%s]]%s</code> đã được thay thế sai quy cách.',
'Bản mẫu <code>%s[[板㑄:%s|%s]]%s</code> đã được thay thế sai quy cách.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
))
𣳔596: 𣳔596:
function p.main(boxType, args, cfgTables)
function p.main(boxType, args, cfgTables)
args = viMapArgs(args)
args = viMapArgs(args)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData('Mô đun:Message box/configuration'))
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData('Module:Message box/configuration'))
box:setParameters()
box:setParameters()
box:setCategories()
box:setCategories()
𣳔605: 𣳔605:
return function (frame)
return function (frame)
if not getArgs then
if not getArgs then
getArgs = require('Mô đun:Arguments').getArgs
getArgs = require('模庉:Arguments').getArgs
end
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))