Skip to content

Commit f94a23a

Browse files
authored
Merge pull request #4 from LeetCode-OpenSource/upgrade_django_ckeditor
Upgrade django ckeditor
2 parents fe619cf + 76342c0 commit f94a23a

File tree

254 files changed

+2712
-2409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

254 files changed

+2712
-2409
lines changed

CHANGELOG.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
Changelog
22
=========
33

4+
5.6.1
5+
-----
6+
#. Fix bad pypi package
7+
8+
9+
5.6.0
10+
-----
11+
#. Django 2.1 compatibility, minimal supported Django version is 1.11 LTS
12+
#. Option to set custom django file backend for CKEditor uploader app.
13+
14+
15+
5.5.0
16+
-----
17+
#. CKEditor 4.9.2
18+
#. Documentation improvements
19+
#. Allow non-string properties of user for CKEDITOR_RESTRICT_BY_USER
20+
21+
422
5.4.0
523
-----
624
#. Django 2.0 compatibility

README.rst

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Provides a ``RichTextField``, ``RichTextUploadingField``, ``CKEditorWidget`` and
1313
This version also includes:
1414

1515
#. support to django-storages (works with S3)
16-
#. updated ckeditor to version 4.7
16+
#. updated ckeditor to version 4.9
1717
#. included all ckeditor language and plugin files to made everyone happy! ( `only the plugins maintained by the ckeditor develops team <https://github.com/ckeditor/ckeditor-dev/tree/4.6.2/plugins>`__ )
1818

1919
.. contents:: Contents
@@ -34,19 +34,23 @@ Required
3434
#. Run the ``collectstatic`` management command: ``$ ./manage.py collectstatic``. This will copy static CKEditor required media resources into the directory given by the ``STATIC_ROOT`` setting. See `Django's documentation on managing static files <https://docs.djangoproject.com/en/dev/howto/static-files>`__ for more info.
3535

3636
#. CKEditor needs to know where its assets are located because it loads them
37-
lazily only when needed. The location is determined by looking at a script
38-
tag which includes a URL ending in ``ckeditor.js``. This does not work all
37+
lazily only when needed. The location is determined in the ``ckeditor-init.js``
38+
script. and defaults to ``static/ckeditor/ckeditor/``. This does not work all
3939
the time, for example when using ``ManifestStaticFilesStorage``, any asset
40-
packaging pipeline or whatnot. django-ckeditor is quite good at
41-
automatically detecting the correct place even then, but sometimes you have
42-
to hardcode ``CKEDITOR_BASEPATH`` somewhere. It is recommended to override
43-
the ``admin/base_site.html`` template with your own if you really need to do
40+
packaging pipeline or whatnot. django-ckeditor is quite good at automatically
41+
detecting the correct place even then, but sometimes you have to hardcode
42+
``CKEDITOR_BASEPATH`` somewhere. This can be hardcoded in settings, i.e.::
43+
44+
CKEDITOR_BASEPATH = "/my_static/ckeditor/ckeditor"
45+
46+
It is possible to override
47+
the ``admin/change_form.html`` template with your own if you really need to do
4448
this, i.e.::
4549

46-
{% extends "admin/base_site.html" %}
50+
{% extends "admin/change_form.html" %}
4751

4852
{% block extrahead %}
49-
<script>window.CKEDITOR_BASEPATH = '/static/ckeditor/ckeditor/';</script>
53+
<script>window.CKEDITOR_BASEPATH = '/my_static/ckeditor/ckeditor/';</script>
5054
{{ block.super }}
5155
{% endblock %}
5256

@@ -94,6 +98,7 @@ Required for using widget with file upload
9498
- ``pillow``: Uses Pillow
9599

96100

101+
97102
Optional - customizing CKEditor editor
98103
--------------------------------------
99104

@@ -165,6 +170,8 @@ Optional for file upload
165170

166171
#. Set the ``CKEDITOR_RESTRICT_BY_DATE`` setting to ``True`` to bucked uploaded files by year/month/day.
167172

173+
#. You can set a custom file storage for CKEditor uploader by defining it under ``CKEDITOR_STORAGE_BACKEND`` variable in settings.
174+
168175

169176
Usage
170177
-----
@@ -222,6 +229,7 @@ or you can load the media manually as it is done in the demo app::
222229
<script type="text/javascript" src="{% static "ckeditor/ckeditor-init.js" %}"></script>
223230
<script type="text/javascript" src="{% static "ckeditor/ckeditor/ckeditor.js" %}"></script>
224231

