Module:TSLoader:修订间差异
来自互联网一战博物馆
Iopk123451(留言 | 贡献) 创建页面,内容为“local p = {} local static = require( 'Module:Static' ) if not static.TSLoader then static.TSLoader = {} end function p.call( name ) if not name then return nil end if not static.TSLoader.loadedTS then static.TSLoader.loadedTS = {} end local pagename = mw.title.getCurrentTitle() if not static.TSLoader.loadedTS[ pagename ] then static.TSLoader.loadedTS[ pagename ] = {} end if not name:find( '^%w*:' ) then name = 'Template:' .. name:sub( 1, 1 ):…” 标签:移动版编辑 移动版网页编辑 |
Iopk123451(留言 | 贡献) 小 Iopk123451移动页面Module:Tsl至Module:TSLoader,不留重定向 标签:移动版编辑 移动版网页编辑 |
||
(没有差异)
|
2025年9月15日 (一) 17:26的最新版本
此模块的文档可以在Module:TSLoader/doc创建
local p = {}
local static = require( 'Module:Static' )
if not static.TSLoader then
static.TSLoader = {}
end
function p.call( name )
if not name then
return nil
end
if not static.TSLoader.loadedTS then
static.TSLoader.loadedTS = {}
end
local pagename = mw.title.getCurrentTitle()
if not static.TSLoader.loadedTS[ pagename ] then
static.TSLoader.loadedTS[ pagename ] = {}
end
if not name:find( '^%w*:' ) then
name = 'Template:' .. name:sub( 1, 1 ):upper() .. name:sub( 2 )
end
name = name:sub( 1, 1 ):upper() .. name:sub( 2 )
if static.TSLoader.loadedTS[ pagename ][ name ] == true then
return ''
end
static.TSLoader.loadedTS[ pagename ][ name ] = true
return mw.getCurrentFrame():extensionTag{ name = "templatestyles", args = { src = name } }
end
function p.main( f )
local args = f
local frame = mw.getCurrentFrame()
if f == frame then
args = require( 'Module:ProcessArgs' ).merge( true )
end
return p.call( args[ 1 ] )
end
return p