Content deleted Content added
use border, alt, and link from Module:Portal/images |
better implementation of nbsp |
||
(25 intermediate revisions by 4 users not shown) | |||
Line 1:
-- This module implements {{portal bar}}.
require('
-- determine whether we're being called from a sandbox▼
local portalModule = require('Module:Portal')▼
local isSandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true)▼
local sandbox = isSandbox and '/sandbox' or ''▼
▲local portalModule = require('Module:Portal'..sandbox)
local getImageName = portalModule._image
local checkPortals = portalModule._checkPortals
Line 10 ⟶ 14:
local getArgs = require('Module:Arguments').getArgs
local p = {}
▲-- determine whether we're being called from a sandbox
▲local isSandbox = mw.getCurrentFrame():getTitle():find('sandbox', 1, true)
▲local sandbox = isSandbox and '/sandbox' or ''
local function sandboxVersion(s)
Line 49:
end
local
header:addClass(sandboxVersion('portal-bar-header'))▼
header:wikitext('[[Wikipedia:Contents/Portals|Portal]]')▼
else
▲ if #portals > 1 then
local header = nav:
if #portals > 1 then
end
header:wikitext(':')
end
▲ header:wikitext(':')
▲ local container = nav:tag('div')
container:addClass(sandboxVersion('portal-bar-content'))
if related then
end
local size = related and '27x25px' or '21x19px'
for _, portal in ipairs( portals ) do
container
:tag( '
:addClass(sandboxVersion('portal-bar-item'))
getImageName(portal,true), size, portal, portal))
▲ :addClass(sandboxVersion('portal-bar-logo'))
▲ :addClass(sandboxVersion('portal-bar-link'))
▲ :wikitext( string.format('[[Portal:%s|%s]]', portal, portal))
end
|