അജ്ഞാതം


"ഘടകം:Message box" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

പരിഷത്ത് വിക്കി സംരംഭത്തിൽ നിന്ന്
127 ബൈറ്റുകൾ കൂട്ടിച്ചേർത്തിരിക്കുന്നു ,  15:12, 29 മാർച്ച് 2014
(ചെ.)
en:ഘടകം:Message box എന്നതിൽ നിന്ന് 2 പതിപ്പുകൾ
(ചെ.) (ഒരു പതിപ്പ്)
*>Irvin calicut
(ചെ.) (en:ഘടകം:Message box എന്നതിൽ നിന്ന് 2 പതിപ്പുകൾ)
വരി 1: വരി 1:
-- This is a meta-module for producing message box templates, including {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.
-- This is a meta-module for producing message box templates, including {{mbox}}, {{ambox}},
-- {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.


-- Require necessary modules.
-- Require necessary modules.
local getArgs = require('Module:Arguments').getArgs
local htmlBuilder = require('Module:HtmlBuilder')
local htmlBuilder = require('Module:HtmlBuilder')
local categoryHandler = require('Module:Category handler').main
local categoryHandler = require('Module:Category handler').main
വരി 18: വരി 20:
local trim = mw.text.trim
local trim = mw.text.trim


local box = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------


local function getTitleObject(page, ...)
local function getTitleObject(page, ...)
വരി 58: വരി 62:
table.sort(nums)
table.sort(nums)
return nums
return nums
end
--------------------------------------------------------------------------------
-- Box class definition
--------------------------------------------------------------------------------
local box = {}
box.__index = box
function box.new()
local obj = {}
setmetatable(obj, box)
return obj
end
end


വരി 195: വരി 212:
if self.isSmall then
if self.isSmall then
self:addClass(cfg.smallClass or 'mbox-small')
self:addClass(cfg.smallClass or 'mbox-small')
end
if yesno(args.hidden) then
self:addClass('infobox editsection')
end
end
self:addClass(self.typeClass)
self:addClass(self.typeClass)
വരി 534: വരി 554:


local function main(boxType, args)
local function main(boxType, args)
box:setTitle(args)
local outputBox = box.new()
local cfg = box:getConfig(boxType)
outputBox:setTitle(args)
args = box:removeBlankArgs(cfg, args)
local cfg = outputBox:getConfig(boxType)
box:setBoxParameters(cfg, args)
args = outputBox:removeBlankArgs(cfg, args)
return box:export()
outputBox:setBoxParameters(cfg, args)
return outputBox:export()
end
end


local function makeWrapper(boxType)
local function makeWrapper(boxType)
return function (frame)
return function (frame)
-- If called via #invoke, use the args passed into the invoking
local args = getArgs(frame, {trim = false, removeBlanks = false})
-- 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)
return main(boxType, args)
end
end
അജ്ഞാത ഉപയോക്താവ്
"https://wiki.kssp.in/പ്രത്യേകം:മൊബൈൽവ്യത്യാസം/5421" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്