د "Module:Infobox" د بڼو تر مېنځ توپير

Content deleted Content added
ود سمون لنډیز نسته
ود سمون لنډیز نسته
۴ کرښه:
local p = {}
 
local navbar = require('Module:Navbar')._navbar
 
local args = {}
local origArgs
local root
 
local function notempty( s ) return s and s:match( '%S' ) end
 
local function fixChildBoxes(sval, tt)
if notempty(sval) then
local marker = '<span class=special_infobox_marker>'
local s = sval
s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
if s:match(marker) then
s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
end
if s:match(marker) then
local subcells = mw.text.split(s, marker)
s = ''
for k = 1, #subcells do
if k == 1 then
s = s .. subcells[k] .. '</' .. tt .. '></tr>'
elseif k == #subcells then
local rowstyle = ' style="display:none"'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
end
end
end
end
return s
else
return sval
end
end
 
local function union(t1, t2)
Line ۵۴ ⟶ ۱۰۰:
:css('text-align', 'center')
:cssText(args.headerstyle)
:wikitextcssText(rowArgs.headerrowcellstyle)
:wikitext(fixChildBoxes(rowArgs.header, 'th'))
elseif rowArgs.data then
local row = root:tag('tr')
Line ۶۵ ⟶ ۱۱۲:
:attr('scope', 'row')
:attr('id', rowArgs.labelid)
:css('text-align', 'right')
:cssText(args.labelstyle)
:csscssText('text-align', 'right'rowArgs.rowcellstyle)
:wikitext(rowArgs.label)
:done()
Line ۸۱ ⟶ ۱۲۸:
:addClass(rowArgs.class)
:cssText(rowArgs.datastyle)
:cssText(rowArgs.rowcellstyle)
:newline()
:wikitext(fixChildBoxes(rowArgs.data, 'td'))
end
end
Line ۱۰۸ ⟶ ۱۵۶:
:css('font-weight', 'bold')
:cssText(args.abovestyle)
:wikitext(fixChildBoxes(args.above,'th'))
end
 
Line ۱۲۲ ⟶ ۱۷۰:
:cssText(args.belowstyle)
:newline()
:wikitext(fixChildBoxes(args.below,'td'))
end
 
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 ۱۹۸ ⟶ ۲۴۷:
:tag('td')
:attr('colspan', '2')
:css('text-align', 'leftright')
:wikitext(mw.getCurrentFrame():expandTemplate(navbar{
title = 'navbar'args.name,
args = { args.name, mini = 1 },
}))
end
 
Line ۲۱۸ ⟶ ۲۶۷:
end
if args.child == 'yes' and args.title then
root:wikitext('[[Categoryزمرہ:Articlesبغیر whichڈیٹا useرو embeddedکے infoboxخانہ templatesمعلومات withسانچے theاستعمال titleکرنے parameterوالے مضامین]]')
end
end
Line ۳۷۶ ⟶ ۴۲۵:
{prefix = 'rowclass'},
{prefix = 'rowstyle'},
{prefix = 'rowcellstyle'},
{prefix = 'class'},
{prefix = 'dataid'},