Skip to content

Commit 02ffe9f

Browse files
Released good version 1.4.
2 parents 8cbfbf0 + 1eaff98 commit 02ffe9f

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

testtinymce/settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@
9090

9191
TINYMCE_COMPRESSOR = True
9292

93+
# Check to see if django-filebrowser is installed
94+
try:
95+
import filebrowser
96+
INSTALLED_APPS += ('filebrowser',)
97+
TINYMCE_FILEBROWSER = True
98+
except ImportError:
99+
pass
100+
93101
TINYMCE_DEFAULT_CONFIG = {
94102
'theme': "advanced",
95103
'plugins': "spellchecker",

testtinymce/urls.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
admin.autodiscover()
66

7-
urlpatterns = patterns('',
7+
urlpatterns = patterns('')
8+
9+
if getattr(settings, 'TINYMCE_FILEBROWSER', False):
10+
urlpatterns += patterns('',
11+
url(r'^admin/filebrowser/', include('filebrowser.urls')),
12+
)
13+
14+
urlpatterns += patterns('',
815
url(r'^tinymce/', include('tinymce.urls')),
916
url(r'^admin/(.*)', admin.site.root),
1017
url(r'^%s(?P<path>.*)$' % settings.MEDIA_URL[1:],

tinymce/compressor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ def gzip_compressor(request):
112112

113113
# Add filebrowser
114114
if tinymce.settings.USE_FILEBROWSER:
115-
content.append(render_to_response('tinymce/filebrowser.js', {},
116-
context_instance=RequestContext(request)))
115+
content.append(render_to_string('tinymce/filebrowser.js', {},
116+
context_instance=RequestContext(request)).encode("utf-8"))
117117

118118
# Restore loading functions
119119
content.append("tinyMCE_GZ.end();")

0 commit comments

Comments
 (0)