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

Content deleted Content added
No edit summary
No edit summary
വരി 57:
end
 
local function processItemaddNewline(item, nowrapitemss)
if items:submatch(1, 2'^[*:;#]') ==or s:match('^{|') then
return '\n' .. items ..'\n'
-- Applying nowrap to lines in a table does not make sense.
else
-- Add newlines to compensate for trim of x in |parm=x in a template.
return '\n' .. item ..'\n's
end
if nowrapitems == 'yes' then
local lines = {}
for line in (item .. '\n'):gmatch('([^\n]*)\n') do
local prefix, content = line:match('^([*:;#]+)%s*(.*)')
if prefix and not content:match('^<span class="nowrap">') then
line = prefix .. '<span class="nowrap">' .. content .. '</span>'
end
table.insert(lines, line)
end
item = table.concat(lines, '\n')
end
if item:match('^[*:;#]') then
return '\n' .. item ..'\n'
end
return item
end
 
Line 97 ⟶ 82:
local function renderNavBar(titleCell)
 
if args.navbar ~= 'off' and args.navbar ~= 'plain' and not (not args.name and mw.getCurrentFrame():getParent():getTitle():gsub('/sandbox$', '') == 'Templateഫലകം:Navbox') then
titleCell:wikitext(navbar{
args.name,
Line 154 ⟶ 139:
:css('font-size', '114%')
:css('margin', '0 4em')
:wikitext(processItemaddNewline(args.title))
end
 
Line 179 ⟶ 164:
:attr('colspan', getAboveBelowColspan())
:tag('div')
:wikitext(processItemaddNewline(args.above, args.nowrapitems))
end
 
Line 193 ⟶ 178:
:attr('colspan', getAboveBelowColspan())
:tag('div')
:wikitext(processItemaddNewline(args.below, args.nowrapitems))
end
 
Line 212 ⟶ 197:
:attr('rowspan', 2 * #listnums - 1)
:tag('div')
:wikitext(processItemaddNewline(args.imageleft))
end
 
Line 272 ⟶ 257:
:tag('div')
:css('padding', (index == 1 and args.list1padding) or args.listpadding or '0em 0.25em')
:wikitext(processItemaddNewline(listText, args.nowrapitems))
 
if index == 1 and args.image then
Line 284 ⟶ 269:
:attr('rowspan', 2 * #listnums - 1)
:tag('div')
:wikitext(processItemaddNewline(args.image))
end
end
Line 340 ⟶ 325:
if subpage == 'doc' or subpage == 'sandbox' or subpage == 'testcases' then return end
 
for _i, cat in ipairs(getTrackingCategories()) do
builder:wikitext('[[Category:' .. cat .. ']]')
end
Line 386 ⟶ 371:
args = navboxArgs
 
for k, _v in pairs(args) do
local listnum = ('' .. k):match('^list(%d+)$')
if type(k) == 'string' then
localif listnum =then k:matchtable.insert('^listlistnums, tonumber(%d+listnum)$') end
if listnum then table.insert(listnums, tonumber(listnum)) end
end
end
table.sort(listnums)
Line 445 ⟶ 428:
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {wrappers = 'Templateഫലകം:Navbox'})
 
-- Read the arguments in the order they'll be output in, to make references number in the right order.
"https://ml.wikipedia.org/wiki/ഘടകം:Navbox" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്