-
Notifications
You must be signed in to change notification settings - Fork 185
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
feat: inline editor #606
Conversation
Fix: Admin forms w/o plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the pull request, the feature looks very nice. still need to actually test it, but added some comments from what i could see so far
djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js
Show resolved
Hide resolved
djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js
Outdated
Show resolved
Hide resolved
djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js
Outdated
Show resolved
Hide resolved
djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js
Outdated
Show resolved
Hide resolved
djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js
Show resolved
Hide resolved
djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js
Show resolved
Hide resolved
djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js
Outdated
Show resolved
Hide resolved
djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js
Show resolved
Hide resolved
djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/cms.ckeditor.js
Outdated
Show resolved
Hide resolved
@vxsx Thanks very much for the comments! They make a lot of sense to me! I appreciate it! Let me know what you think when trying out! I'll have a thought about auto save but my initial reaction is that it will be a must. You always can revert to the published version. |
@vxsx Vadim, I've made some changes. Thanks once more for the helpful comments
|
djangocms_text_ckeditor/static/djangocms_text_ckeditor/ckeditor_plugins/cmswidget/plugin.js
Show resolved
Hide resolved
i also encountered this when testing locally https://www.dropbox.com/s/nk7ykacpvaa2qqe/something%20weird.mov?dl=0 however afterwards it worked correctly, not quite sure what was up first text plugin was created without inline editing mode, afterwards i've enabled the setting and refreshed |
otherwise looks good to me |
The newline gives me a headache: I cannot stop pycharm adding one automatically. Apparently github editor does the same. Tried emacs, no success, alas. Finally did install Will fix the bug for inline. It is actually was supposed to solve a bug leading to |
Also, the bug you've recorded @vxsx seems to be a "follow-up" effect of the displayStyle bug and should be fixed now. Let me know if not! I've managed to remove the new lines at the end of Have a great vacation! |
Quick explanation: CKeditor inserts its css into the head of the page. When the toolbar is reloaded the css is removed. Therefore I keep a copy of the css and replace it after reload. If the spawning of the editor fails before it is finished (e.g. due to the displayStyle bug) the css is not saved and the editor toolbar just contains the names of the toolbar items like in the screen recording.
Creation (or copying) of text plugins is only possible through the structure boards "+" button. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
that.editor.insertHtml(res, 'unfiltered_html'); | ||
that.editor.fire('updateSnapshot'); | ||
CMS.CKEditor.editors[editor.id].changed = true; | ||
CMS.CKEditor.editors[editor.id].child_changed = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like some sort of tabs vs spaces issue
@vxsx Thanks so much! 🚀 |
New feature: Inline editing
Especially for small changes but also for all layouts that consist of more than one Text plugin the edit cycle is simplified: If activated the modal for the change form of a Text plugin does not have to be opened.
Activate by having
TEXT_INLINE_EDITING = True
in yoursettings.py
.Drawbacks
div
to allow inline editing. This can break some custom styles. Use "View published" or switch inline editing off using the toggle button with the pencil<script>
tag generated by Dajngo'sjson_script
template tag - also ifTEXT_INLINE_EDITING
is not set toTrue
.Bugs fixed
cms/plugins/text.html
file. Price is a newcms/plugins/inline.html
template.Know bugs (to be fixed)
Please add comments to this PR if you find any!