Ticket #4194 (closed New Feature: fixed)

Opened 13 months ago

Last modified 11 months ago

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

4194.patch Download (5.2 KB) - added by wwalc 11 months ago.
4194_2.patch Download (4.2 KB) - added by wwalc 11 months ago.

Change History

  Changed 13 months ago by fredck

  • keywords Confirmed added
  • milestone set to CKEditor 3.1

Changed 11 months ago by wwalc

  Changed 11 months ago by wwalc

  • keywords Review? added
  • owner set to wwalc

  Changed 11 months 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 11 months ago by wwalc

follow-up: ↓ 5   Changed 11 months 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].

in reply to: ↑ 4   Changed 11 months 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.

  Changed 11 months ago by wwalc

  • status changed from new to closed
  • resolution set to fixed

Fixed with [4363].

Note: See TracTickets for help on using tickets.