開啟主選單
求真百科
搜尋
檢視 模块:InfoboxImageVariant 的原始碼
←
模块:InfoboxImageVariant
由於下列原因,您沒有權限進行 編輯此頁面 的動作:
您請求的操作只有這個群組的使用者能使用:
用戶
您請求的操作只有這個群組的使用者能使用:
管理員
您可以檢視並複製此頁面的原始碼。
require('Module:No globals') local infoboxImage = require('Module:InfoboxImage').InfoboxImage local lc = require('Module:WikitextLC').selective local getArgs = require('Module:Arguments').getArgs local p = {} function p.main(frame) local args = getArgs(frame) return p._main(args) end function p._main(args) local variety = {'', '-hans', '-hant', '-cn', '-hk', '-mo', '-my', '-sg', '-tw'} local varietyHans = {'-hans', '-cn', '-my', '-sg'} local varietyHant = {'-hant', '-hk', '-mo', '-tw'} local hansIndicator, hantIndicator = false, false for i, v in ipairs(varietyHans) do if args['image' .. v] then hansIndicator = true break end end for i, v in ipairs(varietyHant) do if args['image' .. v] then hantIndicator = true break end end if hansIndicator and hantIndicator then local content = {} for i, v in ipairs(variety) do if args['image' .. v] then content['zh' .. v] = infoboxImage{args = { image = args['image' .. v], size = args['size' .. v] or args.size, maxsize = args['maxsize' .. v] or args.maxsize, sizedefault = args['sizedefault' .. v] or args.sizedefault, link = args['link' .. v] or args.link, title = args['title' .. v] or args.title, border = args['border' .. v] or args.border, upright = args['upright' .. v] or args.upright, thumbtime = args['thumbtime' .. v] or args.thumbtime, center = args['center' .. v] or args.center, alt = args['alt' .. v] or args.alt, } } end end return lc(content) end for i, v in ipairs(variety) do if args['image' .. v] then return infoboxImage{args = { image = args['image' .. v], size = args['size' .. v] or args.size, maxsize = args['maxsize' .. v] or args.maxsize, sizedefault = args['sizedefault' .. v] or args.sizedefault, link = args['link' .. v] or args.link, title = args['title' .. v] or args.title, border = args['border' .. v] or args.border, upright = args['upright' .. v] or args.upright, thumbtime = args['thumbtime' .. v] or args.thumbtime, center = args['center' .. v] or args.center, alt = args['alt' .. v] or args.alt, } } end end end return p
此頁面使用了以下模板:
模块:InfoboxImageVariant/doc
(
檢視原始碼
)
返回「
模块:InfoboxImageVariant
」頁面