Opened 7 years ago

Closed 7 years ago

#4194 closed New Feature (fixed)

Using multiple css stylesheets within the editor

Reported by: Saare Owned by: wwalc
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 wwalc 7 years ago.
4194_2.patch (4.2 KB) - added by wwalc 7 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 7 years ago by fredck

  • Keywords Confirmed added
  • Milestone set to CKEditor 3.1

Changed 7 years ago by wwalc

comment:2 Changed 7 years ago by wwalc

  • Keywords Review? added
  • Owner set to wwalc

comment:3 Changed 7 years ago by fredck

  • 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 7 years ago by wwalc

comment:4 follow-up: Changed 7 years ago by wwalc

  • 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 7 years ago by fredck

  • 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 7 years ago by wwalc

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with [4363].

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