Module:Bandeau
--Ce module implémente le modèle Modèle:Bandeau.
local p = {}
local TableBuilder = require('Module:TableBuilder')
p.classStructureBoite = 'bandeau-simple plainlinks' p.styleStructureBoite = --background:#f9f9f9; p.styleStructureImage = 'display:table-cell; vertical-align:middle; width:50px;' p.styleStructureTexte = 'display:table-cell; vertical-align:middle;'
function p.bandeau(frame) args = frame:getParent().args tab = TableBuilder.new()
--Code HTML brut
if args.raw then
res = frame:preprocess('' .. p._bandeau() .. '') .. '\n:Éxecution : ' .. os.clock() .. 's'
return res
else return p._bandeau() end end
function p._bandeau() --Construction HTML du bandeau structureHtml('div', args.class or p.classStructureBoite, p.styleStructureBoite) if args.image then structureHtml('div', 'test-bandeau-image', nil, args.image) structureHtmlFin('div') end structureHtml('p', 'test-bandeau-texte', nil, args.texte) structureHtmlFin('p') structureHtmlFin('div')
return tab.concat() end
function structureHtml(balise, class, style, contenu) tab.insert('<') .insert(balise)
if class then tab.insert(' class="') .insert(class) .insert('"') end
if style then tab.insert(' style="') .insert(style) .insert('"') end
tab.insert('>') .insert(contenu) end
function structureHtmlFin(balise) tab.minsert('</', balise, '>') end
return p