Modulo:Navbox/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
integro nel CSS |
m Bot: rimuovo no globals obsoleto |
||
(11 versioni intermedie di un altro utente non mostrate) | |||
Riga 3:
]]--
require('
local getArgs = require('Modulo:Arguments').getArgs
Riga 48:
-- Con il debug ridefinisce il metodo mw.html:css,
-- permettendo di eseguire i test senza controllare anche
--
-- @param {table} tableNode
Riga 65:
-- Carica il CSS via TemplateStyles quando opportuno
local function loadCSS(name)
local styles = 'Modulo:Navbox/sandbox/' .. prefix .. 'styles.css'
▲ if isTemplatePage(name) then
end▼
end
Line 106 ⟶ 103:
self:_addTnavbar(thNode)
end
self:_addTitle(thNode)
▲ end
-- eventuale riga per l'above
if self.args.above then
Line 137 ⟶ 136:
self.args.state == 'autocollapse' and 'autocollapse' or
not self.args.state and 'autocollapse' or nil)
:addClass('nowraplinks noprint metadata')
:addClass('noprint')▼
:attr('id', 'navbox-' .. (self.args.name or ''))
:cssText(self.args.style)
Line 156 ⟶ 153:
}
}
node:tag('div'):addClass('
end
-- Imposta il titolo del navbox dal parametro "title".
--
-- @param {table} node
function Navbox:_addTitle(node)
node:tag('span'):addClass('navbox_title'):wikitext(self.args.title)
end
Line 166 ⟶ 170:
self.tableNode
:tag('tr')
:tag('
:attr('colspan', self.args.image and '3' or '2')
:addClass('
:cssText(argStyle)
:wikitext(arg)
Line 178 ⟶ 182:
-- @param {number} rowspan
function Navbox:_addImage(trNode, rowspan)
trNode
:tag('td')
:attr('rowspan', rowspan)
:
:cssText(self.args.imagestyle)
:wikitext(self.args.image)
Line 194 ⟶ 193:
function Navbox:_addLists()
local rowIds, altStyle, altBackground
-- crea una riga per ogni groupN/listN
rowIds = getIds(self.args, true)
Line 208 ⟶ 201:
trNode:tag('th')
:attr('colspan', self.args['list' .. id] and '1' or '2')
:
:cssText(self.args.groupstyle)
:cssText(self.args['group' .. id .. 'style'])
Line 218 ⟶ 211:
if (i % 2) == 0 then
altStyle = self.args.evenstyle
altBackground = '
else
altStyle = self.args.oddstyle
altBackground =
end
trNode:tag('td')
:attr('colspan', self.args['group' .. id] and '1' or '2')
:
▲ :css('text-align', self.args['group' .. id] and 'left' or 'center')
:cssText(self.args.liststyle)
:cssText(altStyle)
Line 275 ⟶ 267:
-- Configura gli stili CSS della tabella.
function NavboxSubgroup:_setupTableNode()
self.tableNode
:addClass('subnavbox nowraplinks')
:cssText(self.args.bodystyle)
end
Line 292 ⟶ 275:
function NavboxSubgroup:_addLists()
local listIds, altStyle
-- crea una row per ogni listN
listIds = getIds(self.args)
Line 304 ⟶ 283:
if self.args['group' .. id] then
trNode:tag('th')
:
:cssText(self.args.groupstyle)
:wikitext(self.args['group' .. id])
Line 315 ⟶ 294:
trNode:tag('td')
:attr('colspan', self.args['group' .. id] and '1' or '2')
:
:cssText(self.args.liststyle)
:cssText(altStyle)
Line 335 ⟶ 314:
-- Funzione per l'utilizzo da un altro modulo.
function p._navbox_subgroup(args)
return
end
|