Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: inline editor #606

Merged
merged 90 commits into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
f3d0a0e
Fix: Tests dj4 compatible
fsbraun Mar 22, 2022
3acb10a
Merge branch 'django-cms:master' into master
fsbraun Mar 27, 2022
01766fc
Feature: Inline editing
fsbraun Mar 27, 2022
096e2d5
Make flake (8 happy)
fsbraun Mar 27, 2022
10bfceb
Fix: Inline editing js only loaded in edit mode.
fsbraun Mar 28, 2022
f3e8b19
Fix: Only create InlineEditor for visible elements
fsbraun Mar 28, 2022
94d67cb
Fix: Keep child plugins in tact while inline editing
fsbraun Mar 28, 2022
4d71492
Fix: Tests
fsbraun Mar 28, 2022
41a0bfc
Fix: Flake8 and isort
fsbraun Mar 28, 2022
80ca947
Fix: Add editor condig to dom using toolbar
fsbraun Mar 30, 2022
49ea268
Refactor: unify ckeditor management
fsbraun Mar 31, 2022
883df88
Add: Plugin editing in the inline editor
fsbraun Apr 1, 2022
6c5031e
Fix: Avoid prepare single load of text
fsbraun Apr 4, 2022
c3ab886
Fix: Strongly increased responsiveness. Common csrf token
fsbraun Apr 4, 2022
4801505
Fix: isort, flake8
fsbraun Apr 4, 2022
cfcc94c
Fix: isort
fsbraun Apr 4, 2022
39f7dd7
Add: dark mode for frontend editing
fsbraun Apr 5, 2022
8ea4739
Fix: only group plugins into modules if there are any
fsbraun Apr 6, 2022
ee71958
Fix: non-placholder fields
fsbraun Apr 6, 2022
2e7db57
Fix: Add cms_path to post requests
fsbraun Apr 6, 2022
9b15686
Add: show toolbar loader when saving
fsbraun Apr 6, 2022
8be8029
Fix: remove console.logs, better style
fsbraun Apr 6, 2022
603d284
Fix: Bind CKEDITOR only after load
fsbraun Apr 6, 2022
b5ab516
Fix: Reload toolbar after save to allow edits to be published
fsbraun Apr 6, 2022
5328a2f
Fix: Refactor toolbar reload for better reusability
fsbraun Apr 7, 2022
667aa26
Fix: Memorize styles before first edit
fsbraun May 2, 2022
f6b57d3
Fix: updated js file in widgets.py
fsbraun May 2, 2022
e40bb0d
Fix: admin htmlfields
fsbraun May 2, 2022
39ec6e9
Fix: Remove debug console.log statements
fsbraun May 2, 2022
dbb8376
Fix: Child Plugin editor confusion.
fsbraun May 3, 2022
88a96ff
Fix: Float ckedor diaog above cms structure board
fsbraun May 3, 2022
d7affe3
Fix: block toolbar click manager forb ckeditor
fsbraun May 3, 2022
ea774b3
Fix: Highligh of text plugin
fsbraun May 4, 2022
d28bfa6
Add: CKEDITOR_INLINE_EDITING setting to activate inline editing
fsbraun May 4, 2022
39cfa3a
Fix: Change setting to TEXT_INLINE_EDITING
fsbraun May 4, 2022
09108e3
Merge branch 'master' into feature/inline-editor
fsbraun May 4, 2022
834d30e
Fix: missing comma
fsbraun May 4, 2022
89c3a98
Merge branch 'feature/inline-editor' of github.com:fsbraun/djangocms-…
fsbraun May 4, 2022
770aedc
Fix: flake adjustments
fsbraun May 4, 2022
2967fae
Fix flake 2nd
fsbraun May 4, 2022
01cc06a
Update Readme
fsbraun May 5, 2022
6a9c3af
Fix: link correct static js file
fsbraun May 5, 2022
57c864a
Add: Improved responsiveness by only initializing visible text areas…
fsbraun May 11, 2022
e6f02f9
Fix: Editor initialization
fsbraun May 11, 2022
7c043e0
Fix: wrong editor init order
fsbraun May 11, 2022
039744c
isort
fsbraun May 11, 2022
37f424e
flake8 w503
fsbraun May 11, 2022
7ee60a5
Fix: unwanted scrolling when entering inline editor
fsbraun May 12, 2022
6a1290a
Fix: removed unused variable
fsbraun May 12, 2022
5ef5e18
Fix: Avoid double rendering of plugins when in inline edit mode
fsbraun May 12, 2022
129b54f
Fix: isort
fsbraun May 12, 2022
8e6c33c
Add: Warning before navigating away from unsaved changes
fsbraun May 12, 2022
5177627
Fix: Allow for custom overwrite of `cms/plugins/text.html` template
fsbraun May 13, 2022
40cecb8
Fix: show inline-flex cms-plugins also inline and not as block
fsbraun May 13, 2022
8329988
Add: Switch in admin menu bar for inline editing
fsbraun May 13, 2022
dc9da6e
fix: isort
fsbraun May 13, 2022
f12c565
fix: lint error
fsbraun May 13, 2022
19b991a
Add: Toolbar button
fsbraun May 13, 2022
4cf6e6c
Fix: Remove unused imports
fsbraun May 13, 2022
b054800
Fix: User HTML instead of admin HTML when inline editing is turned off
fsbraun May 14, 2022
6f3fab7
Add: title attribute for inline editing toolbar button
fsbraun May 14, 2022
d8300fd
Some flakes
fsbraun May 14, 2022
6f35efc
Fix: Obfuscation to avoid W503 and W504
fsbraun May 14, 2022
3c822d5
Fix: Keep code readable by accepting the new best practice W504
fsbraun May 14, 2022
ba6a8d8
OK, it's W503 - the new best practice W504 becomes the anti-pattern
fsbraun May 14, 2022
de46aba
Fix: ckeditor opening select dialog box if cmsplugin contains a sele…
fsbraun May 14, 2022
4447fdb
Fix: Toolbar.request.get_absolute_url() does not work: use toolbar.r…
fsbraun May 15, 2022
69a02ad
Add: Simple test
fsbraun May 16, 2022
5c791fa
Fix: test syntax
fsbraun May 16, 2022
a16f872
test: move test case to test_plugin.py
fsbraun May 16, 2022
e3e28ab
Test: test on github actions
fsbraun May 16, 2022
ccb9e2e
Test: Test edit mode
fsbraun May 16, 2022
7729c2e
Test: Try truning on inline-editing
fsbraun May 16, 2022
f389419
Tests: Testing the inline editing switch
fsbraun May 16, 2022
2848d2e
Some lint chocolate
fsbraun May 16, 2022
29c1df1
Fix: Persisetence of inline_editing switch
fsbraun May 16, 2022
dd5e8a6
Add: some comments
fsbraun May 16, 2022
1832147
Fix: dark mode support for inline-editor
fsbraun May 27, 2022
4aa364d
Fix: flake8 unused import
fsbraun May 28, 2022
5e0c32f
Fix: Remove toggle button on touch devices and in collapsed menus.
fsbraun May 31, 2022
af70959
No white space before of
fsbraun Jun 7, 2022
25f1d8b
Fix: No white space at elf for inline.html
fsbraun Jun 7, 2022
8b7bc12
Merge branch 'django-cms:master' into feature/inline-editor
fsbraun Jun 7, 2022
90eb21b
Fix: namespace events, unregister events
fsbraun Jun 8, 2022
331849f
Fix: z-index to let dialog float above structure board
fsbraun Jun 8, 2022
bb33c3d
Update: readme.rst
fsbraun Jun 8, 2022
c405647
NO NEWLINE AT THE END!
fsbraun Jun 8, 2022
320ee5b
NO NEWLINE AT THE END
fsbraun Jun 8, 2022
8d6bfe2
Fix: remove newlines at end of text.html and inline.html
fsbraun Jun 8, 2022
3481820
Fix: displayStyle undefined bug
fsbraun Jun 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ One of the easiest contributions you can make is helping to translate this addon
Documentation
=============

