Problem/Motivation:

We all are having the issue of not having a default double click command in the CKEditor.

Example #1:

Given that we do have Anchor link and Linkit
When we add a link in the CKEditor
And we double click the link
Then we will have the issue of opining 2 link editors popup or dialog

Example #2:

Given that we do have Embed Media command for images and Image
When we add an image in the CKEditor
And we double click the image .. or it could be an entity for image bundle
Then we will have the issue of opining 2 or 3 image editors popup or dialog

The issue that Developers or Site Builders could create new Media Embed buttons or custom CKEditor plugin with the same command code name. so the order of JavaScript and which one to work with on the Double click.

Proposed resolution:

I think that we are in need to set the default command to for most critical HTML Tags
It could be a textera which we will be able to type the name of the HTML tag and the default double click command.

Double click default command :

a|anchor_link, linkit ...
img|image|embed_image ...
canvas|shape_painter  ....

-------------------------------------------------------
Other option:

Not to allow site builders have two CKEditor command buttons with the same code name?
Not sure about this. but it could allow developers to change the command code name to match the Machine name of their modules.
Site Builders will be creating many [Text editor embed buttons] they will move to other Machine names.

Remaining tasks:

- Have a Default double click CKEditor text format filters
- Save the config for the text format.
- Have a stop other CKEditor double click command.

User interface changes:

API changes:

Data model changes:

Comments

RajabNatshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

Issue summary: View changes
rajab natshah’s picture

rajab natshah’s picture

Issue summary: View changes

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

wim leers’s picture

Status: Active » Closed (works as designed)

Anchor Link and LinkIt

Either or both of those plugins need bugfixes then, and possibly closer integration. There's nothing Drupal core can do about this.

Embed Media command for images and Image

This one I know for a fact that would be a bug. I know the Drupal core "Image" plugin (DrupalImage is its internal name) and I'm certain that it only reacts to images.
So in this case I'm confident that it's a bug in Embed Media, or in the custom code for your site.

The issue that Developers or Site Builders could create new Media Embed buttons or custom CKEditor plugin with the same command code name.

And that's the last straw: this is blatantly wrong. It's the same as creating two Drupal modules with the same name, or two Drupal themes with the same name… how can you expect this to work correctly? They need to have unique names.