jonasundderwolf / django-image-cropping

Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.
Other
553 stars 131 forks source link

Remove JQuery/jcrop from Widget media #45

Closed lpalomo closed 9 years ago

lpalomo commented 10 years ago

I see that you are loading JQuery and JCrop with the form media. I wonder if this is the ideal thing to do because, I think, there is a huge possibility that JQuery (and possibly Jcrop) have already been loaded before on the template and therefore JQuery would be loaded multiples times. What do you think?, maybe saying in the docs that JQuery must be loaded before the widget would be enough (maybe saying what versions have been tested to work).

jonasvp commented 10 years ago

We're running jQuery.noConflict(true) directly after loading jQuery and jCrop so all references to "our" jQuery object should be removed from the DOM at that point. Have you been having problems when including jQuery twice? Or is it just an optimization issue to avoid downloading jQuery twice?

You're right, we could remove jQuery from the widget media and add it to the documentation. Not sure if this could cause other problems, as we would be adding jCrop to a jQuery instance that might not expect it.

lpalomo commented 10 years ago

It's just to avoid downloading jquery multiple times. I think it would make the app more flexible, because jquery is generally loaded on the base template of the project.

anrie commented 9 years ago

It's now possible to prevent the inclusion of the jQuery version bundled with django-image-cropping: