Opened 10 years ago

Closed 7 years ago

#536 closed New Feature (fixed)

Style Selection checking of parent elements

Reported by: Dortamur Owned by: garry.yao
Priority: Normal Milestone: CKEditor 3.3
Component: Core : Styles Version:
Keywords: Confirmed Review+ Cc: damo


The Styles Configuration functionality almost does what I require. What I'd like to be able to do is define several styles, using classes, to be assigned to tables, table rows, and table cells. I can get it working, but only with tables, and only in IE.

Why not walk up the DOM when checking the Styles context sensitivity, and allow the application of styles to parent elements (just the first tag-matching parent)?

In this way, simply putting my cursor anywhere within a td would allow me to change the style of that parent td, the parent row, the parent table, etc...

I've seen this functionality in similar WYSIWYG HTML editors, and it'd be great in FCKEditor.

Attachments (1)

536.patch (4.7 KB) - added by garry.yao 7 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by alfonsoml

  • Component changed from General to Core : Styles

comment:2 Changed 9 years ago by alfonsoml

#2146 has been marked as dup

comment:3 Changed 9 years ago by arczi

  • Keywords Confirmed added

comment:4 Changed 7 years ago by fredck

  • Cc damo added
  • Milestone set to CKEditor 3.3

comment:5 Changed 7 years ago by garry.yao

I'm not sure if I understand the problem here, but such kind of Object Style applying is already available in Firefox, e.g. by selecting element from elements path bar and apply the style.
The real problem here is unable to have the same behavior on IE and Webkit, because in those browsers' selection system you're not able to *select* the entire element (comparing to select element content), e.g. table cell.

comment:6 Changed 7 years ago by garry.yao

  • Owner set to garry.yao
  • Status changed from new to assigned

Ok, now I understand this feature request better after checking styles system of Office Word 2007, in our case, 'stylesCombo' should be able to apply styles (like table and list) on a stack of elements in path, with the cursor simply anchors inside text content, without the assistance of any other plugins like 'elementsPath'.

Changed 7 years ago by garry.yao

comment:7 Changed 7 years ago by garry.yao

  • Keywords Review? added

The patch provides the capability to apply 'object' type style on appropriate element on path, including the 'selected' element we currently support now.
Two additional style definitions (table and list) are added to exemplify the usage, note that remove applied object style is not implemented yet and is out of the ticket scope.

comment:8 Changed 7 years ago by alfonsoml

  • Keywords Review+ added; Review? removed

Seems to work fine, just some comments:

Please, file a bug to remove applied object styles.

What about adding also an example with links?

		name : 'External link',
		element : 'a',
		attributes :
			'target' : '_blank',
			'class' : 'external'

th is missing in the current definition of objectElements

	var objectElements	= { a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,ul:1 };

it would be better if you could fix it also with this checkin. You are gonna save a lots of headaches with this patch.

comment:9 Changed 7 years ago by garry.yao

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

What about adding also an example with links?

Same result with your above link sample could be achieved by using 'Link' dialog, we could consider of it later.

Please, file a bug to remove applied object styles.

#5336 is opened for it.
Fixed with [5240].

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