跳转到内容
打开/关闭菜单
  • 397 文件
  • 1978 用户
  • 1.2万 编辑
Gal中文百科
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

Module:If preview/configuration

来自Gal中文百科
更多语言
imported>Xiplus-abot2024年2月4日 (日) 16:50的版本 (已更改“Module:If preview/configuration”的保护设置:​高风险模板:207597引用<!-- 机器人3 -->([编辑=仅允许管理员](无限期)[移动=仅允许管理员](无限期)))
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

此模块的文档可以在Module:If preview/configuration/doc创建

--[[
We perform the actual check for whether this is a preview here since
preprocessing is relatively expensive.
]]
local frame = mw.getCurrentFrame()

local function is_preview()
	local revision_id = frame:preprocess('{{REVISIONID}}')
	-- {{REVISIONID}} is usually the empty string when previewed.
	-- I don't know why we're checking for nil but hey, maybe someday things
	-- would have broken
	return revision_id == nil or revision_id == ''
end

local function templatestyles()
	return frame:extensionTag{
		name = 'templatestyles', args = { src = 'Module:If preview/styles.css' }
	}
end

return {
	preview = is_preview(),
	templatestyles = templatestyles(),
	warning_infrastructure = '%s<div class="preview-warning"><strong>预览警告:</strong>%s</div>',
	missing_warning = '模板无警告文本,请添加警告。'
}