JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.4.2
[ckeditor.git] / _source / core / editor_basic.js
index e54f480..7b2d54a 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -27,36 +27,38 @@ if ( !CKEDITOR.editor )
        CKEDITOR.ELEMENT_MODE_APPENDTO = 2;\r
 \r
        /**\r
-        * Represents an editor instance. This constructor should be rarely used,\r
-        * being the {@link CKEDITOR} methods preferible.\r
-        * @constructor\r
+        * Creates an editor class instance. This constructor should be rarely\r
+        * used, in favor of the {@link CKEDITOR} editor creation functions.\r
+        * @ class Represents an editor instance.\r
         * @param {Object} instanceConfig Configuration values for this specific\r
         *              instance.\r
         * @param {CKEDITOR.dom.element} [element] The element linked to this\r
         *              instance.\r
         * @param {Number} [mode] The mode in which the element is linked to this\r
-        *              instance.\r
+        *              instance. See {@link #elementMode}.\r
+        * @param {String} [data] Since 3.3. Initial value for the instance.\r
         * @augments CKEDITOR.event\r
         * @example\r
         */\r
-       CKEDITOR.editor = function( instanceConfig, element, mode )\r
+       CKEDITOR.editor = function( instanceConfig, element, mode, data )\r
        {\r
                this._ =\r
                {\r
                        // Save the config to be processed later by the full core code.\r
                        instanceConfig : instanceConfig,\r
-                       element : element\r
+                       element : element,\r
+                       data : data\r
                };\r
 \r
                /**\r
                 * The mode in which the {@link #element} is linked to this editor\r
                 * instance. It can be any of the following values:\r
                 * <ul>\r
-                * <li><b>CKEDITOR.ELEMENT_MODE_NONE</b>: No element is linked to the\r
+                * <li>{@link CKEDITOR.ELEMENT_MODE_NONE}: No element is linked to the\r
                 *              editor instance.</li>\r
-                * <li><b>CKEDITOR.ELEMENT_MODE_REPLACE</b>: The element is to be\r
+                * <li>{@link CKEDITOR.ELEMENT_MODE_REPLACE}: The element is to be\r
                 *              replaced by the editor instance.</li>\r
-                * <li><b>CKEDITOR.ELEMENT_MODE_APPENDTO</b>: The editor is to be\r
+                * <li>{@link CKEDITOR.ELEMENT_MODE_APPENDTO}: The editor is to be\r
                 *              created inside the element.</li>\r
                 * </ul>\r
                 * @name CKEDITOR.editor.prototype.elementMode\r
@@ -126,22 +128,23 @@ if ( !CKEDITOR.editor )
         * @param {Object} [config] The specific configurations to apply to this\r
         *              editor instance. Configurations set here will override global CKEditor\r
         *              settings.\r
+        * @param {String} [data] Since 3.3. Initial value for the instance.\r
         * @returns {CKEDITOR.editor} The editor instance created.\r
         * @example\r
         */\r
-       CKEDITOR.editor.appendTo = function( elementOrId, config )\r
+       CKEDITOR.editor.appendTo = function( elementOrId, config, data )\r
        {\r
                var element = elementOrId;\r
                if ( typeof element != 'object' )\r
                {\r
                        element = document.getElementById( elementOrId );\r
 \r
-                       if( !element )\r
+                       if ( !element )\r
                                throw '[CKEDITOR.editor.appendTo] The element with id "' + elementOrId + '" was not found.';\r
                }\r
 \r
                // Create the editor instance.\r
-               return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO );\r
+               return new CKEDITOR.editor( config, element, CKEDITOR.ELEMENT_MODE_APPENDTO, data );\r
        };\r
 \r
        CKEDITOR.editor.prototype =\r