"ମଡ୍ୟୁଲ:Message box" ପୃଷ୍ଠାର ସଂସ୍କରଣ‌ଗୁଡ଼ିକ ମଧ୍ୟରେ ତଫାତ

Content deleted Content added
ଟିକେ en:Module:Message_boxରୁ ୧ ଗୋଟି ସଂସ୍କରଣ ଅଣାଗଲା
ony load Category handler when needed, requested on talk page
୫ କ ଧାଡ଼ି:
require('Module:No globals')
local getArgs
local categoryHandler = require('Module:Category handler')._main
local yesno = require('Module:Yesno')
 
Line ୧୦୯ ⟶ ୧୦୮:
obj.categories = {}
obj.classes = {}
-- For lazy loading of [[Module:Category handler]].
obj.hasCategories = false
 
return setmetatable(obj, MessageBox)
Line ୧୨୨ ⟶ ୧୨୩:
cat = string.format('[[Category:%s]]', cat)
end
self.hasCategories = true
self.categories[ns] = self.categories[ns] or {}
table.insert(self.categories[ns], cat)
Line ୪୨୯ ⟶ ୪୩୧:
 
function MessageBox:renderCategories()
if not self.hasCategories then
-- No categories added, no need to pass them to Category handler so,
-- if it was invoked, it would return the empty string.
-- So we shortcut and return the empty string.
return ""
end
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
local categoryHandler = return require('Module:Category handler')._main{
return categoryHandler{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),