Modulo:Navbox/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
tocca specificare le classi even/odd causa tr opzionale di above |
m Bot: rimuovo no globals obsoleto |
||
(8 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 prefix = isTemplatePage(name) and 'mobile-' or ''
local styles = 'Modulo:Navbox/sandbox/' .. prefix .. 'styles.css'
return mw.getCurrentFrame():extensionTag{
name = 'templatestyles',
Line 135 ⟶ 136:
self.args.state == 'autocollapse' and 'autocollapse' or
not self.args.state and 'autocollapse' or nil)
:addClass('nowraplinks noprint metadata')
:attr('id', 'navbox-' .. (self.args.name or ''))
:cssText(self.args.style)
Line 154 ⟶ 153:
}
}
node:tag('div'):addClass('
end
Line 161 ⟶ 160:
-- @param {table} node
function Navbox:_addTitle(node)
node:tag('span'):addClass('
end
Line 173 ⟶ 172:
:tag('th')
:attr('colspan', self.args.image and '3' or '2')
:addClass('
:cssText(argStyle)
:wikitext(arg)
Line 186 ⟶ 185:
:tag('td')
:attr('rowspan', rowspan)
:addClass('
:cssText(self.args.imagestyle)
:wikitext(self.args.image)
Line 202 ⟶ 201:
trNode:tag('th')
:attr('colspan', self.args['list' .. id] and '1' or '2')
:addClass('
:cssText(self.args.groupstyle)
:cssText(self.args['group' .. id .. 'style'])
Line 212 ⟶ 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')
:addClass(
:addClass(not self.args['group' .. id] and 'navbox_center' or nil)
:addClass(altBackground)
:cssText(self.args.liststyle)
Riga 267:
-- Configura gli stili CSS della tabella.
function NavboxSubgroup:_setupTableNode()
self.tableNode
:addClass('subnavbox nowraplinks')
:cssText(self.args.bodystyle)
end
Line 284 ⟶ 275:
function NavboxSubgroup:_addLists()
local listIds, altStyle
-- crea una row per ogni listN
listIds = getIds(self.args)
Line 296 ⟶ 283:
if self.args['group' .. id] then
trNode:tag('th')
:
:cssText(self.args.groupstyle)
:wikitext(self.args['group' .. id])
Line 307 ⟶ 294:
trNode:tag('td')
:attr('colspan', self.args['group' .. id] and '1' or '2')
:
:cssText(self.args.liststyle)
:cssText(altStyle)
Line 327 ⟶ 314:
-- Funzione per l'utilizzo da un altro modulo.
function p._navbox_subgroup(args)
return
end
|