Modification de Module:Icône
La modification peut être annulée. Veuillez vérifier les différences ci-dessous pour voir si c’est bien ce que vous voulez faire, puis publier ces changements pour finaliser l’annulation de cette modification.
Version actuelle | Votre texte | ||
Ligne 6 : | Ligne 6 : | ||
local DEFAULT_SIZE = 'normal' | local DEFAULT_SIZE = 'normal' | ||
local STANDARD_SIZE = { | local STANDARD_SIZE = { | ||
normal = '14', | |||
normal | grand = '20', | ||
grand | big = '20' | ||
big = ' | |||
} | } | ||
function | function buildIcon(args) | ||
local name = args[1] or DEFAULT_ICON_NAME | local name = args[1] or DEFAULT_ICON_NAME | ||
local link = args['lien'] or args['link'] or '' | local link = args['lien'] or args['link'] or '' | ||
Ligne 21 : | Ligne 19 : | ||
local tooltip = args['infobulle'] or args['tooltip'] or icon.tooltip | local tooltip = args['infobulle'] or args['tooltip'] or icon.tooltip | ||
local size = args[2] or DEFAULT_SIZE | |||
local | size = STANDARD_SIZE[size] or string.gsub(size, 'px', '') | ||
return tostring(mw.html.create('span') | return tostring(mw.html.create('span') | ||
:css('cursor', 'help') | :css('cursor', 'help') | ||
:attr('title', tooltip) | :attr('title', tooltip) | ||
:wikitext('[[Fichier:'..filename..'| | :wikitext('[[Fichier:'..filename..'|x'..size..'px|link='..link..']]') | ||
:allDone()) | :allDone()) | ||
end | end | ||
function p.build(frame) | function p.build(frame) | ||
return buildIcon(require('Module:Outils').extractArgs(frame)) | |||
end | end | ||
return p | return p |