Commits

Carl Meyer committed 583123a

Always use our own jQuery; too many hassles trying to use Django admin built-in jQuery.

  • Participants
  • Parent commits d2abffa

Comments (0)

Files changed (3)

File adminfiles/admin.py

         return field
 
     class Media:
-        js = []
-        if JQUERY_URL is not None:
-            js = [JQUERY_URL]
-        js += [posixpath.join(ADMINFILES_MEDIA_URL, 'adminfiles/model.js')]
+        js = [JQUERY_URL, posixpath.join(ADMINFILES_MEDIA_URL, 'adminfiles/model.js')]
 
 admin.site.register(FileUpload, FileUploadAdmin)

File adminfiles/media/adminfiles/model.js

 	           $(this).after('<iframe frameborder="0" style="border:none; width:755px; height:210px;" src="' + href + '"></iframe>');
 	       });
        });
- })((typeof(jQuery) != 'undefined') && jQuery || django.jQuery);
+ })(jQuery);

File adminfiles/settings.py

 from django.conf import settings
 from django.utils.translation import ugettext_lazy as _
 
-if django.VERSION >= (1,2):
-    default_jquery = None
-else:
-    default_jquery = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'
-
-JQUERY_URL = getattr(settings, 'JQUERY_URL', default_jquery)
+JQUERY_URL = getattr(settings, 'JQUERY_URL',
+                     'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js')
 
 if JQUERY_URL and not ((':' in JQUERY_URL) or (JQUERY_URL.startswith('/'))):
     JQUERY_URL = posixpath.join(settings.MEDIA_URL, JQUERY_URL)
                                  ('-upload_date',))
 
 ADMINFILES_USE_SIGNALS = getattr(settings, 'ADMINFILES_USE_SIGNALS', False)
-                                 
+
 ADMINFILES_REF_START = getattr(settings, 'ADMINFILES_REF_START', '<<<')
 
 ADMINFILES_REF_END = getattr(settings, 'ADMINFILES_REF_END', '>>>')
                (_('Insert (align right)'), {'class': 'right'})]
      },
     )
-    
+
 ADMINFILES_STDICON_SET = getattr(settings, 'ADMINFILES_STDICON_SET', None)
-    
+
 ADMINFILES_BROWSER_VIEWS = getattr(settings, 'ADMINFILES_BROWSER_VIEWS',
                                    ['adminfiles.views.AllView',
                                     'adminfiles.views.ImagesView',