Module:NavboxMobile: Difference between revisions
EnWikiAdmin (talk | contribs) No edit summary |
EnWikiAdmin (talk | contribs) No edit summary |
||
Line 140: | Line 140: | ||
return s | return s | ||
end | end | ||
end | |||
local function striped(wikitext, border) | |||
-- Replicate the striping logic from Module:Navbox | |||
local first, second = 'navboxMobile-odd', 'navboxMobile-even' | |||
local index = 0 | |||
local changer = function(code) | |||
index = index + 1 | |||
return (index % 2 == 1) and first or second | |||
end | |||
return wikitext:gsub(cfg.marker.regex, changer) | |||
end | end | ||
Line 341: | Line 352: | ||
listCell | listCell | ||
:addClass('hlist') | |||
:addClass(evenOddClass) -- Apply the alternating class | |||
:attr('colspan', 2) | :attr('colspan', 2) | ||
:addClass('navboxMobile-list-content hlist ' .. evenOddClass) | :addClass('navboxMobile-list-content hlist ' .. evenOddClass) |