Module:Navbox: Difference between revisions

(1) add tracking for css borders in group/above/belowstyle (2) extended background colour check to above and belowstyle (3) add Johnuniq's change to enable using this module directly in Navbox subgroup
Enwikipedia>Matt Fitzpatrick
(removed .navbox-spacing-temp mask, no longer used by site CSS)
((1) add tracking for css borders in group/above/belowstyle (2) extended background colour check to above and belowstyle (3) add Johnuniq's change to enable using this module directly in Navbox subgroup)
Line 287:
 
local function hasBackgroundColors()
for _, key in ipairs({'titlestyle', 'groupstyle', 'basestyle', 'abovestyle', 'belowstyle'}) do
if tostring(args[key]):find('background', 1, true) then
return true
end
end
end
 
local function hasBorders()
for _, key in ipairs({'groupstyle', 'basestyle', 'abovestyle', 'belowstyle'}) do
if tostring(args[key]):find('border', 1, true) then
return true
end
Line 312 ⟶ 320:
if hasBackgroundColors() then table.insert(cats, 'Navboxes using background colours') end
if isIllegible() then table.insert(cats, 'Potentially illegible navboxes') end
if hasBorders() then table.insert(cats, 'Navboxes using borders') end
return cats
end
Line 426 ⟶ 435:
getArgs = require('Module:Arguments').getArgs
end
args = getArgs(frame, {wrappers = {'Template:Navbox', 'Template:Navbox subgroup'}})
if frame.args.border then
-- This allows Template:Navbox_subgroup to use {{#invoke:Navbox|navbox|border=...}}.
args.border = frame.args.border
end
 
-- Read the arguments in the order they'll be output in, to make references number in the right order.
Anonymous user