Ticket #8638 (pending Bug)

Opened 3 years ago

Last modified 12 hours ago

The styling of the anchor image in the editor is not customizable

Reported by: tmonahan Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: IBM Cc: damo, satya

Description

Create an anchor in any editor instance and see that an anchor image is displayed in the editor to mark it's position. The image and CSS used to style this icon is provided directly in link/plugin.js and the image used is hardcoded as images/anchor.gif.

var basicCss =
		'background:url(' + CKEDITOR.getUrl( this.path + 'images/anchor.gif' ) + ') no-repeat ' + side + ' center;' +
		'border:1px dotted #00f;';

editor.addCss(
	'a.cke_anchor,a.cke_anchor_empty' +
	// IE6 breaks with the following selectors.
	( ( CKEDITOR.env.ie && CKEDITOR.env.version < 7 ) ? '' :
		',a[name],a[data-cke-saved-name]' ) +
	'{' +
		basicCss +
		'padding-' + side + ':18px;' +
		// Show the arrow cursor for the anchor image (FF at least).
		'cursor:auto;' +
	'}' +
	( CKEDITOR.env.ie ? (
		'a.cke_anchor_empty' +
		'{' +
			// Make empty anchor selectable on IE.
			'display:inline-block;' +
		'}'
		) : '' ) +
	'img.cke_anchor' +
	'{' +
		basicCss +
		'width:16px;' +
		'min-height:15px;' +
		// The default line-height on IE.
		'height:1.15em;' +
		// Opera works better with "middle" (even if not perfect)
		'vertical-align:' + ( CKEDITOR.env.opera ? 'middle' : 'text-bottom' ) + ';' +
	'}');

We would like to be able to customize this CSS through a skin and in particular be able to specify a different image name and type for this icon e.g. anchorIcon.png

Change History

comment:1 Changed 3 years ago by j.swiderski

  • Status changed from new to confirmed
  • Version changed from 3.6.3 (SVN - trunk) to 3.0

Confirmed. Currently styles for anchor are completely uneditable.

comment:2 Changed 12 hours ago by Reinmar

  • Status changed from confirmed to pending

This can be easily fixed by calling CKEDITOR.addCss in some plugin (e.g. a plugin with skins customisations). The method allows to add additional styles, thus it is possible to override img.cke_anchor styles.

Alternatively, contents.css can be used for the same purpose.

Adding a special configuration option would be a bad solution, because it is unnecessary, so it would pollute the config object. It also cannot be done using skin, because skin does not know about plugins.

I'm resetting the status to 'pending'.

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