1
0
Fork 0
forked from OpenNeo/impress
impress/app/assets/javascripts/pet_query.js
Matchu 22e3f4240a Update most URLs to use HTTPS
I noticed we didn't have the little lock icon in the browser, and yeah
huh there's a lot of `http://` still floating around! Let's fix that!
2023-10-25 15:22:57 -07:00

22 lines
602 B
JavaScript

function petImage(id, size) {
return 'https://pets.neopets.com/' + id + '/1/' + size + '.png';
}
var PetQuery = {},
query_string = document.location.hash || document.location.search;
$.each(query_string.substr(1).split('&'), function () {
var split_piece = this.split('=');
if(split_piece.length == 2) {
PetQuery[split_piece[0]] = split_piece[1];
}
});
if(PetQuery.name) {
if(PetQuery.species && PetQuery.color) {
$('#pet-query-notice-template').tmpl({
pet_name: PetQuery.name,
pet_image_url: petImage('cpn/' + PetQuery.name, 1)
}).prependTo('#container');
}
}