Changes

m
Reverted edit by Useddenim (talk) to last version by Ahecht
Line 10: Line 10:  
},
 
},
 
["error-categories"] = {
 
["error-categories"] = {
default = '[[Category:Pages with errors of Module Routemap]]',
+
default = '[[Category:Pages using Routemap with errors]]',
 
["text-images"] = '[[Category:Pages using Routemap with text images]]',
 
["text-images"] = '[[Category:Pages using Routemap with text images]]',
 
["separate-navbar"] = '[[Category:Pages using Routemap with a separate navbar template]]',
 
["separate-navbar"] = '[[Category:Pages using Routemap with a separate navbar template]]',
Line 26: Line 26:  
track = '[[Template:Railway track legend',
 
track = '[[Template:Railway track legend',
 
bus = '[[Template:Bus route legend',
 
bus = '[[Template:Bus route legend',
 +
road = '[[Template:Roads legend',
 
canal = '[[Template:Waterways legend',
 
canal = '[[Template:Waterways legend',
 
water = '[[Template:Waterways legend',
 
water = '[[Template:Waterways legend',
Line 103: Line 104:  
return function (frame)
 
return function (frame)
 
local args = getArgs(frame, {parentOnly = true})
 
local args = getArgs(frame, {parentOnly = true})
 +
return p[funcName](args)
 +
end
 +
end
 +
 +
local function makeTemplateFunction(funcName)
 +
-- makes a function for calling via #invoke within a template
 +
return function (frame)
 +
local args = getArgs(frame, {frameOnly = true})
 
return p[funcName](args)
 
return p[funcName](args)
 
end
 
end
Line 519: Line 528:     
--↓ This table handles diagram rows beginning with a hyphen ("-").
 
--↓ This table handles diagram rows beginning with a hyphen ("-").
q = {collapsibles = -1, text_width = {'', '', '', '', '', ''}, linfo1_pad = 'class="RMl1"', rinfo1_pad = 'class="RMr1"', bg = '#F9F9F9'}
+
q = {collapsibles = -1, text_width = {'', '', '', '', '', ''}, linfo1_pad = 'class="RMl1"', rinfo1_pad = 'class="RMr1"', bg = 'var(--background-color-neutral-subtle, #f8f9fa)'}
 
q.isKeyword = function(pattern, i, rows, justTest)
 
q.isKeyword = function(pattern, i, rows, justTest)
 
if mw.ustring.sub(pattern, 1, 1) ~= '-' then if justTest then return false else return nil end end--not a valid keyword
 
if mw.ustring.sub(pattern, 1, 1) ~= '-' then if justTest then return false else return nil end end--not a valid keyword
Line 716: Line 725:     
p.infobox = makeInvokeFunction('_infobox')
 
p.infobox = makeInvokeFunction('_infobox')
 +
p.infoboxTemplate = makeTemplateFunction('_infobox')
    
function p._infobox(args) -- Creates a pretty box.
 
function p._infobox(args) -- Creates a pretty box.
Line 769: Line 779:  
args.fontsize = 88 -- as above: CSS rule for .infobox in %
 
args.fontsize = 88 -- as above: CSS rule for .infobox in %
 
end
 
end
args.bg = args.bg or '#F9F9F9'
+
args.bg = args.bg or 'var(--background-color-neutral-subtle, f8f9fa)'
 
args.style = args.style or ''
 
args.style = args.style or ''
result = result .. 'class="' .. table.concat(classes, ' ') .. '" cellspacing="0" cellpadding="0" style="float:' .. args.float .. ';clear:' .. args.float .. ';margin-top:0;margin-bottom:1em;' .. args.margin .. 'empty-cells:show;border-collapse:collapse;font-size:' .. args.fontsize .. '%;background:' .. args.bg .. ';' .. args.style .. '"'
+
result = result .. 'class="' .. table.concat(classes, ' ') .. '" cellspacing="0" cellpadding="0" style="float:' .. args.float .. ';clear:' .. args.float .. ';margin-top:0;margin-bottom:1em;' .. args.margin .. 'empty-cells:show;border-collapse:collapse;font-size:' .. args.fontsize .. '%;background:' .. args.bg .. ';color:inherit;' .. args.style .. '"'
 
args.title = args.title or ''
 
args.title = args.title or ''
 
if args.inline or args.title == 'no' or args.title == '0' then
 
if args.inline or args.title == 'no' or args.title == '0' then
Line 863: Line 873:  
end
 
end
 
style = style or ''
 
style = style or ''
local result = '&#32;<table cellspacing="0" cellpadding="0" style="font-weight:inherit;color:inherit;background:transparent;margin-top:-2px;margin-bottom:-2px;display:inline-table;vertical-align:middle;text-align:'..align
+
local result = '&#32;<table cellspacing="0" cellpadding="0" class="RMsplit" style="text-align:'..align
 
if italic or it == 'all' then result = result..';font-style:italic' end
 
if italic or it == 'all' then result = result..';font-style:italic' end
 
if bold then result = result..';font-weight:bold' end
 
if bold then result = result..';font-weight:bold' end
Anonymous user