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:
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Default-CKEditor-command-for-double-click-on-critical-HTML-Tags-to-edit-in-CKEditor.png | 51.21 KB | rajab natshah |
Comments
Comment #2
rajab natshahComment #3
rajab natshahComment #4
rajab natshahComment #5
rajab natshahComment #7
wim leersEither or both of those plugins need bugfixes then, and possibly closer integration. There's nothing Drupal core can do about this.
This one I know for a fact that would be a bug. I know the Drupal core "Image" plugin (
DrupalImageis 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.
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.