See ``REQUIREMENTS`` in the `setup.py <https://github.com/divio/djangocms-text-ckeditor/blob/master/setup.py>`_
See ``REQUIREMENTS`` in the `setup.py <https://github.com/django-cms/djangocms-text-ckeditor/blob/master/setup.py>`_
file for additional dependencies listed in the

The current integrated Version of CKEditor is: **4.17.2**
Expand Down Expand Up @@ -88,6 +88,32 @@ Upgrading from ``cms.plugins.text``
Configuration
-------------

Inline editing feature
**********************

Inline editing allows editors to directly click on a text plugin and change
the contents in django CMS' edit mode. The CKEditor appears directly around
the text field and can be used normally. Changes are saved as soon as the
text field leaves focus.

Inline editing requires to encapsulate the HTML text in a ``<div>`` in
edit mode. This might cause some side effects with a site's CSS, e.g. direct
child rules.

To activate inline editing add the following line in your project's
``settings.py``::

TEXT_INLINE_EDITING = True

This will add a toggle button to the toolbar to allow to switch inline editing
on and off for the current session.

When inline editing is active the editor will save the plugin's content each time it loses
focus. If only text has changed the user can immediately continue to edit. If
a text-enabled plugin was changed, added, or removed he page will refresh to
update the page tree and get the correctly rendered version of the changed
plugin.

