MediaWiki:Common.js/Clases/CreaEnlacesDex-min.js

// Versión comprimida. Véase MediaWiki:Common.js/Clases/CreaEnlacesDex.js (function{var d='p',T_MOVIMIENTO='m',$UT=UtilityTools,$G=UtilityTools.get;var e=' (en inglés)',T_G=' Generación',T_UBP='http://bulbapedia.bulbagarden.net/wiki/',T_UPS='http://pokemon-stats.com/pokemon/fichas_',T_UGN='http://www.guiasnintendo.com/',T_UGN3=T_UGN+'3_GB_GameBoy/',T_UGN1=T_UGN+'1_GAMEBOY_ADVANCE/',T_USP='http://www.serebii.net/pokedex',T_USA='http://www.serebii.net/attackdex',T_ULP='http://www.legendarypokemon.net/',T_GN='Guías Nintendo',T_PS='Pokémon-stats',T_S='Serebii',T_L='Legendary',T_LP='Legendary Pokémon: ';CreaEnlacesDex=function{this.vars={tipo:null,nombreArt:null,nombre:null,ingles:null,num:null,hoenn:null,generacion:null};this.generaciones=['Primera','Segunda','Tercera','Cuarta'];this.cookieTag='DexItem';this.init};CreaEnlacesDex.prototype={init:function{if(this.getFromPage||this.getFromCookie){this.saveOnExit;if(this.vars.tipo===d)this.genPoke;if(this.vars.tipo===T_MOVIMIENTO)this.genMov;this.setToCookie}},getFromCookie:function{var a=$UT.cookie(this.cookieTag);if(a===null){return false}var p=a.split('|');for(var i=0;i0){this.vars.num=n}else{this.vars.num=0}if($G('numerohoenn')){n=parseInt($UT.trim($UT.getInnerText($G('numerohoenn'))),10);if(!isNaN(n)&&n>0){this.vars.hoenn=n}else{this.vars.hoenn=0}}return true}else if($G('nombremovimiento')){this.vars.tipo=T_MOVIMIENTO;this.vars.nombre=$UT.trim($UT.getInnerText($G('nombremovimiento')));var a=$G('nombreingles');this.vars.ingles=$UT.trim($UT.getInnerText(a));var b=a.parentNode.parentNode.parentNode.rows[2];var c=;if($UT.trim($UT.getInnerText(b.cells[0])).indexOf('Generación')!=-1){c=$UT.trim($UT.getInnerText(b.cells[1]))}for(var i=0;i<this.generaciones.length;i++){if(this.generaciones[i]===c){this.vars.generacion=i;break}}return true}return false},saveOnExit:function{$UT.addHandler(window,'unload',function(a){return function{a.setToCookie}}(this))},setToCookie:function{var a=;for(var b in this.vars){if(this.vars[b]!==null){a+='|'+b+':'+this.vars[b]}}$UT.cookie(this.cookieTag,a.replace('|',))},genPoke:function{var m=this.vars.nombre,n=this.vars.num,sn=n.toString,h=0,zPadLeft=function(a,b){var c=;for(var i=a.length;i<b;i++){c+='0'}return c+a};if(this.vars.hoenn!==null&&!isNaN(parseInt(this.vars.hoenn,10))){h=parseInt(this.vars.hoenn,10)}this.link('http://es.wikipedia.org/wiki/'+m,'Wikipedia','Wikipedia en español');n&&n<=150&&this.link(T_UGN3+'pokemon/pokemon_sp/Pokedex/'+m.toLowerCase.replace('mr. ',)+'.asp',T_GN+' RAA',T_GN+': 1ª'+T_G);n&&n<=251&&this.link(T_UGN3+'pokeoroplata/Pokedex/'+zPadLeft(sn,2)+'-'+m.replace(' ',)+'.htm',T_GN+' OPC',T_GN+': 2ª'+T_G);h&&h<=200&&this.link(T_UGN1+'pokemonrubizafiro/pok_rubi_zafiro_SP/pokedex/pokemon'+zPadLeft(h.toString,3)+m.toLowerCase+'.htm',T_GN+' RZ',T_GN+': Pokémon ediciones Rubí y Zafiro');h&&h<=202&&this.link(T_UGN1+'Pokemon_Esmeralda/pok_esmeralda_SP/pokedex/pokemon'+zPadLeft(h.toString,3)+m.toLowerCase+'.html',T_GN+' E(H)',T_GN+': Pokémon edición Esmeralda, Pokédex de Hoenn');n&&n<=386&&this.link(T_UGN1+'Pokemon_Esmeralda/pok_esmeralda_SP/pokedex_nacional/'+zPadLeft(sn,3)+'.html',T_GN+' E(N)',T_GN+': Pokémon edición Esmeralda, Pokédex Nacional');n&&n<=386&&this.link(T_UGN1+'pokemon_rojofuego_verdehoja/pokemon_rojofuego_verdehoja_sp/pokedex/'+zPadLeft(sn,3)+'.html',T_GN+' RfVh',T_GN+': Pokémon ediciones Rojo Fuego y Verde Hoja');n&&n<=490&&this.link(T_UGN+'0_NINTENDO_DS/Pokemon_perla_diamante/Pokemon_perla_diamante_sp/pokedex_nacional/'+zPadLeft(sn,3)+'.html',T_GN+' DP',T_GN+': 4ª'+T_G);if(n&&n<=151){this.link(T_UPS+'ra/'+zPadLeft(sn,3)+'.php',T_PS+' RA',T_PS+': Rojo y Azul');this.link(T_UPS+'amarillo/'+zPadLeft(sn,3)+'.php',T_PS+' A',T_PS+': Amarillo')}if(n&&n<=251){this.link(T_UPS+'op/'+zPadLeft(sn,3)+'.php',T_PS+' OP',T_PS+': Oro y Plata');this.link(T_UPS+'cristal/'+zPadLeft(sn,3)+'.php',T_PS+' C',T_PS+': Cristal')}if(h&&h<=386){this.link(T_UPS+'rz/'+zPadLeft(h.toString,3)+'.php',T_PS+' RZ',T_PS+': Rubí y Zafiro');this.link(T_UPS+'esmeralda/'+zPadLeft(h.toString,3)+'.php',T_PS+' E',T_PS+': Esmeralda')}n&&n<=386&&this.link(T_UPS+'rfvh/'+zPadLeft(sn,3)+'.php',T_PS+' RV',T_PS+': Rojo Fuego y Verde Hoja');this.link(T_UPS+'dp/'+zPadLeft(sn,3)+'.php',T_PS+' DP',T_PS+': Diamante y Perla');n&&this.link('http://www.upokecenter.com/dex/?number='+sn,'Ultimate PokéCenter','The Ultimate Pokémon Center');n&&this.link('http://www.pokexperto.net/index2.php?seccion=nds/nationaldex/pkmn&pk='+sn,'Pokexperto 3-4Gen','Pokexperto: 3ª y4ª'+T_G);this.link('http://en.wikipedia.org/wiki/'+m,'Wikipedia [en]','Wikipedia'+e);this.link('http://pokemon.wikia.com/wiki/'+m,'TPE [en]','The Pokemon Encyclopedia'+e);this.link(T_UBP+m+'_(Pokémon)','Bulbapedia [en]','Bulbapedia'+e);n&&n<386&&this.link(T_ULP+'rs/pokedex/'+m,T_L+' 3Gen [en]',T_LP+'3ª'+T_G+e);this.link(T_ULP+'dp/pokedex/'+m,T_L+' 4Gen [en]',T_LP+'4ª'+T_G+e);this.link('http://veekun.com/dex/pokemon/'+m.toLowerCase,'Veekun [en]','Veekun'+e);n&&n<=251&&this.link(T_USP+'/'+zPadLeft(sn,3)+'.shtml',T_S+' 1-2Gen [en]',T_S+': 1ª y 2ª'+T_G+e);n&&n<=386&&this.link(T_USP+'-rs/'+zPadLeft(sn,3)+'.shtml',T_S+' 3Gen [en]',T_S+': 3ª'+T_G+e);n&&n<=493&&this.link(T_USP+'-dp/'+zPadLeft(sn,3)+'.shtml',T_S+' 4Gen [en]',T_S+': 4ª'+T_G+e)},genMov:function{var m=this.vars.nombre,i=(this.vars.ingles||0),g=(parseInt(this.vars.generacion,10)||1);i&&this.link(T_UBP+i.replace(/\b(\w)/g,function(s,p){return p.toUpperCase})+'_(move)','Bulbapedia [en]','Bulbapedia'+e);i&&g<4&&this.link(T_ULP+'rs/attacks/'+i,T_L+' 3Gen [en]',T_LP+'3ª'+T_G+e);i&&this.link(T_ULP+'dp/attacks/'+i,T_L+' 4Gen [en]',T_LP+'4ª'+T_G+e);i&&this.link('http://veekun.com/dex/moves/'+i.toLowerCase,'Veekun [en]','Veekun'+e);i&&g<4&&this.link(T_USA+'/'+i.toLowerCase.replace(/\s/g,)+'.shtml',T_S+' 3Gen [en]',T_S+': 3ª'+T_G+e);i&&this.link(T_USA+'-dp/'+i.toLowerCase.replace(/\s/g,)+'.shtml',T_S+' 4Gen [en]',T_S+': 4ª'+T_G+e)},link:function(a,b,c){}}}); //