跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页
天灾之下:危险连接官网(建设中)
天灾之下:危险连接QQ群
天灾之下:危险连接 Bilibili
冰糖服务器
冰糖服务器QQ群
天灾之下:危险连接资料站
搜索
搜索
中文(中国大陆)
外观
创建账号
登录
个人工具
创建账号
登录
查看“︁模块:Uses TNT”︁的源代码
模块
讨论
English
阅读
查看源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
查看源代码
查看历史
常规
链入页面
相关更改
页面信息
[[雷光]]
外观
移至侧栏
隐藏
←
模块:Uses TNT
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
-------------------------------------------------------------------------------- -- This module implements the {{Uses TNT}} template. -- -- @module usesTNT -- @alias p -- @author [[User:ExE Boss]] -- @require [[Module:Uses TNT/config]] -- @require [[Module:Arguments]] -- @require [[Module:Func]] -- @require [[Module:List]] -- @require [[Module:Message box]] -- @require [[Module:TNT]] -- @require [[Module:TNTTools]] -- @require [[Module:TableTools]] -- @require [[Module:Yesno]] -------------------------------------------------------------------------------- require("strict"); local checkType = require("libraryUtil").checkType; local getArgs = require("Module:Arguments").getArgs; local yesno = require("Module:Yesno"); local lists = require("Module:List"); local tableTools = require("Module:TableTools"); local messageBox = require("Module:Message box"); local TNTTabFull = require("Module:TNTTools").TNTTabFull; local format = require("Module:Func") .bind(require("Module:TNT").format, "I18n/Uses TNT.tab"); local p = {}; local function getConfig() return mw.loadData("Module:Uses TNT/config"); end function p.main(frame) local args = getArgs(frame, { wrappers = { "Template:Uses TNT", }, }); return p._main(args); end function p._main(args, cfg) checkType("_main", 1, args, "table"); checkType("_main", 2, cfg, "table", true); cfg = cfg or getConfig(); local tabFiles = tableTools.compressSparseArray(args); local box = p.renderBox(tabFiles, cfg, args); local trackingCategories = p.renderTrackingCategories(args, tabFiles, nil, cfg); return box .. trackingCategories; end function p.renderBox(tabFiles, cfg, args) checkType("renderBox", 1, tabFiles, "table"); checkType("renderBox", 2, cfg, "table", true); checkType("renderBox", 3, args, "table", true); cfg = cfg or getConfig(); local nsType = mw.title.getCurrentTitle():inNamespaces(828, 829) and 'module' or 'template'; local boxArgs = {}; if #tabFiles < 1 then if cfg["allow_wishes"] or yesno(args and args.wish) then boxArgs.text = format("wishtext-" .. nsType); else boxArgs.text = string.format('<strong class="error">%s</strong>', format("error-emptylist")); end else local tabFileLinks = {}; for i, tabFile in ipairs(tabFiles) do local tabFileFull = TNTTabFull(tabFile); tabFileLinks[i] = string.format("[[:c:Data:%s|%s]]", tabFileFull, tabFileFull); end local tabFilesList = lists.makeList("bulleted", tabFileLinks); boxArgs.text = format("header-" .. nsType) .. "\n" .. tabFilesList; end boxArgs.type = "notice"; boxArgs.small = true; boxArgs.image = cfg["logo_link"] and string.format("[[%s|%s]]", cfg["logo_link"], format("logo-alt")) or format("logo-alt"); return messageBox.main("mbox", boxArgs); end function p.renderTrackingCategories(args, tabFiles, titleObj, cfg) checkType("renderTrackingCategories", 1, args, "table"); checkType("renderTrackingCategories", 2, tabFiles, "table"); checkType("renderTrackingCategories", 3, titleObj, "table", true); checkType("renderTrackingCategories", 4, cfg, "table", true); if yesno(args.nocat) then return ''; end cfg = cfg or getConfig(); local cats = {}; -- Error category if #tabFiles < 1 and not (cfg["allow_wishes"] or yesno(args.wish)) and cfg["error_category"] then cats[#cats + 1] = cfg["error_category"]; end -- [[Module:TNT]] category titleObj = titleObj or mw.title.getCurrentTitle(); if ( (titleObj.namespace == 10 or titleObj.namespace == 828) and not cfg["subpage_blacklist"][titleObj.subpageText] ) then local category = args.category; if not category then if (cfg["allow_wishes"] or yesno(args.wish)) and #tabFiles < 1 then category = cfg["wish_category"]; else category = cfg["default_category"]; end end if category then cats[#cats + 1] = category; end end for i, cat in ipairs(cats) do cats[i] = string.format("[[Category:%s]]", cat); end return table.concat(cats); end return p;
该页面嵌入的页面:
模块:Uses TNT/doc
(
查看源代码
)
返回
模块:Uses TNT
。
搜索
搜索
查看“︁模块:Uses TNT”︁的源代码
添加语言
添加话题