Module:Sandbox/Ahecht/Catalog lookup link: Difference between revisions

Content deleted Content added
add lock icon
lock→url-access
Line 5:
local out = ''
local defaultSeparator = ', '
local lockIcon = {
['<spanfree'] style="padding-left: 0.15em;">'[[File:Lock-green.svg|9px|link=|alt=Freely accessible|Freely accessible]]</span>',
['registration'] = '[[File:Lock-blue-alt-2.svg|9px|link=|alt=Free registration required|Free registration required]]',
['limited'] = '[[File:Lock-blue-alt-2.svg|9px|link=|alt=Free access subject to limited trial, subscription normally required|Free access subject to limited trial, subscription normally required]]',
['subscription'] = '[[File:Lock-red-alt.svg|9px|link=|alt=Paid subscription required|Paid subscription required]]',
}
-- discard empty parameters and trim whitespace
Line 42 ⟶ 47:
if args['link-prefix'] then
item = '[' .. args['link-prefix'] .. mw.uri.encode(args[i]) .. (args['link-postfix'] or '') .. ' '.. item .. ']'
if lockIcon[args['lockurl-iconaccess']] then
item = item .. '<span style="padding-left:0.15em;">' .. lockIcon[args['url-access']] .. '</span>'
end
end
Line 51 ⟶ 56:
end
if lockIcon[args['lockurl-iconaccess']] or args['plain-links'] then
out = '<span class="plainlinks">' .. out .. '</span>'
end