Module:If mobile:修订间差异
来自大天使虫洞百科
更多操作
zh>Xiplus-abot 小 已保护“Module:If mobile”:高風險模板:70504引用<!-- 機器人3 -->([编辑=仅允许模板编辑员](无限期)[移动=仅允许模板编辑员](无限期)) |
小 导入1个版本 |
||
(没有差异)
| |||
2024年10月14日 (一) 07:16的最新版本
| CSS | 本模块使用以下模板样式: |
本模块是{{If mobile}}的Lua实现,请到模板页阅读具体用法。
local p = {}
function p._main(args)
local frame = mw.getCurrentFrame()
local root = mw.html.create()
if args["Tag"] then
args["tag"] = args["Tag"]
end
local ifmobile = root:tag(args["tag"] or 'span')
ifmobile
:addClass('ifmobile')
local nomobile = ifmobile:tag(args["tag"] or 'span')
local mobile = ifmobile:tag(args["tag"] or 'span')
nomobile
:addClass('nomobile')
:wikitext(args[2])
mobile
:addClass('mobile')
:wikitext(args[1])
return frame:extensionTag {name = 'templatestyles', args = {src = 'If mobile/styles.css'}} .. tostring(root)
end
function p.main(frame)
local args = require('Module:Arguments').getArgs(frame, {
wrappers = 'Template:If mobile'
})
return p._main(args)
end
return p