Support from Acquia helps fund testing for Drupal Acquia logo

Comments

attiks created an issue. See original summary.

attiks’s picture

Status: Needs work » Needs review
FileSize
4.82 KB

Patch containing the changes to ckeditor

attiks’s picture

If this gets committed, please credit Jelle_S as well

webchick’s picture

Issue tags: +JavaScript

Adding the nod_ summoning tag.

attiks’s picture

Discussed with Jelle_S, we will change the allowedContent as well so it uses the object notation

Jelle_S’s picture

Assigned: Unassigned » Jelle_S
Jelle_S’s picture

Assigned: Jelle_S » Unassigned
FileSize
6.49 KB
3.62 KB

New patch with the allowedContent converted to CKEDITOR.style.

Status: Needs review » Needs work

The last submitted patch, 7: i2579979-7.patch, failed testing.

Jelle_S queued 7: i2579979-7.patch for re-testing.

Jelle_S’s picture

Status: Needs work » Needs review
attiks’s picture

Assigned: Unassigned » nod_
Status: Needs review » Reviewed & tested by the community

This is working and much easier for conyrib to change it, marked as RTBC and assigned to nod_ for final go

nod_’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/ckeditor/js/plugins/drupallink/plugin.js
@@ -111,8 +122,17 @@
+        allowedContent: {

missing new CKEDITOR.style()?

drupal/core/modules/ckeditor/js/plugins/drupalimage/plugin.js
  36:13  error  Extra space after key "alt"          key-spacing
  52:18  error  "i" used outside of binding context  block-scoped-var
  52:25  error  "i" used outside of binding context  block-scoped-var
  52:51  error  "i" used outside of binding context  block-scoped-var
  53:61  error  "i" used outside of binding context  block-scoped-var
  60:20  error  "i" is already defined               no-redeclare
  60:20  error  "i" used outside of binding context  block-scoped-var
  60:27  error  "i" used outside of binding context  block-scoped-var
  60:49  error  "i" used outside of binding context  block-scoped-var
  61:55  error  "i" used outside of binding context  block-scoped-var

Other than that, ok with me.

Jelle_S’s picture

Status: Needs work » Needs review
FileSize
6.8 KB
2.3 KB

I think this should fix the remarks in #12.

nod_’s picture

Status: Needs review » Needs work

Would be better to rename the second iteration variable, that would solve the var eslint errors.

nod_’s picture

(duplicate)

Jelle_S’s picture

Status: Needs work » Needs review
FileSize
6.55 KB
1.45 KB

New patch, got no eslint errors here.

EDIT: also removed a .trim() since the .split() regexp already takes care of that.

nod_’s picture

Status: Needs review » Reviewed & tested by the community

good to go.

Wim Leers’s picture

Title: Allow contrib to alter the ckeditor (image) dialog » Allow contrib to alter EditorImageDialog/EditorImageDialog and have custom attributes be stored
Issue tags: -Needs tests

CKEditor dialog are not alterable

This is plain wrong. You can totally alter the image form. Because it's a form like any other.

What is missing, is the ability for any additional (custom) attributes that those form alterations may add, to persist on the images. Which means this is JS land, and we cannot write test coverage for this (removing the Needs tests tag because of that).

I very much support this, but it should be manually tested. Given that @nod_ RTBC'd it, I'm assuming he did the necessary testing.

Wim Leers’s picture

attiks’s picture

#18 Sorry for the wrong wording

Wim Leers’s picture

#20: np np :) I feel very strongly about unambiguously wording things, I know many people don't feel that strongly about that.

Many thanks for doing this!

webchick’s picture

Status: Reviewed & tested by the community » Fixed

This seems like a very sensible "simplest thing that can possibly work" in 8.0.0 so we can make this whole are shine more in 8.1.x. Great work.

Committed and pushed to 8.0.x. Thanks!

  • webchick committed d8a5cf8 on 8.0.x
    Issue #2579979 by Jelle_S, attiks, nod_, Wim Leers: Allow contrib to...
DuaelFr’s picture

Wim Leers’s picture

Jelle_S’s picture

Berdir’s picture

I'm getting strange JS errors after this:

Uncaught TypeError: Cannot set property 'float' of undefined

Looks like styles is not initialized, but I have no idea what's different in my case that it only happens for me?

This for example happens when switching from an text format without drupalimage to one that has it enabled and completely breaks wysiwyg then.

The following fixes it for me, I can open a follow-up tomorrow, but I don't know enough JS to know if the problem is really somewhere else?

diff --git a/core/modules/ckeditor/js/plugins/drupalimage/plugin.js b/core/modules/ckeditor/js/plugins/drupalimage/plugin.js
index 724fa50..5160797 100644
--- a/core/modules/ckeditor/js/plugins/drupalimage/plugin.js
+++ b/core/modules/ckeditor/js/plugins/drupalimage/plugin.js
@@ -43,6 +43,7 @@
         });
         var allowedContentDefinition = {
           element: 'img',
+          styles: { },
           attributes: {
             '!data-entity-type': '',
             '!data-entity-uuid': ''
attiks’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Wim Leers’s picture