Opened 17 years ago

Closed 14 years ago

#536 closed New Feature (fixed)

Style Selection checking of parent elements

Reported by: Trevor Phillips Owned by: Garry Yao
Priority: Normal Milestone: CKEditor 3.3
Component: Core : Styles Version:
Keywords: Confirmed Review+ Cc: Damian

Description

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 14 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 16 years ago by Alfonso Martínez de Lizarrondo

Component: GeneralCore : Styles

comment:2 Changed 16 years ago by Alfonso Martínez de Lizarrondo

#2146 has been marked as dup

comment:3 Changed 15 years ago by Artur Formella

Keywords: Confirmed added

comment:4 Changed 14 years ago by Frederico Caldeira Knabben

Cc: Damian added
Milestone: CKEditor 3.3

comment:5 Changed 14 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 14 years ago by Garry Yao

Owner: set to Garry Yao
Status: newassigned

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 14 years ago by Garry Yao

Attachment: 536.patch added

comment:7 Changed 14 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 14 years ago by Alfonso Martínez de Lizarrondo

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 14 years ago by Garry Yao

Resolution: fixed
Status: assignedclosed

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 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy