Differenze tra le versioni di "Modulo:PokePrecSucc"

Inserito decoding dei parametri in ingresso *** sovrascritto il testo esistente ***
(Resa mobile-friendly la parte in wikicode e eliminato uso del modulo Wikilib *** sovrascritto il testo esistente ***)
(Inserito decoding dei parametri in ingresso *** sovrascritto il testo esistente ***)
m.PokePrecSucc = function(frame)
local poke = string.trim(frame.args[1]):lower()
local tipo1, tipo2pokeData = pokes[poke].type1, or pokes[mw.text.decode(poke)].type2
local type1, type2 = pokeData.type1, pokeData.type2
local prev = (pokes[poke].ndex - 2 + data.pokeNum) % data.pokeNum + 1
local nxtprev = pokes[poke](pokeData.ndex - 2 + data.pokeNum) % data.pokeNum + 1
local prevnxt = (pokes[poke]pokeData.ndex - 2 + data.pokeNum) % data.pokeNum + 1
local prevTf, nxtTf = string.tf(prev), string.tf(nxt)
return string.interp([=[{| class="roundy" style="background: #${bg}; border: 3px solid #${bd}; margin-bottom: 5px; margin-top: 5px; width: 100%;"
|}]=],
{
bg = c[tipo1type1].normale,
bd = tipo1type1 == tipo2type2 and c[tipo2type2].dark or c[tipo2type2].normale,
cells = c[tipo1type1].light,
nameprev = pokes[prev].name,
prev = prevTf,
aniprev = ms.aniLua(prevTf),
name = pokes[poke]pokeData.name,
namenext = pokes[nxt].name,
nxt = nxtTf,
106 621

contributi