Merge branch 'master' of https://github.com/shaunsephton/django-ckeditor
This commit is contained in:
commit
8fe3c51662
|
@ -1,20 +1,23 @@
|
|||
$(function() {
|
||||
;(function() {
|
||||
var $ = $ || django.jQuery;
|
||||
$(function() {
|
||||
initialiseCKEditor();
|
||||
initialiseCKEditorInInlinedForms();
|
||||
|
||||
function initialiseCKEditorInInlinedForms() {
|
||||
$(".add-row a, .grp-add-handler").click(function () {
|
||||
initialiseCKEditor();
|
||||
return true;
|
||||
});
|
||||
$(document).on("click", ".add-row a, .grp-add-handler", function () {
|
||||
initialiseCKEditor();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function initialiseCKEditor() {
|
||||
$('textarea[data-type=ckeditortype]').each(function(){
|
||||
function initialiseCKEditor() {
|
||||
$('textarea[data-type=ckeditortype]').each(function(){
|
||||
if($(this).data('processed') == "0" && $(this).attr('id').indexOf('__prefix__') == -1){
|
||||
$(this).data('processed',"1");
|
||||
CKEDITOR.replace($(this).attr('id'), $(this).data('config'));
|
||||
$(this).data('processed',"1");
|
||||
CKEDITOR.replace($(this).attr('id'), $(this).data('config'));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
}());
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
from django.conf.urls import patterns, url
|
||||
from django.contrib.admin.views.decorators import staff_member_required
|
||||
from django.views.decorators.cache import never_cache
|
||||
|
||||
from ckeditor import views
|
||||
|
||||
urlpatterns = patterns(
|
||||
'',
|
||||
url(r'^upload/', staff_member_required(views.upload), name='ckeditor_upload'),
|
||||
url(r'^browse/', staff_member_required(views.browse), name='ckeditor_browse'),
|
||||
url(r'^browse/', never_cache(staff_member_required(views.browse)), name='ckeditor_browse'),
|
||||
)
|
||||
|
|
|
@ -98,7 +98,7 @@ def get_image_files(user=None, path=''):
|
|||
return
|
||||
|
||||
for filename in storage_list[STORAGE_FILES]:
|
||||
if os.path.splitext(filename)[0].endswith('_thumb'):
|
||||
if os.path.splitext(filename)[0].endswith('_thumb') or os.path.basename(filename).startswith('.'):
|
||||
continue
|
||||
filename = os.path.join(browse_path, filename)
|
||||
yield filename
|
||||
|
|
|
@ -8,10 +8,19 @@ from django.utils.encoding import force_text
|
|||
from django.utils.translation import get_language
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.forms.util import flatatt
|
||||
import json
|
||||
|
||||
from django.utils.functional import Promise
|
||||
from django.utils.encoding import force_text
|
||||
from django.core.serializers.json import DjangoJSONEncoder
|
||||
|
||||
class LazyEncoder(DjangoJSONEncoder):
|
||||
def default(self, obj):
|
||||
if isinstance(obj, Promise):
|
||||
return force_text(obj)
|
||||
return super(LazyEncoder, self).default(obj)
|
||||
|
||||
|
||||
json_encode = json.JSONEncoder().encode
|
||||
json_encode = LazyEncoder().encode
|
||||
|
||||
DEFAULT_CONFIG = {
|
||||
'skin': 'moono',
|
||||
|
|
Loading…
Reference in New Issue