Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:FBI QR code: Difference between revisions

From Hacks Guide Wiki
test...
 
No edit summary
Line 1: Line 1:
local args = {}
local p = {}
local p = {}
-- from [[Module:Infobox]]
-- Returns the union of the values of two tables, as a sequence.
local function union(t1, t2)
local vals = {}
for k, v in pairs(t1) do
vals[v] = true
end
for k, v in pairs(t2) do
vals[v] = true
end
local ret = {}
for k, v in pairs(vals) do
table.insert(ret, k)
end
return ret
end


-- from [[Module:Infobox]]
-- from [[Module:Infobox]]
Line 15: Line 35:
end
end


local function argsToObjects( args )
function p.makeSections()
local objects = {}
local sections = {}
for k, v in args do
local nums = union(getArgNums('name'), getArgNums('url'))
for k, v in ipairs(nums) do
local name = args['name' .. tostring(num)]
local url = args['name' .. tostring(num)]
if name and url then
table.insert(sections)
end
end
end
end
end


function p.main( frame )
function p.main(frame)
-- adapted from [[Module:Infobox]]
if frame == mw.getCurrentFrame() then
args = frame:getParent().args
else
args = frame
end
 
local sections = p.makeSections()
end
 
function p.test(frame)
return frame:getParent():callParserFunction('#qrlite', frame:getParent().args['1'])
end
end


return p
return p