打开/关闭搜索
搜索
打开/关闭菜单
10
29
3
584
大天使虫洞百科
导航
首页
加入EVE Online
资助甲虫
最近更改
随机页面
特殊页面
上传文件
外部链接
zKillboard
大天使对外频道(QQ)
大天使边境要塞(Discord)
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁Module:Submit an edit request”︁的源代码
来自大天使虫洞百科
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
Module:Submit an edit request
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
-- This module implements {{Submit an edit request}}. local CONFIG_MODULE = 'Module:Submit an edit request/config' -- Load necessary modules local mRedirect = require('Module:Redirect') local cfg = mw.loadData(CONFIG_MODULE) local effectiveProtectionLevel = require('Module:Effective protection level')._main local lang = mw.language.getContentLanguage() local p = {} local validLevels = { semi = 'semi', template = 'template', full = 'full' } local function message(key, ...) local params = {...} local msg = cfg[key] if #params < 1 then return msg else return mw.message.newRawMessage(msg):params(params):plain() end end local function isTranscludedOnMainPage(titleObj) local mainPage = message('main-page') for i, source in ipairs(titleObj.cascadingProtection.sources) do if source == mainPage then return true end end return false end local function validateLevel(level) return level and validLevels[level] or 'full' end local function getLevelInfo(level, field) return cfg.protectionLevels[level][field] end local function resolveRedirect(page) return mRedirect.luaMain(page) end local function isProtected(page) local action = mw.title.new(page).exists and 'edit' or 'create' return effectiveProtectionLevel(action, page) ~= '*' end function p.makeRequestUrl(level, titleObj) titleObj = titleObj or mw.title.getCurrentTitle() -- if isTranscludedOnMainPage(titleObj) then -- return tostring(mw.uri.fullUrl(message('main-page-request-page'))) -- end local talkPageName = resolveRedirect(titleObj.talkPageTitle.prefixedText) if isProtected(talkPageName) then return tostring(mw.uri.fullUrl(message('protected-talk-page-request-page'))) end level = validateLevel(level) local url = mw.uri.fullUrl(talkPageName, { action = 'edit', editintro = getLevelInfo(level, 'editintro'), preload = message('preload-template'), preloadtitle = '', section = 'new', nosummary = '1', }) url = tostring(url) -- Add the preload parameters. @TODO: merge this into the mw.uri.fullUrl -- query table once [[phab:T93059]] is fixed. local function encodeParam(key, val) return string.format('&%s=%s', mw.uri.encode(key), mw.uri.encode(val)) end url = url .. encodeParam('preloadparams[]', message( 'preload-title-text', lang:formatDate(message('preload-title-date-format')) )) return url end function p._link(args) return string.format( '<span class="plainlinks">[%s %s]</span>', p.makeRequestUrl(args.type), args.display or message('default-display-value') ) end function p._button(args) return require('Module:Clickable button 2').luaMain{ [1] = args.display or message('default-display-value'), url = p.makeRequestUrl(args.type), class = 'mw-ui-progressive' } end local function makeInvokeFunc(func, wrapper) return function (frame) local args = require('Module:Arguments').getArgs(frame, { wrappers = {wrapper} }) return func(args) end end p.link = makeInvokeFunc(p._link, message('link-wrapper-template')) p.button = makeInvokeFunc(p._button, message('button-wrapper-template')) return p
返回
Module:Submit an edit request
。
查看“︁Module:Submit an edit request”︁的源代码
来自大天使虫洞百科