Module:RfD: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
handle an edge case and document what needs to happen if we ever get grandparent frame access
Jackmcbarn (talk | contribs)
use no globals and add a tracking category
Line 1:
require('Module:No globals')
 
local p = {}
 
local getTargetFromText = require('Module:Redirect').getTargetFromText
local messageBox
 
Line 20 ⟶ 22:
discussionPage = nil
end
iflocal nottarget getTargetFromText= thengetTargetFromText(args.content)
return string.format('%s<span id="delete-reason" style="display:none;">%s</span>%s%s',
messageBox.main('mbox', {
type = 'delete',
Line 27 ⟶ 30:
}),
mw.uri.encode(deleteReason),
args.category or string.format('[[Category:Redirects for discussion|%s]]', currentTitle.text),
target and mw.title.new(target) and '' or '[[Category:RfD errors]]'
)
end
Line 33 ⟶ 37:
-- called if the redirect up for discussion is being transcluded
p['1'] = function(frame)
if not getTargetFromText then
getTargetFromText = require('Module:Redirect').getTargetFromText
end
local target = getTargetFromText(frame.args.content)
if target then