Code Index | File Index

Namespaces

Classes


Class CKEDITOR.dom.selection


Defined in: plugins/selection/plugin.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Manipulates the selection in a DOM document.
Method Summary
Method Attributes Method Name and Description
 
 
Gets the native selection object from the browser.
 
Gets the current selected element.
 
Gets the DOM element in which the selection starts.
 
Gets the type of the current selection.
 
 
selectBookmarks(bookmarks)
Class Detail
CKEDITOR.dom.selection(document)
Since: 3.0
Manipulates the selection in a DOM document.
Parameters:
{Undefined} document
Method Detail
{Undefined} createBookmarks()
Since: 3.0
NO EXAMPLE AVAILABLE

{Object} getNative()
Since: 3.0
Gets the native selection object from the browser.
var selection = editor.getSelection().getNative();
Returns:
{Object} The native selection object.

{CKEDITOR.dom.element} getSelectedElement()
Since: 3.0
Gets the current selected element.
var element = editor.getSelection().getSelectedElement();
alert( element.getName() );
Returns:
{CKEDITOR.dom.element} The selected element. Null if no selection is available or the selection type is not CKEDITOR.SELECTION_ELEMENT.

{CKEDITOR.dom.element} getStartElement()
Since: 3.0
Gets the DOM element in which the selection starts.
var element = editor.getSelection().getStartElement();
alert( element.getName() );
Returns:
{CKEDITOR.dom.element} The element at the beginning of the selection.

{Number} getType()
Since: 3.0
Gets the type of the current selection. The following values are available:
if ( editor.getSelection().getType() == CKEDITOR.SELECTION_TEXT )
    alert( 'Text is selected' );
Returns:
{Number} One of the following constant values: CKEDITOR.SELECTION_NONE, CKEDITOR.SELECTION_TEXT or CKEDITOR.SELECTION_ELEMENT.

{Undefined} reset()
Since: 3.0
NO EXAMPLE AVAILABLE

{Undefined} selectBookmarks(bookmarks)
Since: 3.0
NO EXAMPLE AVAILABLE
Parameters:
{Undefined} bookmarks

Copyright © 2003-2009, CKSource - Frederico Knabben. All rights reserved.