Skip to content

Commit

Permalink
fix: ckeditor4 icon & focus
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun committed Jan 16, 2025
1 parent 09b1e10 commit 8fa50db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions private/js/ckeditor4_plugins/cmsplugins/plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import CmsDialog from "../../cms.dialog";

(function ($) {
if (CKEDITOR && CKEDITOR.plugins && CKEDITOR.plugins.registered && CKEDITOR.plugins.registered.cmsplugins) {
if (CKEDITOR && CKEDITOR.plugins && CKEDITOR.plugins.registered && CKEDITOR.plugins.registered.CMSPlugins) {
return;
}

Expand Down Expand Up @@ -109,7 +109,7 @@ import CmsDialog from "../../cms.dialog";

// this is called when creating the dropdown list
onBlock: function (panel, block) {
block.element.setHtml(editor.plugins.CMSPlugins.setupDropdown(editor));
block.element.setHtml(that.setupDropdown(editor));

var anchors = $(block.element.$).find('.cke_panel_listItem a');

Expand Down Expand Up @@ -137,7 +137,7 @@ import CmsDialog from "../../cms.dialog";
});

// handle edit event on double click
// if event is a jQuery event (touchend), than we mutate
// if event is a jQuery event (touchend), then we mutate
// event a bit so we make the payload similar to what ckeditor.event produces
var handleEdit = function (event) {
event.stop();
Expand Down Expand Up @@ -273,7 +273,7 @@ import CmsDialog from "../../cms.dialog";
editor.addMenuGroup('cmspluginsGroup');
editor.addMenuItem('cmspluginsItem', {
label: settings.lang.CMSPlugins.editLabel,
icon: settings.static_url + '/ckeditor_plugins/cmsplugins/icons/cmsplugins.svg',
icon: settings.static_url + '/icons/cmsplugins.svg',
command: 'cmspluginsEdit',
group: 'cmspluginsGroup'
});
Expand Down
7 changes: 3 additions & 4 deletions private/js/cms.ckeditor4.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/* global document, window, console */


import './ckeditor4_plugins/cmsdialog/plugin';
import './ckeditor4_plugins/cmsplugins/plugin';
import './ckeditor4_plugins/cmsresize/plugin';
import './ckeditor4_plugins/cmswidget/plugin';
Expand All @@ -28,7 +27,7 @@ window.cms_editor_plugin = {
skin: 'moono-lisa',
toolbar_CMS: [
['Undo', 'Redo'],
['cmsplugins', 'cmswidget', '-', 'ShowBlocks'],
['CMSPlugins', 'cmswidget', '-', 'ShowBlocks'],
['Format', 'Styles'],
['TextColor', 'BGColor', '-', 'PasteText', 'PasteFromWord'],
['Scayt'],
Expand Down Expand Up @@ -69,7 +68,7 @@ window.cms_editor_plugin = {

// add extra plugins that we absolutely must have
all_options.extraPlugins = all_options.extraPlugins +=
',CMSPlugins,cmswidget,cmsdialog,cmsresize,widget';
',CMSPlugins,cmswidget,cmsresize,widget';

if (typeof all_options.toolbar === 'string' && ('toolbar_' + all_options.toolbar) in all_options) {
all_options.toolbar = all_options['toolbar_' + all_options.toolbar];
Expand All @@ -86,7 +85,7 @@ window.cms_editor_plugin = {

// add additional plugins (autoloads plugins.js)
CKEDITOR.skin.addIcon('CMSPlugins', settings.static_url +
'/ckeditor_plugins/cmsplugins/icons/cmsplugins.svg');
'/icons/cmsplugins.svg');
CKEDITOR.disableAutoInline = true
};
if (!(el.id in this._editors)) {
Expand Down
5 changes: 4 additions & 1 deletion private/js/cms.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@ class CMSEditor {
return;
}
}
if (this.CMS.settings.version < "4") {
// Additional content for the page disrupts inline editing and needs to be removed
delete this.CMS.API.Helpers.dataBridge.content;

if (this.CMS.settings.version.startsWith('3.')) {
/* Reflect dirty flag in django CMS < 4 */
try {
/* For some reason, in v3 this fails if the structure board is not open */
Expand Down

0 comments on commit 8fa50db

Please sign in to comment.