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
now use tabber tag
m Ihaveahax moved page Module:FBI QR codes to Module:FBI QR code without leaving a redirect: match template name
 
(11 intermediate revisions by the same user not shown)
Line 41: Line 41:
local url = args['url' .. tostring(v)]
local url = args['url' .. tostring(v)]
if name and url then
if name and url then
local qr = frame:callParserFunction('#qrlite', {url, format = 'svg', margin = '3'})
local qr = frame:expandTemplate( { title = 'qrlite', args = { url, format = 'png', margin = '3' } } )
table.insert(sections, {name, qr..frame:preprocess('<br>['..url..' '..url..']')})
table.insert(sections, {name, '<p class="hb-qrcode-image">'..qr..'</p><p class="hb-qrcode-link">['..url..' '..url..']</p>'})
end
end
end
end
Line 52: Line 52:
local finalSections = ''
local finalSections = ''
for k, v in ipairs(sections) do
for k, v in ipairs(sections) do
finalSections = finalSections..'\n|-|'..v[1]..'=\n\n'..v[2]
finalSections = finalSections..'|-|'..v[1]..'='..v[2]
end
end
Line 70: Line 70:


function p.template(frame)
function p.template(frame)
local sections = p.makeSections(frame, frame.args)
local args = {}
for k,v in pairs(frame.args) do args[k] = mw.text.trim(v) end
local sections = p.makeSections(frame, args)
return p.makeTabber(frame, sections)
return p.makeTabber(frame, sections)
end
end


return p
return p