232+
When you need to render ``RichTextField``'s HTML output in your templates safely, just use ``{{ content|safe }}``, `Django's safe filter <https://docs.djangoproject.com/en/2.0/ref/templates/builtins/#std:templatefilter-safe>`_
225233

226234

227235
Management Commands

ckeditor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
VERSION = (5, 4, 3)
1+
VERSION = (5, 6, 2)
22
__version__ = '.'.join(map(str, VERSION))

ckeditor/static/ckeditor/ckeditor/CHANGES.md

Lines changed: 974 additions & 849 deletions
Large diffs are not rendered by default.

ckeditor/static/ckeditor/ckeditor/LICENSE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Software License Agreement
22
==========================
33

4-
CKEditor - The text editor for Internet - http://ckeditor.com
5-
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
4+
CKEditor - The text editor for Internet - https://ckeditor.com/
5+
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
66

77
Licensed under the terms of any of the following licenses at your
88
choice:
@@ -37,7 +37,7 @@ done by developers outside of CKSource with their express permission.
3737

3838
The following libraries are included in CKEditor under the MIT license (see Appendix D):
3939

40-
* CKSource Samples Framework (included in the samples) - Copyright (c) 2014-2017, CKSource - Frederico Knabben.
40+
* CKSource Samples Framework (included in the samples) - Copyright (c) 2014-2018, CKSource - Frederico Knabben.
4141
* PicoModal (included in `samples/js/sf.js`) - Copyright (c) 2012 James Frasca.
4242
* CodeMirror (included in the samples) - Copyright (C) 2014 by Marijn Haverbeke <marijnh@gmail.com> and others.
4343

ckeditor/static/ckeditor/ckeditor/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CKEditor 4
22
==========
33

4-
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
4+
Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
55
http://ckeditor.com - See LICENSE.md for license information.
66

77
CKEditor is a text editor to be used inside web pages. It's not a replacement

ckeditor/static/ckeditor/ckeditor/adapters/jquery.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ckeditor/static/ckeditor/ckeditor/build-config.js

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
/**
2-
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
3-
* For licensing, see LICENSE.md or http://ckeditor.com/license
4-
*/
5-
6-
/**
7-
* This file was added automatically by CKEditor builder.
8-
* You may re-use it at any time to build CKEditor again.
9-
*
10-
* If you would like to build CKEditor online again
11-
* (for example to upgrade), visit one the following links:
12-
*
13-
* (1) http://ckeditor.com/builder
14-
* Visit online builder to build CKEditor from scratch.
15-
*
16-
* (2) http://ckeditor.com/builder/e36bab0e1b0cd2508382db742151f0ca
17-
* Visit online builder to build CKEditor, starting with the same setup as before.
18-
*
19-
* (3) http://ckeditor.com/builder/download/e36bab0e1b0cd2508382db742151f0ca
20-
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
21-
*
22-
* NOTE:
23-
* This file is not used by CKEditor, you may remove it.
24-
* Changing this file will not change your CKEditor configuration.
25-
*/
26-
27-
var CKBUILDER_CONFIG = {
28-
skin: 'moono-lisa',
29-
preset: 'full',
1+
/**
2+
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
3+
* For licensing, see LICENSE.md or http://ckeditor.com/license
4+
*/
5+
6+
/**
7+
* This file was added automatically by CKEditor builder.
8+
* You may re-use it at any time to build CKEditor again.
9+
*
10+
* If you would like to build CKEditor online again
11+
* (for example to upgrade), visit one the following links:
12+
*
13+
* (1) http://ckeditor.com/builder
14+
* Visit online builder to build CKEditor from scratch.
15+
*
16+
* (2) http://ckeditor.com/builder/d92ab52ffca329d7b5e1b78ef77a81f9
17+
* Visit online builder to build CKEditor, starting with the same setup as before.
18+
*
19+
* (3) http://ckeditor.com/builder/download/d92ab52ffca329d7b5e1b78ef77a81f9
20+
* Straight download link to the latest version of CKEditor (Optimized) with the same setup as before.
21+
*
22+
* NOTE:
23+
* This file is not used by CKEditor, you may remove it.
24+
* Changing this file will not change your CKEditor configuration.
25+
*/
26+
27+
var CKBUILDER_CONFIG = {
28+
skin: 'moono-lisa',
29+
preset: 'full',
3030
ignore: [
3131
'.DS_Store',
3232
'.bender',
@@ -110,6 +110,7 @@ var CKBUILDER_CONFIG = {
110110
'templates' : 1,
111111
'toolbar' : 1,
112112
'undo' : 1,
113+
'uploadimage' : 1,
113114
'wsc' : 1,
114115
'wysiwygarea' : 1
115116
},

0 commit comments

Comments
 (0)