Content deleted Content added
debug |
sandbox config |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 24:
-- helper functions
local andnum = function(s, n) return string.format(cfg.arg[s .. '_and_num'], n) end
local isblank = function(v) return (v or '') == '' end
Line 118:
-- Applying nowrap to lines in a table does not make sense.
-- Add newlines to compensate for trim of x in |parm=x in a template.
return '\n' .. item .. '\n'
end
if nowrapitems == cfg.keyword.nowrapitems_yes then
Line 132:
end
if item:match('^[*:;#]') then
return '\n' .. item .. '\n'
end
return item
Line 156:
local function renderNavBar(titleCell)
if has_navbar() then
local navbar = require('Module:Navbar
titleCell:wikitext(navbar{
[cfg.navbar.name] = args[cfg.arg.name],
Line 190:
:tag('div')
-- id for aria-labelledby attribute
:attr('id', mw.uri.anchorEncode(args[cfg.arg.title]) .. args.argHash)
:addClass(args[cfg.arg.titleclass])
:css('font-size', '114%')
Line 217:
-- id for aria-labelledby attribute, if no title
:attr('id', (not args[cfg.arg.title]) and
(mw.uri.anchorEncode(args[cfg.arg.above]) .. args.argHash)
or nil)
:wikitext(processItem(args[cfg.arg.above], args[cfg.arg.nowrapitems]))
Line 245:
:addClass(cfg.class.navbox_image)
:addClass(args[cfg.arg.imageclass])
:css('width', '
:css('padding', '0 2px 0 0')
:cssText(args[cfg.arg.imageleftstyle])
Line 261:
if listnum == 1 and not (args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group2]) then
groupCell
:attr('id', mw.uri.anchorEncode(args[cfg.arg.group1]) .. args.argHash)
end
Line 331:
:addClass(cfg.class.navbox_image)
:addClass(args[cfg.arg.imageclass])
:css('width', '
:css('padding', '0 0 0 2px')
:cssText(args[cfg.arg.imagestyle])
Line 530:
local argHash = 0
for k, arg in pairs(args) do
if type(arg) == 'string' then
for marker in string.gfind(arg, strip_marker_pattern) do table.insert(hiding_templatestyles, marker)
end
args[k] = string.gsub(arg, strip_marker_pattern, '')▼
end
▲ argHash = argHash + #tostring(arg)
▲ args[k] = string.gsub(arg, strip_marker_pattern, '')
end
Line 544 ⟶ 546:
if type(k) == 'string' then
local listnum = k:match(cfg.pattern.listnum)
if listnum
table.insert(listnums, tonumber(listnum))
end
end
end
Line 572 ⟶ 576:
mw.uri.anchorEncode(
args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1]
) .. args.argHash
)
else
Line 594 ⟶ 598:
:cssText(args[cfg.arg.bodystyle])
:cssText(args[cfg.arg.style])
:css('padding', '
:node(tbl)
-- aria-labelledby title, otherwise above, otherwise lone group
Line 603 ⟶ 607:
mw.uri.anchorEncode(
args[cfg.arg.title] or args[cfg.arg.above] or args[cfg.arg.group1]
) .. args.argHash
)
else
nav:attr('aria-label', cfg.aria_label .. args.argHash)
end
end
Line 831 ⟶ 835:
and isblank(pargs[andnum('colfooter', 1)]) then
targs[andnum('list', 1)] = targs[andnum('list', 1)] ..
end
|