"मोड्युल:Infobox" को बिचमी भिन्नता

Content deleted Content added
ना ne:Module:Infobox देखि ४७ पुनरावलोकनहरू आयात भयो: Importing
ना fixes for child infoboxes so HTML Tidy is not required
पंक्ति १०:
local origArgs
local root
 
local orphancat = 'Category:Orphan infoboxes'
 
local function notempty( s ) return s and s:match( '%S' ) end
 
local function union(t1, t2)
Line ४३ ⟶ ४७:
-- Adds a row to the infobox, with either a header cell
-- or a label/data cell combination.
local s = {}
local ttype = 'td'
if rowArgs.header then
rowArgs.data = nil
s = mw.text.split(rowArgs.header, '%[%[' .. orphancat .. '%]%]')
if notempty(s[1]) then
rowArgs.header = s[1]
else
rowArgs.header = nil
end
ttype = 'th'
elseif rowArgs.data then
s = mw.text.split(rowArgs.data, '%[%[' .. orphancat .. '%]%]')
if notempty(s[1]) then
rowArgs.data = s[1]
else
rowArgs.data = nil
end
ttype = 'td'
end
if rowArgs.header then
root
:tag('tr')
:addClass(rowArgs.rowclass)
Line ५६ ⟶ ८१:
:css('text-align', 'center')
:cssText(args.headerstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.header)
elseif rowArgs.data then
Line ६८ ⟶ ९४:
:attr('id', rowArgs.labelid)
:cssText(args.labelstyle)
:cssText(rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
end
local s = mw.text.split(rowArgs.data, '%[%[' .. orphancat .. '%]%]')
rowArgs.data = s[1]
local dataCell = row:tag('td')
if not rowArgs.label then
Line ८२ ⟶ ११०:
:addClass(rowArgs.class)
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:newline()
:wikitext(rowArgs.data)
end
for i = 2, #s do
if notempty(s[i]) then
if (i % 2) == 0 then
root
:wikitext(s[i])
else
local dataCell = root:tag('tr'):tag(ttype)
dataCell
:attr('colspan', 2)
:wikitext(s[i])
end
end
end
end
 
Line ९९ ⟶ १४२:
local function renderAboveRow()
if not args.above then return end
root
:tag('tr')
Line १८४ ⟶ २२६:
rowclass = args['rowclass' .. tostring(num)],
rowstyle = args['rowstyle' .. tostring(num)],
rowcellstyle = args['rowcellstyle' .. tostring(num)],
dataid = args['dataid' .. tostring(num)],
labelid = args['labelid' .. tostring(num)],
Line २२७ ⟶ २७०:
-- Specify the overall layout of the infobox, with special settings
-- if the infobox is used as a 'child' inside another infobox.
local marker = ''
if args.child ~= 'yes' then
root = mw.html.create('table')
Line २५६ ⟶ ३००:
else
root = mw.html.create()
marker = '[[' .. orphancat .. ']]'
root
:wikitext(args.title)
Line २६९ ⟶ ३१३:
renderTrackingCategories()
return marker .. tostring(root) .. marker
end
 
Line ३७७ ⟶ ४२१:
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'dataid'},
"https://dty.wikipedia.org/wiki/मोड्युल:Infobox" बठे निकालियाऽ