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

Content deleted Content added
(ചെ.) en:ഘടകം:Navbox എന്നതിൽ നിന്ന് ഒരു പതിപ്പ് ഇറക്കുമതി ചെയ്തു
minor whitespace: trim trailing spaces; tabs --> spaces
വരി 2:
-- This module implements {{Navbox}}
--
 
local p = {}
 
വരി 32:
:css('height', '2px')
:tag('td')
:attr('colspan',2)
end
 
tableRowAdded = true
 
return tbl:tag('tr')
end
വരി 43:
-- Depending on the presence of the navbar and/or show/hide link, we may need to add a spacer div on the left
-- or right to keep the title centered.
local spacerSide = nil
 
if args.navbar == 'off' then
-- No navbar, and client wants no spacer, i.e. wants the title to be shifted to the left. If there's
-- also no show/hide link, then we need a spacer on the right to achieve the left shift.
if args.state == 'plain' then spacerSide = 'right' end
elseif args.navbar == 'plain' or (not args.name and mw.getCurrentFrame():getParent():getTitle() == 'ഫലകംTemplate:Navbox' and (border == 'subgroup' or border == 'child' or border == 'none')) then
-- No navbar. Need a spacer on the left to balance out the width of the show/hide link.
if args.state ~= 'plain' then spacerSide = 'left' end
വരി 57:
if args.state == 'plain' then spacerSide = 'right' end
 
titleCell:wikitext(navbar{
args.name,
mini = 1,
fontstyle = (args.basestyle or '') .. ';' .. (args.titlestyle or '') .. ';background:none transparent;border:none;'
})
end
 
-- Render the spacer div.
if spacerSide then
വരി 79:
local function renderTitleRow(tbl)
if not args.title then return end
 
local titleRow = addTableRow(tbl)
 
വരി 93:
:wikitext(args.titlegroup)
end
 
local titleCell = titleRow:tag('th'):attr('scope', 'col')
 
if args.titlegroup then
titleCell
വരി 101:
:css('width', '100%')
end
 
local titleColspan = 2
if args.imageleft then titleColspan = titleColspan + 1 end
if args.image then titleColspan = titleColspan + 1 end
if args.titlegroup then titleColspan = titleColspan - 1 end
 
titleCell
:cssText(args.basestyle)
വരി 112:
:addClass('navbox-title')
:attr('colspan', titleColspan)
 
renderNavBar(titleCell)
 
വരി 160:
:wikitext(addNewline(args.below))
end
 
--
-- List rows
വരി 166:
local function renderListRow(tbl, listnum)
local row = addTableRow(tbl)
 
if listnum == 1 and args.imageleft then
row
വരി 179:
:wikitext(addNewline(args.imageleft))
end
 
if args['group' .. listnum] then
local groupCell = row:tag('th')
 
groupCell
:attr('scope', 'row')
:addClass('navbox-group')
:addClass(args.groupclass)
:cssText(args.basestyle)
 
if args.groupwidth then
groupCell:css('width', args.groupwidth)
end
 
groupCell
:cssText(args.groupstyle)
:cssText(args['group' .. listnum .. 'style'])
:wikitext(args['group' .. listnum])
end
 
local listCell = row:tag('td')
 
if args['group' .. listnum] then
listCell
:css('text-align', 'left')
വരി 209:
listCell:attr('colspan', 2)
end
 
if not args.groupwidth then
listCell:css('width', '100%')
end
 
local isOdd = (listnum % 2) == 1
local rowstyle = args.evenstyle
if isOdd then rowstyle = args.oddstyle end
 
local evenOdd
if args.evenodd == 'swap' then
വരി 257:
 
local function needsHorizontalLists()
if border == 'child' or border == 'subgroup' or args.tracking == 'no' then return false end
 
local listClasses = {'plainlist', 'hlist', 'hlist hnum', 'hlist hwrap', 'hlist vcard', 'vcard hlist', 'hlist vevent'}
for i, cls in ipairs(listClasses) do
വരി 285:
local subpage = title.subpageText
if subpage == 'doc' or subpage == 'sandbox' or subpage == 'testcases' then return end
 
for i, cat in ipairs(getTrackingCategories()) do
builder:wikitext('[[Category:' .. cat .. ']]')
end
end
വരി 304:
:addClass(args.state or 'autocollapse')
end
 
tbl:css('border-spacing', 0)
if border == 'subgroup' or border == 'child' or border == 'none' then
tbl
Line 317 ⟶ 318:
end
tbl:cssText(args.innerstyle)
 
renderTitleRow(tbl)
renderAboveRow(tbl)
for i, listnum in ipairs(listnums) do
renderListRow(tbl, listnum)
end
renderBelowRow(tbl)
 
return tbl
end
Line 330 ⟶ 331:
function p._navbox(navboxArgs)
args = navboxArgs
 
for k, v in pairs(args) do
local listnum = ('' .. k):match('^list(%d+)$')
Line 336 ⟶ 337:
end
table.sort(listnums)
 
border = trim(args.border or args[1] or '')
 
Line 358 ⟶ 359:
:tag('table')
:addClass('navbox')
:css('border-spacing', 0)
:cssText(args.bodystyle)
:cssText(args.style)
Line 365 ⟶ 367:
:node(tbl)
end
 
renderTrackingCategories(res)
 
return tostring(res)
end
 
function p.navbox(frame)
if not getArgs then
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.
Line 384 ⟶ 386:
_ = args["group" .. tostring(i)]
_ = args["list" .. tostring(i)]
end
_ = args.below
 
return p._navbox(args)
end
 
return p
"https://ml.wikipedia.org/wiki/ഘടകം:Navbox" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്