Modulo:Vedi anche/sandbox: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
m +trim
carico CSS da foglio di stile esterno
Riga 35:
-- @return {string}
local function buildHTML(wikitext, withNoprint)
local tableStyle = {
['margin-bottom'] = '.5em',
border = '1px solid #CCC',
['text-align'] = 'left',
['font-size'] = '95%',
background = 'transparent'
}
local tableNode = mw.html.create('table')
tableNode
:addClass('vedi-anche')
:addClass(withNoprint and 'noprint' or nil)
:css(tableStyle)
:tag('tr')
:tag('td')
:css('padding', '0 .5em')
:wikitext('[[File:Magnifying glass icon mgx2.svg|20px|class=noviewer|link=]]')
:done()
:tag('td')
:css('width', '100%')
:wikitext(string.format("''Lo stesso argomento in dettaglio: %s''.", wikitext))
:done()
Line 67 ⟶ 58:
-- Funzione per il template {{Vedi anche sezione}}.
function p.sezione(frame)
local styles = 'Modulo:Vedi anche/sandbox/styles'
local arg = frame:getParent().args[1]
local wlink = arg and string.format("'''[[#%s|%s]]'''", arg, arg) or ''
return buildHTML('sezione ' .. wlink)frame:extensionTag{
name = 'templatestyles',
args = {src = styles}
} .. buildHTML('sezione ' .. wlink)
end
 
Line 75 ⟶ 70:
function p.main(frame)
local lastArg, conjunction
local styles = 'Modulo:Vedi anche/sandbox/styles'
local args = {}
 
Line 88 ⟶ 84:
end
 
return frame:extensionTag{
return buildHTML(mw.text.listToText(args, ', ', conjunction), true)
name = 'templatestyles',
args = {src = styles}
return } .. buildHTML(mw.text.listToText(args, ', ', conjunction), true)
end