Module:Portal bar/sandbox: Difference between revisions

Content deleted Content added
automatically use Module:Portal/sandbox
better implementation of nbsp
 
(23 intermediate revisions by 4 users not shown)
Line 1:
-- This module implements {{portal bar}}.
 
require('Module:No globalsstrict')
 
-- determine whether we're being called from a sandbox
Line 49:
end
 
local headerrelated = nav:tagyesno('span'args.related)
if #portals > 1related then
header:addClass(sandboxVersion('portal-bar-header'))
nav:addClass(sandboxVersion('portal-bar-logorelated'))
header:wikitext('[[Wikipedia:Contents/Portals|Portal]]')
else
if #portals > 1 then
local header = nav:wikitexttag('sspan')
header:addClass(sandboxVersion('portal-bar-header'))
header:wikitext('[[Wikipedia:Contents/Portals|Portal]]')
if #portals > 1 then
header:wikitext(':s')
end
header:wikitext(':')
end
local container = nav:tag('divul')
header:wikitext(':')
local container = nav:tag('div')
container:addClass(sandboxVersion('portal-bar-content'))
if related then
container:addClass(sandboxVersion('portal-bar-linkcontent-related'))
end
local size = related and '27x25px' or '21x19px'
for _, portal in ipairs( portals ) do
container
:tag( 'divli' )
:addClass(sandboxVersion('portal-bar-item'))
:wikitext( string.format('<span class="nowrap">[[File:%s|%s]] </span>[[Portal:%s|%s]]', portal, portal))
:tag( 'span' )
getImageName(portal,true), size, portal, portal))
:addClass(sandboxVersion('portal-bar-logo'))
:wikitext( string.format(
'[[File:%s|21x19px]]', getImageName({ portal },true)
) )
:done()
:tag('span')
:addClass(sandboxVersion('portal-bar-link'))
:wikitext( string.format('[[Portal:%s|%s]]', portal, portal))
end