Opened 8 years ago

Closed 8 years ago

#4194 closed New Feature (fixed)

Using multiple css stylesheets within the editor

Reported by: Sa'ar Zac Elias Owned by: Wiktor Walc
Priority: Normal Milestone: CKEditor 3.1
Component: General Version:
Keywords: Confirmed Review+ Cc:

Description

With FCKEditor, we could use several stylesheet within the editor area if using an array of stylesheets' paths instead of a string in the config elemnt.
i think it will be great if we could do this on V3 too.

Attachments (2)

4194.patch (5.2 KB) - added by Wiktor Walc 8 years ago.
4194_2.patch (4.2 KB) - added by Wiktor Walc 8 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Confirmed added
Milestone: CKEditor 3.1

Changed 8 years ago by Wiktor Walc

Attachment: 4194.patch added

comment:2 Changed 8 years ago by Wiktor Walc

Keywords: Review? added
Owner: set to Wiktor Walc

comment:3 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Review- added; Review? removed

The patch looks good. But it looks like there would be a simpler way for the concat handling:

css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ].concat( config.contentsCss )

The concat() function should simply copy the items from config.contentsCss if it's an Array, otherwise it will be simply copied directly (for a String).

The simplification could be applied to the <link> creation trick also, with no performance impact:

[].concat( editor.config.contentsCss ).join( '"><link type="text/css" rel="stylesheet" href="' )

Changed 8 years ago by Wiktor Walc

Attachment: 4194_2.patch added

comment:4 Changed 8 years ago by Wiktor Walc

Keywords: Review? added; Review- removed

The newest patch is using simpler method of concatenating suggested by fredck.

There is one little thing that has changed: the order of css files.

Before it was: [contentsCss, editorCss], now it is: [editorCss, contentsCss].

comment:5 in reply to:  4 Changed 8 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

Replying to wwalc:

There is one little thing that has changed: the order of css files.

Hum... good point. It should not be an issue for now, but good to keep it in mind.

comment:6 Changed 8 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Fixed with [4363].

Note: See TracTickets for help on using tickets.
© 2003 – 2017 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy