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

Content deleted Content added
വിവർത്തനം
update from Module:Navbox/sandbox per Template talk:Navbox#Merging nowrap navbox to implement nowrapitems=yes to nowrap listN + above + below text
വരി 57:
end
 
local function addNewlineprocessItem(sitem, nowrapitems)
if sitem:matchsub('^[*:;#]'1, 2) or== s:match('^{|') then
-- Applying nowrap to lines in a table does not make sense.
return '\n' .. s ..'\n'
-- Add newlines to compensate for trim of x in |parm=x in a template.
else
return s'\n' .. item ..'\n'
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' .. sitem ..'\n'
end
return item
end
 
Line 82 ⟶ 97:
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 139 ⟶ 154:
:css('font-size', '114%')
:css('margin', '0 4em')
:wikitext(addNewlineprocessItem(args.title))
end
 
Line 164 ⟶ 179:
:attr('colspan', getAboveBelowColspan())
:tag('div')
:wikitext(addNewlineprocessItem(args.above, args.nowrapitems))
end
 
Line 178 ⟶ 193:
:attr('colspan', getAboveBelowColspan())
:tag('div')
:wikitext(addNewlineprocessItem(args.below, args.nowrapitems))
end
 
Line 197 ⟶ 212:
:attr('rowspan', 2 * #listnums - 1)
:tag('div')
:wikitext(addNewlineprocessItem(args.imageleft))
end
 
Line 257 ⟶ 272:
:tag('div')
:css('padding', (index == 1 and args.list1padding) or args.listpadding or '0em 0.25em')
:wikitext(addNewlineprocessItem(listText, args.nowrapitems))
 
if index == 1 and args.image then
Line 269 ⟶ 284:
:attr('rowspan', 2 * #listnums - 1)
:tag('div')
:wikitext(addNewlineprocessItem(args.image))
end
end
Line 325 ⟶ 340:
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 371 ⟶ 386:
args = navboxArgs
 
for k, v_ in pairs(args) do
if type(k) == 'string' then
local listnum = ('' .. k):match('^list(%d+)$')
if local listnum then= table.insertk:match(listnums, tonumber'^list(listnum%d+)$') end
if listnum then table.insert(listnums, tonumber(listnum)) end
end
end
table.sort(listnums)
Line 428 ⟶ 445:
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" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്