A common use case for sites we build is that only site managers have access to wysiwyg editors. The module includes ckeditor.css in hook init -- not aggregated no less -- which results in a superfluous stylesheet request for every page request.

Move ckeditor.css inclusion into '#attached', or with drupal_add_css the first time editor elements are included on a page, rather than using hook init. Also if you continue to use drupal_add_css, at least specify it should be aggregated.

CommentFileSizeAuthor
#1 ckeditor-hook-init.patch455 bytesfearlsgroove

Comments

fearlsgroove’s picture

Status: Active » Needs review
StatusFileSize
new455 bytes

Here's a band-aid patch that at least preprocesses the css (i haven't actually tested this, sorry for being lazy :)

wwalc’s picture

Status: Needs review » Needs work

The rte* styles should be left in ckeditor.css and appended to every page (because they're used to style the content when align/justify buttons are used). The rest of styles (especially the one from "toolbar Drag & Drop" group) should be definitely added to the site only when needed. So the right way to go would be to split styles into at least two files.

Regarding the patch - according to the documentation, preprocess is set to TRUE if not specified, so the patch does not change anything. A quick test confirmed that CSS files are aggregated properly.

devin carlson’s picture

Issue summary: View changes
Status: Needs work » Closed (duplicate)
Related issues: +#1370894: Conditionally load ckeditor.css only when necessary

Marking this as a duplicate of the older #1370894: Conditionally load ckeditor.css only when necessary.