-
Notifications
You must be signed in to change notification settings - Fork 0
/
pokeagenda.js
31 lines (27 loc) · 929 Bytes
/
pokeagenda.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function pokeagenda () {
this.id = 1;
this.set = function(id) {
id = Math.min(151,Math.max(1,id));
var elPoke = document.querySelectorAll('#pkmn'+('000'+this.id).substr(('000'+this.id).length-3, 3)+'.pokedados');
elPoke[0].style['display'] = '';
elPoke[1].style['display'] = '';
this.id = id;
var elPoke = document.querySelectorAll('#pkmn'+('000'+this.id).substr(('000'+this.id).length-3, 3)+'.pokedados')
elPoke[0].style['display'] = 'block';
elPoke[1].style['display'] = 'block';
try {
responsiveVoice.cancel();
responsiveVoice.speak(elPoke[1].querySelector("#display_text").innerText.replace(/\n/g,''), "Brazilian Portuguese Female");
} catch(e) {}
}
this.next = function() {
this.set(this.id+1);
}
this.prev = function() {
this.set(this.id-1);
}
this.set(1);
}
window.addEventListener('load',function() {
oPokeAgenda = new pokeagenda();
});