At #1937484: Update CKEditor library to 4.1 RC and remove CKEditor default style configuration, CKEditor 4.1 RC was added to Drupal core, which was the first to have the "sourcedialog" plugin. At #1950098: Update CKEditor library to 4.1, we updated it to the 4.1 final.
What we didn't do yet, though, is actually start using the sourcedialog plugin when using CKEditor for in-place editing.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | ckeditor_sourcedialog_sourcearea-1964316-1.patch | 1.4 KB | wim leers |
| #1 | ckeditor-source-backend.png | 6.13 KB | wim leers |
| #1 | ckeditor-source-frontend-BEFORE.png | 7.2 KB | wim leers |
| #1 | ckeditor-source-frontend-AFTER.png | 8.3 KB | wim leers |
Comments
Comment #1
wim leersBack-end:
Front-end (in-place editing), BEFORE patch:
Front-end (in-place editing), AFTER patch:
Comment #2
wim leersD7 backport at #1964320: Automatically use "sourcedialog" plugin/button instead of "sourcearea" plugin/button when using CKEditor for in-place editing.
Comment #3
wwalc commentedThat's a very good proposal. The "sourcedialog" plugin was created exactly for such use cases (see the whole story in this ticket).
Comment #4
wim leersAssigning to quicksketch for review (and hopefully RTBC).
Comment #5
nod_Without caring about IE8 we'd have been able to get rid of the second loop by using
.indexOf(), anyway, it's not super pretty but it works.Comment #6
wim leersThanks :)
Unassigning quicksketch.
Comment #7
webchickThis seems like an awful lot of shenanigans just to change one button.
nod_ explained that the structure of CKEditor's configuration looks like this:
So there's no way to select on an HTML ID or something similar. Wah-wah.
Otherwise, seems to work well. It pops up the view source in a dialog which is a little funny compared to what it does on the backend (which is replace the text contents), but Alex pointed out that this is how CKEditor works, so I think it's ok.
Committed and pushed to 8.x. Thanks!
Comment #8
wim leersOn the front-end, it cannot replace the text contents, since on the front-end, you're using
contentEditable… it'd have to replace the text contents AND override the styling. That's why all these shenanigans are necessary in the first place, and that's why thesourcedialogplugin exists :)Comment #9
webchickOk got it. Thanks!
Comment #10
wim leers