Content deleted Content added
No edit summary |
HouseBlaster (talk | contribs) bypass redirect |
||
(9 intermediate revisions by 4 users not shown) | |||
Line 1:
-- This module implements {{Submit an edit request}}.
local CONFIG_MODULE = 'Module:Submit an edit request/config
-- Load necessary modules
Line 29:
return mw.message.newRawMessage(msg):params(params):plain()
end
end▼
local mainPage = message('main-page')▼
if source == mainPage then▼
end▼
end
Line 60 ⟶ 50:
function p.makeRequestUrl(level, titleObj)
titleObj = titleObj or mw.title.getCurrentTitle()
▲ local basePage = titleObj.basePageTitle.fullText
▲ if cfg['main-page-content'][basePage] then
▲ return tostring(mw.uri.fullUrl(message('main-page-request-page')))
end
local talkPageName = titleObj.talkPageTitle
if talkPageName == nil then
▲ end
end
level = validateLevel(level)
▲ return mw.uri.fullUrl(message('protected-talk-page-request-page'))
▲ pageToEdit = message('protected-talk-page-request-page')
return tostring(mw.uri.fullUrl(talkPageName, {
action = 'edit',
section = 'new'
}))
'preload-title-text',
getLevelInfo(level, 'levelText'),
lang:formatDate(message('preload-title-date-format'))
local content = mw.title.new(talkPageName):getContent()
local dedup = 2
while true do
local newname = message("preload-title-dedup-suffix", sectionname, dedup)
if not content:find("==
sectionname = newname
break
Line 110 ⟶ 87:
end
end
local
action = 'edit',
editintro = getLevelInfo(level, 'editintro'),
preload = message('preload-template'),
section = 'new'
})
url = tostring(url)
▲ args.preloadtitle = sectionname
-- Add the preload parameters. @TODO: merge this into the mw.uri.fullUrl
Line 132 ⟶ 103:
url = url .. encodeParam('preloadparams[]', getLevelInfo(level, 'requestTemplate'))
url = url .. encodeParam('preloadparams[]', titleObj.prefixedText)
return url
end
Line 150 ⟶ 116:
function p._button(args)
return require('Module:Clickable button
[1] = args.display or message('default-display-value'),
url = p.makeRequestUrl(args.type),
|