Module:User and Module:User/sandbox: Difference between pages
(Difference between pages)
imported>Ahecht add 3, 4, 6, 7, and 8 |
imported>Pppery Create sandbox version of Module:User |
||
Line 28: | Line 28: | ||
end | end | ||
function p.main(frame | function p.main(frame) | ||
-- Grab the user, project and lang args from wikitext. | -- Grab the user, project and lang args from wikitext. | ||
local argKeys = { | local argKeys = { | ||
Line 47: | Line 47: | ||
} | } | ||
} | } | ||
local origArgs = | local origArgs = frame:getParent().args | ||
local args = {} | local args = {} | ||
for argKey, t in pairs(argKeys) do | for argKey, t in pairs(argKeys) do | ||
Line 71: | Line 71: | ||
-- Input the codes directly. This saves two argument lookups for each | -- Input the codes directly. This saves two argument lookups for each | ||
-- invocation. | -- invocation. | ||
local codes = | local codes = {'t', 'c'} | ||
-- Plug the data into [[Module:UserLinks]]. | -- Plug the data into [[Module:UserLinks]]. | ||
Line 81: | Line 78: | ||
local success, result = pcall(mUserLinks.export, codes, links, options) | local success, result = pcall(mUserLinks.export, codes, links, options) | ||
if success then | if success then | ||
return | return result | ||
else | else | ||
return mShared.makeWikitextError(result, options.isDemo) | return mShared.makeWikitextError(result, options.isDemo) | ||
end | end | ||
end | end | ||
return p | return p |