1
0
Fork 0
forked from OpenNeo/impress

Compare commits

...

1 commit

Author SHA1 Message Date
2faa89dd4c Add better support for hashed pet names 2024-08-30 01:45:39 -04:00
2 changed files with 8 additions and 1 deletions

View file

@ -66,6 +66,10 @@ var DEBUG = document.location.search.substr(0, 6) == "?debug";
}
function petThumbnailUrl(pet_name) {
if (pet_name[0] == "@") {
// if first character is "@", use the hash url
return "https://pets.neopets.com/cp/" + pet_name.substr(1) + "/1/1.png";
}
return "https://pets.neopets.com/cpn/" + pet_name + "/1/1.png";
}

View file

@ -68,6 +68,9 @@
%script#bulk-pets-submission-template{:type => 'text/x-jquery/tmpl'}
%li.waiting
- if pet_name.starts_with?('@')
%img{:src => 'https://pets.neopets.com/cp/${pet_name[1..-1]}/1/1.png'}
- else
%img{:src => 'https://pets.neopets.com/cpn/${pet_name}/1/1.png'}
%span.name ${pet_name}
%span.waiting-message= t '.bulk_pets.waiting'