Module:Portal bar/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 11:
function p._main( portals, args )
if #portals < 1 then return '' end -- Don't display a blank navbox if no portals were specified.
local list = mw.html.create( 'ul' )
local nav = mw.html.create( 'div' )
:addClass( 'noprint metadata' )
:attr( 'role', 'navigation' )
:attr( 'aria-label' , 'Portals' )
:css( 'text-align', 'center' )
:css( 'padding', '1px' )
:css( 'font-size', '88%' )
:css( 'font-weight', 'bold' )
if yesno( args.border ) == false then
listnav
:css( 'padding', '0.1em 1.7em' )
else
listnav
:css( 'margin-top', '1em 0 0' )
:css( 'border', '1px solid #aaa' )
:css( 'padding', '0.4em 2em' )
:css( 'background', '#fdfdfd' )
end
local list = mw.html.create( 'ul' )
:css( 'paddingmargin', '1px0' )
for _, portal in ipairs( portals ) do
list
Line 38 ⟶ 43:
:wikitext( string.format( '[[Portal:%s|%s portal]]', portal, portal ) )
end
return tostring( list )
nav
:node( list )
return tostring( listnav )
end