Module:Sandbox/Jackmcbarn: Difference between revisions

Content deleted Content added
Jackmcbarn (talk | contribs)
fix names
Jackmcbarn (talk | contribs)
m Reverted edits by Jackmcbarn (talk) to last version by Le Deluge
Tags: Replaced Rollback
 
(35 intermediate revisions by 2 users not shown)
Line 1:
local getTarget = require('Module:Redirect').getTarget
local p = {}
 
local function p.mainpagetype(framensText)
return nsText == '' and 'articles' or (mw.ustring.lower(nsText) .. ' pages')
return 'Hello world'
end
 
function p.fnOnlymain(frame)
local currentTitle = mw.title.getCurrentTitle()
return mw.getCurrentFrame():callParserFunction('#invoke',{'Sandbox/Jackmcbarn', 'main'})
local target = getTarget(currentTitle)
end
if target then
 
local currentNsText, targetNsText = currentTitle.nsText, mw.title.new(target).nsText
function p.oneArg(frame)
if currentNsText ~= targetNsText then
return mw.getCurrentFrame():callParserFunction('#invoke',{'Sandbox/Jackmcbarn', 'main', 'baz'})
return string.format('[[:Category:Cross-namespace redirects from %s]][[:Category:Cross-namespace redirects to %s]]', pagetype(currentNsText), pagetype(targetNsText))
end
 
end
function p.twoArgs(frame)
return '[[:Category:Pages incorrectly tagged as cross-namespace redirects]]'
return mw.getCurrentFrame():callParserFunction('#invoke',{'Sandbox/Jackmcbarn', 'main', 'baz', 'qux'})
end