Differenze tra le versioni di "Modulo:PrevNext"

Update of GlitchPrecSucc to use the new graphic *** sovrascritto il testo esistente ***
(Boh vediamo)
 
(Update of GlitchPrecSucc to use the new graphic *** sovrascritto il testo esistente ***)
(le sigle utilizzabili sono elencate in [[Modulo:Sigle/data|questa pagina]])
- prevbag: ''yes'' se è uno strumento e va mostrato lo sprite della borsa
- previmg: link ad un'immagine, che sarà aggiunta as is vicino alla voce.
- next, nextlink, nextspr, nextsup, nextbag: come sopra ma per l'elemento
Se successivopassato viene ignorato "prevspr" (ma non prevbag).
- prev2next, prevlink2nextlink, prevspr2nextspr, prevsup2nextsup, prevbag2nextbag, nextimg: percome mostraresopra unma secondoper
l'elemento precedente (funzionano come i precedenti)successivo
- next2prev2, nextlink2prevlink2, nextspr2prevspr2, nextsup2prevsup2, nextbag2prevbag2, previmg2: per mostrare un secondo
secondo elemento successivoprecedente (funzionano come i precedenti)
- next2, nextlink2, nextspr2, nextsup2, nextbag2, nextimg2: per mostrare un
secondo elemento successivo (funzionano come i precedenti)
- list: link dell'elemento centrale
- series: se deve mostrare altro testo
local css = require('Modulo:Css')
local ms = require('Modulo:MiniSprite')
local sup = mw.loadData('Modulo:Sup/data')
local links = require('Modulo:Links')
local sup = mw.loadData('Modulo:Sup/data')
 
p.strings = {
 
Add a   at the beginning or at the end of a string, depending on the
direction. If str is nil, returns nil.
 
Arguments:
- str: the string to add the   to. If nil, the funciton returns nil
- dir: direction, either "prev" or "next" (add the   resp. before and
after the string)
--]]
local addNbsp = function(str, dir)
if not str then
return nil
end
if dir == "prev" then
return " " .. str
local imglink = img and table.concat{"[[File:", img, "]]"}
return string.interp(p.strings.MIDDLE_BOX, {
imgpre = img and addNbsp(imglink, "next") or "",
list = list,
imgpost = img and addNbsp(imglink, "prev") or "",
})
end
- bag: (optional) if "yes" the element should display an image via the
template bag
- img: (optional) an image to add. If given, spr parameter is ignored (but
not bag)
- sup: (optional) abbr of the game to put in the sup
 
link = args.link or args.name,
name = args.name,
spr = addNbsp(args.sprimg andor addNbsp(ms.staticLua(args.spr), args.dir) or "",
bag = args.bag == "yes" and addNbsp(links.bag(args.name), args.dir)
or "",
- link: (optional) link of the element
- spr:
- bag:
- supimg:
- sup:
- all these with a trailing 2 (optionals)
 
spr = args.spr2,
bag = args.bag2,
img = args.img2,
sup = args.sup2,
}
spr = args.prevspr,
bag = args.prevbag,
img = args.previmg,
sup = args.prevsup,
name2 = args.prev2,
spr2 = args.prevspr2,
bag2 = args.prevbag2,
img2 = args.previmg2,
sup2 = args.prevsup2,
}
spr = args.nextspr,
bag = args.nextbag,
img = args.nextimg,
sup = args.nextsup,
name2 = args.next2,
spr2 = args.nextspr2,
bag2 = args.nextbag2,
img2 = args.nextimg2,
sup2 = args.nextsup2,
}
79 548

contributi