msikma / pokesprite

Database project of box and inventory sprites from the Pokémon core series games
https://msikma.github.io/pokesprite/
MIT License
972 stars 167 forks source link

Having issues when using Pokesprite with jQuery! #25

Closed GiacomoLaw closed 7 years ago

GiacomoLaw commented 7 years ago

Hi all

I'm having issues using Pokesprite with jQuery. When jQuery is enabled, all the mons show up as Bulbasaur. When disabled, it fixes itself and goes back to normal.

I am being affected on this repo: https://github.com/GiacomoLaw/pokefinder

I know that it is jQuery, as disabling it fixes the problem.

Thanks in advance!

msikma commented 7 years ago

Seems that the Pokesprite code is just totally wrong, it's attaching the methods to the global window object instead of to its own encapsulated object. One of the minified names just happens to be $ by coincidence, so when jQuery is added to the mix it overrides the $ on window.

I'll go and make some changes, maybe bring the JS into the year 2017 instead of 2011.

msikma commented 7 years ago

By the way...you typoed 'pikipek' as 'pipipek' somewhere in your code. 😄

GiacomoLaw commented 7 years ago

Okay, thanks!

GiacomoLaw commented 7 years ago

Do you know when it may come out? 😄

msikma commented 7 years ago

I'll work on it this weekend. You might also be able to try this (untested), I've rewritten the existing code to use $$ as variable instead of $. This is a temporary fix, but it might work.

GiacomoLaw commented 7 years ago

Thank you very much!

msikma commented 7 years ago

The latest build is totally changed in terms of how it works (it's now a hybrid browser/Node/CommonJS/AMD module), could you give it a try and tell me if it works for you now?

GiacomoLaw commented 7 years ago

Sure, will do soon! I presume I just update the .js and .css files?

Thanks so much!

GiacomoLaw commented 7 years ago

Awesome - it's working great! Thanks so much for the fix 😄

msikma commented 7 years ago

Glad that it works now!