Skip to content
Browse files

allow to not include jquery

  • Loading branch information...
1 parent 03be327 commit 23788429407257494d27c106cace4350d73ad051 @ouhouhsami committed Sep 10, 2013
Showing with 16 additions and 5 deletions.
  1. +6 −0 README.md
  2. +9 −4 progressbarupload/templatetags/progress_bar.py
  3. +1 −1 setup.py
View
6 README.md
@@ -53,6 +53,12 @@ Requirements :
(r'^progressbarupload/', include('progressbarupload.urls')),
```
+5. In your settings file, if you don't want to include jquery with {% progress_bar_media %}, then set:
+
+ ``` python
+ PROGRESSBARUPLOAD_INCLUDE_JQUERY = False
+ ```
+
Usage
-----
View
13 progressbarupload/templatetags/progress_bar.py
@@ -1,8 +1,11 @@
import uuid
-from django.utils.safestring import mark_safe
-from django.core.urlresolvers import reverse
+
from django import template
from django.forms.widgets import Media
+from django.utils.safestring import mark_safe
+from django.core.urlresolvers import reverse
+
+from progressbarupload.settings import PROGRESSBARUPLOAD_INCLUDE_JQUERY
register = template.Library()
@@ -31,6 +34,8 @@ def progress_bar_media():
return rendered script tag for javascript used by progress_bar
"""
- m = Media(js=["http://code.jquery.com/jquery-1.8.3.min.js",
- "js/progress_bar.js"])
+ js = ["js/progress_bar.js",]
+ if PROGRESSBARUPLOAD_INCLUDE_JQUERY:
+ js.append("http://code.jquery.com/jquery-1.8.3.min.js")
+ m = Media(js=js)
return m.render()
View
2 setup.py
@@ -9,7 +9,7 @@
setup(
name = 'django-progressbarupload',
- version = '0.1.5',
+ version = '0.1.6',
packages = find_packages(),
include_package_data = True,
license = 'BSD License',

0 comments on commit 2378842

Please sign in to comment.
Something went wrong with that request. Please try again.