Zum Inhalt springen

Modul:Navbox: Unterschied zwischen den Versionen

replacing gutter rows with CSS borders; uses temporary navbox-spacing-temp class to avoid cache issues
(Update: aktuellen Stand vo der englischen WP geholt von https://en.wikipedia.org/wiki/Module:Navbox)
(replacing gutter rows with CSS borders; uses temporary navbox-spacing-temp class to avoid cache issues)
Zeile 9: Zeile 9:


local args
local args
local tableRowAdded = false
local border
local border
local listnums = {}
local listnums = {}
Zeile 78: Zeile 77:
end
end
return item
return item
end
local function addTableRow(tbl)
-- If any other rows have already been added, then we add a 2px gutter row.
if tableRowAdded then
tbl
:tag('tr')
:css('height', '2px')
:tag('td')
:attr('colspan',2)
end
tableRowAdded = true
return tbl:tag('tr')
end
end


Zeile 113: Zeile 97:
if not args.title then return end
if not args.title then return end


local titleRow = addTableRow(tbl)
local titleRow = tbl:tag('tr')


if args.titlegroup then
if args.titlegroup then
Zeile 171: Zeile 155:
if not args.above then return end
if not args.above then return end


addTableRow(tbl)
tbl:tag('tr')
:tag('td')
:tag('td')
:addClass('navbox-abovebelow')
:addClass('navbox-abovebelow')
Zeile 185: Zeile 169:
if not args.below then return end
if not args.below then return end


addTableRow(tbl)
tbl:tag('tr')
:tag('td')
:tag('td')
:addClass('navbox-abovebelow')
:addClass('navbox-abovebelow')
Zeile 200: Zeile 184:
--
--
local function renderListRow(tbl, index, listnum)
local function renderListRow(tbl, index, listnum)
local row = addTableRow(tbl)
local row = tbl:tag('tr')


if index == 1 and args.imageleft then
if index == 1 and args.imageleft then
Zeile 207: Zeile 191:
:addClass('navbox-image')
:addClass('navbox-image')
:addClass(args.imageclass)
:addClass(args.imageclass)
:css('width', '0%')
:css('width', '1px')               -- Minimize width
:css('padding', '0px 2px 0px 0px')
:css('padding', '0px 2px 0px 0px')
:cssText(args.imageleftstyle)
:cssText(args.imageleftstyle)
:attr('rowspan', 2 * #listnums - 1)
:attr('rowspan', #listnums)
:tag('div')
:tag('div')
:wikitext(processItem(args.imageleft))
:wikitext(processItem(args.imageleft))
Zeile 223: Zeile 207:
:addClass(args.groupclass)
:addClass(args.groupclass)
:cssText(args.basestyle)
:cssText(args.basestyle)
 
            :css('width', args.groupwidth or '1%') -- If groupwidth not specified, minimize width
if args.groupwidth then
groupCell:css('width', args.groupwidth)
end


groupCell
groupCell
Zeile 279: Zeile 260:
:addClass('navbox-image')
:addClass('navbox-image')
:addClass(args.imageclass)
:addClass(args.imageclass)
:css('width', '0%')
:css('width', '1px')               -- Minimize width
:css('padding', '0px 0px 0px 2px')
:css('padding', '0px 0px 0px 2px')
:cssText(args.imagestyle)
:cssText(args.imagestyle)
:attr('rowspan', 2 * #listnums - 1)
:attr('rowspan', #listnums)
:tag('div')
:tag('div')
:wikitext(processItem(args.image))
:wikitext(processItem(args.image))
Zeile 362: Zeile 343:
if border == 'subgroup' or border == 'none' then
if border == 'subgroup' or border == 'none' then
tbl
tbl
:addClass('navbox-subgroup')
:addClass('navbox-subgroup navbox-spacing-temp')
:cssText(args.bodystyle)
:cssText(args.bodystyle)
:cssText(args.style)
:cssText(args.style)
Zeile 424: Zeile 405:
local nav = res:tag('div')
local nav = res:tag('div')
:attr('role', 'navigation')
:attr('role', 'navigation')
:addClass('navbox')
:addClass('navbox navbox-spacing-temp')
:cssText(args.bodystyle)
:cssText(args.bodystyle)
:cssText(args.style)
:cssText(args.style)
Anonymer Benutzer