Module:Message box: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
சி "Module:Message box" காக்கப்பட்டது: அதிகம் பேர் பார்வையிடும் பக்கம் ([தொகு=தானாக உறுதியளிக்கப்பட்ட பயனர்க
fix bug for data being shared between multiple message boxes called from the same module; allow boxes to be hidden; use Module:Arguments to fetch the arguments
வரிசை 2:
 
-- Require necessary modules.
local getArgs = require('Module:Arguments').getArgs
local htmlBuilder = require('Module:HtmlBuilder')
local categoryHandler = require('Module:Category handler').main
வரி 18 ⟶ 19:
local trim = mw.text.trim
 
--------------------------------------------------------------------------------
local box = {}
-- Helper functions
--------------------------------------------------------------------------------
 
local function getTitleObject(page, ...)
வரி 58 ⟶ 61:
table.sort(nums)
return nums
end
 
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
 
local box = {}
box.__index = box
 
function box.new()
local argsobj = {}
setmetatable(obj, box)
return obj
end
 
வரி 195 ⟶ 211:
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
end
if yesno(args.hidden) then
self:addClass('infobox editsection')
end
self:addClass(self.typeClass)
வரி 259 ⟶ 278:
end
if talkTitle and talkTitle.exists then
local talkText = 'இதுRelevant குறித்தdiscussion மேலதிகmay தகவல்கள்be found on'
if talkArgIsTalkPage then
talkText = format('%s [[%s|%s]].', talkText, talk, talkTitle.prefixedText)
else
talkText = format('%s the [[%s#%s|பேச்சுtalk பக்கத்தில்page]] இருக்கலாம்.', talkText, talkTitle.prefixedText, talk)
end
self.talk = talkText
வரி 534 ⟶ 553:
 
local function main(boxType, args)
local outputBox = box.new()
boxoutputBox:setTitle(args)
local cfg = boxoutputBox:getConfig(boxType)
args = box:removeBlankArgs(cfg, args)
boxargs = outputBox:setBoxParametersremoveBlankArgs(cfg, args)
outputBox:setBoxParameters(cfg, args)
return boxoutputBox:export()
end
 
local function makeWrapper(boxType)
return function (frame)
local args = getArgs(frame, {trim = false, removeBlanks = false})
-- If called via #invoke, use the args passed into the invoking
-- template, or the args passed to #invoke if any exist. Otherwise
-- assume args are being passed directly in from the debug console
-- or from another Lua module.
local origArgs
if frame == mw.getCurrentFrame() then
origArgs = frame:getParent().args
for k, v in pairs(frame.args) do
origArgs = frame.args
break
end
else
origArgs = frame
end
-- Trim whitespace.
local args = {}
for k, v in pairs(origArgs) do
if type(v) == 'string' then
v = trim(v)
end
args[k] = v
end
return main(boxType, args)
end
"https://tamilar.wiki/w/Module:Message_box" இலிருந்து மீள்விக்கப்பட்டது