Дополнительные действия
Нет описания правки |
Нет описания правки |
||
| Строка 34: | Строка 34: | ||
return mw.getCurrentFrame():extensionTag{ | return mw.getCurrentFrame():extensionTag{ | ||
name = ' | name = 'style', args = { src = 'https://asteriodigos.org/a/navpills.css' } | ||
} .. tostring( html ) | } .. tostring( html ) | ||
end | end | ||
Версия от 15:57, 2 марта 2025
Сopyright
Content is available under Creative Commons Attribution-ShareAlike 4.0 License unless otherwise noted.
https://tolkiengateway.net/wiki/Module:Navpills
local mArguments --initialize lazily
local getArgNums = require('Module:Common').getArgNums
local p = {}
--Implements {{Navpills}} from the frame
function p.navpills( frame )
mArguments = require( 'Module:Arguments' )
return p._navpills( mArguments.getArgs( frame ) )
end
function p._navpills( args )
if not args then
return 'Missing arguments'
end
local html = mw.html.create( 'div' ):addClass( 'template-navpills' ):attr( 'role', 'navigation' )
for i, _ in ipairs( getArgNums( 'page', args ) ) do
if not args[ 'page' .. i ] then return end
local num = tostring( i )
local navpill = mw.html.create('div'):addClass('template-navpill')
if args[ 'image' .. i ] then
navpill:tag('div'):addClass('template-navpill-background')
:wikitext( string.format( '[[File:%s|x48px|link=]]', args[ 'image' .. num ] ) )
end
navpill:wikitext( string.format( '[[%s|%s]]', args[ 'page' .. num ], args[ 'text' .. num ] or args[ 'page' .. num ] ) )
html:node(navpill)
end
return mw.getCurrentFrame():extensionTag{
name = 'style', args = { src = 'https://asteriodigos.org/a/navpills.css' }
} .. tostring( html )
end
return p
--<noinclaude>
--__NOINDEX__
--opyright
--Content is available under Creative Commons Attribution-ShareAlike 4.0 License unless otherwise noted.
--https://tolkiengateway.net/wiki/Module:Navpills
--</noinclaude>