Default content in Placeholder
******************************

Expand All @@ -97,7 +123,7 @@ If you use Django-CMS >= 3.0, you can use ``TextPlugin`` in "default_plugins"
HTML content. If you want to add some "default children" to your
automagically added plugin (i.e. a ``LinkPlugin``), you have to put children
references in the body. References are ``"%(_tag_child_<order>)s"`` with the
inserted order of chidren. For example::
inserted order of children. For example::

CMS_PLACEHOLDER_CONF = {
'content': {
Expand Down Expand Up @@ -212,7 +238,7 @@ configuration parameter in your settings::
#. Add `configuration='MYSETTING'` to the `HTMLField` usage(s) you want to
customize;
#. Define a setting parameter named as the string used in the `configuration`
argument of the `HTMLField` instance with the desidered configuration;
argument of the `HTMLField` instance with the desired configuration;

Values not specified in your custom configuration will be taken from the global
``CKEDITOR_SETTINGS``.
Expand Down Expand Up @@ -252,7 +278,7 @@ to note:
.. _add styles and js configuration: https://github.com/divio/django-cms-demo/blob/7a104acaa749c52a8ed4870a74898e38daf20e46/src/settings.py#L318-L324
.. _stop CKEditor from removing empty spans: https://github.com/divio/django-cms-explorer/blob/908a88afa4e1d1176e267e77eb5c61e31ef0f9e5/static/js/addons/ckeditor.wysiwyg.js#L73
.. _allowedContent: http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules
.. _to contain: https://github.com/divio/djangocms-text-ckeditor/issues/405#issuecomment-276814197
.. _to contain: https://github.com/django-cms/djangocms-text-ckeditor/issues/405#issuecomment-276814197


Drag & Drop Images
Expand All @@ -262,7 +288,7 @@ In IE and Firefox based browsers it is possible to drag and drop a picture into
This image is base64 encoded and lives in the 'src' attribute as a 'data' tag.

We detect this images, encode them and convert them to picture plugins.
If you want to overwirite this behavior for your own picture plugin:
If you want to overwrite this behavior for your own picture plugin:

There is a setting called::

Expand Down
Loading