62 734
modifications
mAucun résumé des modifications |
mAucun résumé des modifications Balise : Révocation manuelle |
||
(21 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 13 : | Ligne 13 : | ||
namespace = mw.title.getCurrentTitle().namespace | namespace = mw.title.getCurrentTitle().namespace | ||
} | } | ||
local abb = require('Module:Abréviation') | |||
-- l'objet principal à retourner | -- l'objet principal à retourner | ||
Ligne 57 : | Ligne 59 : | ||
local text = getValue(part.value, part) or part.textdefaultvalue or mw.title.getCurrentTitle().text | local text = getValue(part.value, part) or part.textdefaultvalue or mw.title.getCurrentTitle().text | ||
local subtext = getValue(part.subtitle, part) or part.subtitledefaultvalue | local subtext = getValue(part.subtitle, part) or part.subtitledefaultvalue | ||
text = mw.ustring.gsub(text, " [(][^()]*[)]$", "") | |||
if subtext and (subtext ~= text) then | if subtext and (subtext ~= text) then | ||
text = text .. '<br /><small>' .. subtext .. '</small>' | text = text .. '<br /><small>' .. subtext .. '</small>' | ||
end | end | ||
local class = ' | local class = 'avt-infobox-header' | ||
local style = {} | local style = {} | ||
Ligne 67 : | Ligne 72 : | ||
style[i] = j | style[i] = j | ||
end | end | ||
end | |||
local icon = getValue(part.icon, part) or nil | |||
if icon then | |||
icon = tostring(mw.html.create('div') | |||
:addClass('avt-infobox-header-icon') | |||
:wikitext('[[Fichier:'..icon..'|30x30px|alt=|link=]]') | |||
:allDone()) | |||
end | end | ||
local subhead = nil | local subhead = nil | ||
if part.subhead then | if part.subhead then | ||
local subheadText = | local subheadText = abb.links({ | ||
getValue(part.subhead.games, part), | getValue(part.subhead.games, part), | ||
part.subhead.link, | part.subhead.link, | ||
part.subhead.subject | part.subhead.subject | ||
}) | |||
subhead = tostring(mw.html.create('div') | if subheadText then | ||
subhead = tostring(mw.html.create('div') | |||
:addClass('avt-infobox-header-subhead') | |||
:wikitext(subheadText) | |||
:allDone()) | |||
end | |||
end | end | ||
Ligne 85 : | Ligne 100 : | ||
:addClass(class) | :addClass(class) | ||
:css(style) | :css(style) | ||
:node(icon) | |||
:node(subhead) | :node(subhead) | ||
:tag('div') | :tag('div') | ||
:addClass('avt-infobox-header-title') | |||
:wikitext(text) | :wikitext(text) | ||
:allDone() | :allDone() | ||
Ligne 160 : | Ligne 177 : | ||
elseif #images > 1 then | elseif #images > 1 then | ||
imagesString = imagesString .. '|upright=' .. ( 1 / #images ) | imagesString = imagesString .. '|upright=' .. ( 1 / #images ) | ||
end | end | ||
imagesString = imagesString .. ']]' | imagesString = imagesString .. ']]' | ||
Ligne 168 : | Ligne 182 : | ||
local image = mw.html.create('div') | local image = mw.html.create('div') | ||
:addClass("images") | :addClass("avt-infobox-images") | ||
:css(style) | :css(style) | ||
:wikitext(imagesString) | :wikitext(imagesString) | ||
Ligne 178 : | Ligne 192 : | ||
:wikitext(caption) | :wikitext(caption) | ||
:css(part.legendstyle or {}) | :css(part.legendstyle or {}) | ||
:addClass("legend") | :addClass("avt-infobox-images-legend") | ||
:done() | :done() | ||
end | end | ||
Ligne 295 : | Ligne 309 : | ||
function p.buildsuccession(part) | function p.buildsuccession(part) | ||
if not part.value then | if not part.value then | ||
return nil | |||
end | |||
local values = part.value | |||
local before = getValue(values['before'], part) | |||
local center = getValue(values['center'], part) | |||
local after = getValue(values['after'], part) | |||
if not before and not center and not after then | |||
return nil | return nil | ||
end | end | ||
Ligne 332 : | Ligne 355 : | ||
if color == 'default' then | if color == 'default' then | ||
arrowLeft = '[[Fichier:SCRWEST.png|13px|alt=Précédent|link=]]' | arrowLeft = '[[Fichier:SCRWEST.png|13px|alt=Précédent|link=]]' | ||
arrowRight = '[[Fichier:SCREAST.png|13px|alt= | arrowRight = '[[Fichier:SCREAST.png|13px|alt=Suivant|link=]]' | ||
else | else | ||
arrowLeft = '[[Fichier:SCRWEST.png|13px|alt= | arrowLeft = '[[Fichier:SCRWEST.png|13px|alt=Précédent|link=]]' | ||
arrowRight = '[[Fichier:SCREAST.png|13px|alt=Suivant|link=]]' | arrowRight = '[[Fichier:SCREAST.png|13px|alt=Suivant|link=]]' | ||
style['background-color'] = color | style['background-color'] = color | ||
Ligne 340 : | Ligne 363 : | ||
local styleTrans = {} | local styleTrans = {} | ||
local widthCell = '44%' | local widthCell = '44%' | ||
Ligne 498 : | Ligne 516 : | ||
local text = getValue(part.value, part) | local text = getValue(part.value, part) | ||
if not text then | |||
return nil | |||
end | |||
local formattedlabel | local formattedlabel | ||
Ligne 515 : | Ligne 537 : | ||
function p.buildtable(part) | function p.buildtable(part) | ||
local tab = mw.html.create('table'):css(part.style or {}) | local class = nil | ||
if part.collapseparameters then | |||
if part.collapseparameters.collapsible == true then | |||
class = 'mw-collapsible' | |||
if part.collapseparameters.collapsed == true then | |||
class = class ..' mw-collapsed' | |||
end | |||
end | |||
end | |||
local tab = mw.html.create('table') | |||
:addClass(class) | |||
:css(part.style or {}) | |||
local rows = part.rows | local rows = part.rows | ||
Ligne 653 : | Ligne 687 : | ||
-- class | -- class | ||
local class = 'avt-infobox' | local class = 'infobox avt-infobox' | ||
if moduledata.class then | if moduledata.class then | ||
class = class .. ' ' .. moduledata.class | class = class .. ' ' .. moduledata.class |
modifications