Skip to content

Commit ff8b8ca

Browse files
authored
Merge branch 'main' into fix-ckeditor-upgrade-docs
2 parents 48014ac + 30f539b commit ff8b8ca

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

djangocms_text/cms_plugins.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ def get_messages(self, request):
579579

580580
@classmethod
581581
@lru_cache
582-
def get_child_plugin_candidates(cls, slot, page):
582+
def get_child_plugin_candidates(cls, slot: str, page=None, template=None):
583583
"""
584584
585585
This method is a class method that returns a list of child plugin candidates for a given slot and page.
@@ -608,7 +608,7 @@ def get_child_plugin_candidates(cls, slot, page):
608608
return text_enabled_plugins
609609

610610
@staticmethod
611-
def render_plugin_icon(plugin):
611+
def render_plugin_icon(plugin: CMSPluginBase):
612612
icon = getattr(plugin, "text_icon", None)
613613
if icon is None:
614614
return

djangocms_text/contrib/text_ckeditor4/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
from djangocms_text.editors import RTEConfig
22

3+
from cms.utils.urlutils import static_with_version
4+
35

46
ckeditor4 = RTEConfig(
57
name="ckeditor4",
68
config="CKEDITOR",
79
js=(
10+
static_with_version("cms/js/dist/bundle.admin.base.min.js"),
811
"djangocms_text/vendor/ckeditor4/ckeditor.js",
912
"djangocms_text/bundles/bundle.ckeditor4.min.js",
1013
),

djangocms_text/widgets.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@
1818
from .editors import DEFAULT_TOOLBAR_CMS, DEFAULT_TOOLBAR_HTMLField, get_editor_base_config, get_editor_config
1919
from .utils import admin_reverse, cms_placeholder_add_plugin
2020

21-
try:
22-
from cms.utils.urlutils import static_with_version
23-
except ModuleNotFoundError: # pragma: no cover
24-
25-
def static_with_version(path):
26-
return path
27-
28-
2921
rte_config = get_editor_config()
3022
#: The configuration for the text editor widget
3123

@@ -106,7 +98,6 @@ def media(self):
10698
),
10799
},
108100
js=(
109-
static_with_version("cms/js/dist/bundle.admin.base.min.js"),
110101
"djangocms_text/bundles/bundle.editor.min.js",
111102
*rte_config.js,
112103
),

private/js/cms.editor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class CMSEditor {
4242
this.CMS.$(window).on('cms-content-refresh', () => {
4343
if (document.querySelector('template.cms-plugin')) {
4444
// django CMS core does not wrap newly inserted inline editable fields
45-
// this.CMS.API.Helpers.reloadBrowser();
45+
this.CMS.API.Helpers.reloadBrowser();
4646
} else {
4747
this._resetInlineEditors();
4848
}
@@ -230,7 +230,7 @@ class CMSEditor {
230230
} else { // no, wrap now!
231231
wrapper = document.createElement('div');
232232
wrapper.classList.add('cms-editor-inline-wrapper', 'wrapped');
233-
wrapper.classList.add('cms-plugin', cls);
233+
wrapper.classList.add('cms-plugin', cls, 'cms-plugin-start', 'cms-plugin-end');
234234
wrapper = this._wrapAll(elements, wrapper);
235235
}
236236
wrapper.dataset.cmsEditUrl = url;
@@ -499,7 +499,7 @@ class CMSEditor {
499499
}
500500
}
501501
// Additional content for the page disrupts inline editing and needs to be removed
502-
delete this.CMS.API.Helpers.dataBridge.content;
502+
delete this.CMS.API.Helpers.dataBridge.structure.content;
503503

504504
if (this.CMS.settings.version.startsWith('3.')) {
505505
/* Reflect dirty flag in django CMS < 4 */

0 commit comments

Comments
 (0)