Opened 13 years ago

Last modified 9 years ago

#7828 confirmed New Feature

Improvements to the selection API and documentation

Reported by: Teresa Monahan Owned by:
Priority: Normal Milestone:
Component: General Version: 3.0
Keywords: IBM Cc: Damian, Satya Minnekanti, James Cunningham

Description (last modified by Wiktor Walc)

We would like to see improvements in the selection API and associated documentation for CKEditor. Some of our products are extending the editor to support features such as content-assist, word completion, extracting the selection into new documents etc. While the CKEditor selection API does a good job of isolating us from browser differences, it is very difficult to figure out how to use and could be more robust in what API it provides.

Suggestions on areas where we would like the API extended and better documentation are included below:

API to help user query selection:
a) Get the plain text of the selection.
b) Get html behind selection (properly formed)
c) Get element at cursor
d) Proper selection change API (see ticket #6443)
e) Find out if the selection is contained in a single block element, or spans more than one block element.
f) Find out if the selection spans any markup.

API to help user modify selection:
a) Adjust the selection to remove leading or trailing the whitespace. (Double-click selects word plus trailing whitespace, whereas most of our operations are likely to want to work on just whole words).
b) Expand selection to span complete words.
c) Expand selection to whole block.
d) Reduce selection to be contained in one block.

Better documentation/examples around range/selection/bookmark functionality:
a) What is the difference between bookmark and bookmark2, and when should I use one rather than the other?
b) When does a selection/range/bookmark become invalid.
c) Useful examples of how to use selection/range/bookmark API

Change History (3)

comment:1 Changed 13 years ago by Wiktor Walc

Version: 3.5.4 (SVN - trunk)3.0

comment:2 Changed 12 years ago by Jakub Ś

Status: newconfirmed

comment:3 Changed 9 years ago by Wiktor Walc

Description: modified (diff)
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