diff --git a/client/app/js/models/battles/pokemon.coffee b/client/app/js/models/battles/pokemon.coffee index 7f46b73..674a2f0 100644 --- a/client/app/js/models/battles/pokemon.coffee +++ b/client/app/js/models/battles/pokemon.coffee @@ -268,7 +268,7 @@ class @Pokemon extends Backbone.Model slugSpecies = slugify(@get('species')) slugForme = slugify(@get('forme')) - "//wiki.p-insurgence.com/#{slugSpecies}" + "/pokemon/#{@get('species')}" getIllu: -> @get('illu') diff --git a/client/templates/pokemon.jade b/client/templates/pokemon.jade index 676c771..30bd80f 100644 --- a/client/templates/pokemon.jade +++ b/client/templates/pokemon.jade @@ -28,6 +28,7 @@ style height: 200px; text-align: center; vertical-align: middle; + padding: 0px; } .description{ width: 400px; diff --git a/public/js/app.js b/public/js/app.js index 4ce0c20..db3a861 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -1876,7 +1876,7 @@ }; slugSpecies = slugify(this.get('species')); slugForme = slugify(this.get('forme')); - return "//wiki.p-insurgence.com/" + slugSpecies; + return "/pokemon/" + (this.get('species')); }; Pokemon.prototype.getIllu = function() { diff --git a/public/js/replays.js b/public/js/replays.js index 8f180b4..5683aa1 100644 --- a/public/js/replays.js +++ b/public/js/replays.js @@ -1876,7 +1876,7 @@ }; slugSpecies = slugify(this.get('species')); slugForme = slugify(this.get('forme')); - return "//wiki.p-insurgence.com/" + slugSpecies; + return "/pokemon/" + (this.get('species')); }; Pokemon.prototype.getIllu = function() { diff --git a/public/js/tiers.js b/public/js/tiers.js index d1da2e7..63ee300 100644 --- a/public/js/tiers.js +++ b/public/js/tiers.js @@ -190,7 +190,8 @@ function populateTable(arr) { for (var i in arr) { var pokeObj = arr[i]; var row = table.insertRow(-1); - row.className += "row" + row.className += "row pokemonRow" + row.id = pokeObj.name // Sets dexNo var dexcell = row.insertCell(0); dexcell.innerHTML = pokeObj.id; @@ -290,6 +291,33 @@ function populateTable(arr) { } +function openTab(pkmn) { + pkmn = pkmn.replace(" ", "_") + url= "/pokemon/" + pkmn + window.open(url, '_blank'); +} + +$("table.table.list").click(function (e) { + target = e.target; + var search = target; + var searching = true; + while (searching) { + upNode = search.parentElement; + if (upNode.localName == "body") { + searching = false; + return; + } + if (upNode.className == "row pokemonRow") { + searching = false; + openTab(upNode.id) + } + else { + search = upNode; + } + } + +}) + $(document).ready(function () { makeObject(function (arr) { populateTable(arr)