/*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
*/\r
\r
/**\r
- * Manages the focus activity in an editor instance. This class is to be used\r
- * mainly by UI elements coders when adding interface elements to CKEditor.\r
- * @constructor\r
+ * Creates a focusManager class instance.\r
+ * @class Manages the focus activity in an editor instance. This class is to be\r
+ * used mainly by UI elements coders when adding interface elements that need\r
+ * to set the focus state of the editor.\r
* @param {CKEDITOR.editor} editor The editor instance.\r
* @example\r
+ * var focusManager = <b>new CKEDITOR.focusManager( editor )</b>;\r
+ * focusManager.focus();\r
*/\r
CKEDITOR.focusManager = function( editor )\r
{\r
CKEDITOR.focusManager.prototype =\r
{\r
/**\r
- * Indicates that the editor instance has the focus.\r
- *\r
- * This function is not used to set the focus in the editor. Use\r
+ * Used to indicate that the editor instance has the focus.<br />\r
+ * <br />\r
+ * Note that this function will not explicitelly set the focus in the\r
+ * editor (for example, making the caret blinking on it). Use\r
* {@link CKEDITOR.editor#focus} for it instead.\r
* @example\r
* var editor = CKEDITOR.instances.editor1;\r
\r
var editor = this._.editor;\r
\r
- editor.container.getFirst().addClass( 'cke_focus' );\r
+ editor.container.getChild( 1 ).addClass( 'cke_focus' );\r
\r
this.hasFocus = true;\r
editor.fire( 'focus' );\r
},\r
\r
/**\r
- * Indicates that the editor instance has lost the focus. Note that this\r
- * functions acts asynchronously with a delay of 100ms to avoid subsequent\r
- * blur/focus effects. If you want the "blur" to happen immediately, use\r
- * the {@link #forceBlur} function instead.\r
+ * Used to indicate that the editor instance has lost the focus.<br />\r
+ * <br />\r
+ * Note that this functions acts asynchronously with a delay of 100ms to\r
+ * avoid subsequent blur/focus effects. If you want the "blur" to happen\r
+ * immediately, use the {@link #forceBlur} function instead.\r
* @example\r
* var editor = CKEDITOR.instances.editor1;\r
* <b>editor.focusManager.blur()</b>;\r
},\r
\r
/**\r
- * Indicates that the editor instance has lost the focus. Unlike\r
+ * Used to indicate that the editor instance has lost the focus. Unlike\r
* {@link #blur}, this function is synchronous, marking the instance as\r
* "blured" immediately.\r
* @example\r
{\r
var editor = this._.editor;\r
\r
- editor.container.getFirst().removeClass( 'cke_focus' );\r
+ editor.container.getChild( 1 ).removeClass( 'cke_focus' );\r
\r
this.hasFocus = false;\r
editor.fire( 'blur' );\r
* @name CKEDITOR.editor#focus\r
* @event\r
* @param {CKEDITOR.editor} editor The editor instance.\r
+ * @example\r
+ * editor.on( 'focus', function( e )\r
+ * {\r
+ * alert( 'The editor named ' + e.editor.name + ' is now focused' );\r
+ * });\r
*/\r
\r
/**\r
* @name CKEDITOR.editor#blur\r
* @event\r
* @param {CKEDITOR.editor} editor The editor instance.\r
+ * @example\r
+ * editor.on( 'blur', function( e )\r
+ * {\r
+ * alert( 'The editor named ' + e.editor.name + ' lost the focus' );\r
+ * });\r
*/\r