Module:Top icons: Difference between revisions

Created page with "--<nowiki> local p = {} local sites = { gsm = { format = 'You can find the Game here.', params = { 'gem', 'game', 'gs' }, abbr = 'gs', title = 'You can find the Game..."
 
No edit summary
Line 23: Line 23:
}
}


local order = { 'os', 'rsc', 'wp', 'wg' }
local order = { 'gsm', 'gsf', 'wp' }


local allparams = {}
local allparams = {}
Line 57: Line 57:
local ret = mw.html.create('div')
local ret = mw.html.create('div')
ret:addClass('rs-external-header-links'):css('display', 'none')
ret:addClass('gs-external-header-links'):css('display', 'none')
for _,v in ipairs(order) do
for _,v in ipairs(order) do
if vals[v] then
if vals[v] then
local span = ret:tag('span')
local span = ret:tag('span')
span:wikitext(string.format(sites[v].format, vals[v]))
span:wikitext(string.format(sites[v].format, vals[v]))
:addClass('rs-header-icon rs-header-icon-'..v)
:addClass('gs-header-icon gs-header-icon-'..v)
:attr({
:attr({
['data-title'] = string.format(sites[v].title, vals[v]),
['data-title'] = string.format(sites[v].title, vals[v]),