JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.3.2
[ckeditor.git] / _source / themes / default / theme.js
index ef0f7c9..1e077d4 100644 (file)
@@ -118,6 +118,7 @@ CKEDITOR.themes.add( 'default', (function()
                                        ' dir="', editor.lang.dir, '"' +\r
                                        ' title="', ( CKEDITOR.env.gecko ? ' ' : '' ), '"' +\r
                                        ' lang="', editor.langCode, '"' +\r
+                                       ( CKEDITOR.env.webkit? ' tabindex="' + tabIndex + '"' : '' ) +\r
                                        ' role="application"' +\r
                                        ' aria-labelledby="cke_', name, '_arialbl"' +\r
                                        ( style ? ' style="' + style + '"' : '' ) +\r
@@ -126,9 +127,9 @@ CKEDITOR.themes.add( 'default', (function()
                                        '<span class="' , CKEDITOR.env.cssClass, '" role="presentation">' +\r
                                                '<span class="cke_wrapper cke_', editor.lang.dir, '" role="presentation">' +\r
                                                        '<table class="cke_editor" border="0" cellspacing="0" cellpadding="0" role="presentation"><tbody>' +\r
-                                                               '<tr', topHtml          ? '' : ' style="display:none"', '><td id="cke_top_'             , name, '" class="cke_top" role="presentation">'        , topHtml               , '</td></tr>' +\r
-                                                               '<tr', contentsHtml     ? '' : ' style="display:none"', '><td id="cke_contents_', name, '" class="cke_contents" style="height:', height, '" role="presentation">', contentsHtml, '</td></tr>' +\r
-                                                               '<tr', bottomHtml       ? '' : ' style="display:none"', '><td id="cke_bottom_'  , name, '" class="cke_bottom" role="presentation">'     , bottomHtml    , '</td></tr>' +\r
+                                                               '<tr', topHtml          ? '' : ' style="display:none"', ' role="presentation"><td id="cke_top_'         , name, '" class="cke_top" role="presentation">'        , topHtml               , '</td></tr>' +\r
+                                                               '<tr', contentsHtml     ? '' : ' style="display:none"', ' role="presentation"><td id="cke_contents_', name, '" class="cke_contents" style="height:', height, '" role="presentation">', contentsHtml, '</td></tr>' +\r
+                                                               '<tr', bottomHtml       ? '' : ' style="display:none"', ' role="presentation"><td id="cke_bottom_'      , name, '" class="cke_bottom" role="presentation">'     , bottomHtml    , '</td></tr>' +\r
                                                        '</tbody></table>' +\r
                                                        //Hide the container when loading skins, later restored by skin css.\r
                                                        '<style>.', editor.skinClass, '{visibility:hidden;}</style>' +\r
@@ -229,41 +230,31 @@ CKEDITOR.themes.add( 'default', (function()
                destroy : function( editor )\r
                {\r
                        var container = editor.container;\r
-\r
-                       /*\r
-                        * IE BUG: Removing the editor DOM elements while the selection is inside\r
-                        * the editing area would break IE7/8's selection system. So we need to put\r
-                        * the selection back to the parent document without scrolling the window.\r
-                        * (#3812)\r
-                        */\r
-                       if ( CKEDITOR.env.ie )\r
-                       {\r
-                               container.setStyle( 'display', 'none' );\r
-\r
-                               var $range = document.body.createTextRange();\r
-                               $range.moveToElementText( container.$ );\r
-                               try\r
-                               {\r
-                                       // Putting the selection to a display:none element - this will certainly\r
-                                       // fail. But! We've just put the selection document back to the parent\r
-                                       // document without scrolling the window!\r
-                                       $range.select();\r
-                               }\r
-                               catch ( e ) {}\r
-                       }\r
+                       container.clearCustomData();\r
+                       editor.element.clearCustomData();\r
 \r
                        if ( container )\r
                                container.remove();\r
 \r
                        if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )\r
-                       {\r
                                editor.element.show();\r
-                               delete editor.element;\r
-                       }\r
+\r
+                       delete editor.element;\r
                }\r
        };\r
 })() );\r
 \r
+/**\r
+ * Returns the DOM element that represents a theme space. The default theme defines\r
+ * three spaces, namely "top", "contents" and "bottom", representing the main\r
+ * blocks that compose the editor interface.\r
+ * @param {String} spaceName The space name.\r
+ * @returns {CKEDITOR.dom.element} The element that represents the space.\r
+ * @example\r
+ * // Hide the bottom space in the UI.\r
+ * var bottom = editor.getThemeSpace( 'bottom' );\r
+ * bottom.setStyle( 'display', 'none' );\r
+ */\r
 CKEDITOR.editor.prototype.getThemeSpace = function( spaceName )\r
 {\r
        var spacePrefix = 'cke_' + spaceName;\r
@@ -272,6 +263,26 @@ CKEDITOR.editor.prototype.getThemeSpace = function( spaceName )
        return space;\r
 };\r
 \r
+/**\r
+ * Resizes the editor interface.\r
+ * @param {Number|String} width The new width. It can be an pixels integer or a\r
+ *             CSS size value.\r
+ * @param {Number|String} height The new height. It can be an pixels integer or\r
+ *             a CSS size value.\r
+ * @param {Boolean} [isContentHeight] Indicates that the provided height is to\r
+ *             be applied to the editor contents space, not to the entire editor\r
+ *             interface. Defaults to false.\r
+ * @param {Boolean} [resizeInner] Indicates that the first inner interface\r
+ *             element must receive the size, not the outer element. The default theme\r
+ *             defines the interface inside a pair of span elements\r
+ *             (&lt;span&gt;&lt;span&gt;...&lt;/span&gt;&lt;/span&gt;). By default the\r
+ *             first span element receives the sizes. If this parameter is set to\r
+ *             true, the second span is sized instead.\r
+ * @example\r
+ * editor.resize( 900, 300 );\r
+ * @example\r
+ * editor.resize( '100%', 450, true );\r
+ */\r
 CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, resizeInner )\r
 {\r
        var numberRegex = /^\d+$/;\r
@@ -302,6 +313,13 @@ CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, res
        this.fire( 'resize' );\r
 };\r
 \r
+/**\r
+ * Gets the element that can be freely used to check the editor size. This method\r
+ * is mainly used by the resize plugin, which adds a UI handle that can be used\r
+ * to resize the editor.\r
+ * @returns {CKEDITOR.dom.element} The resizable element.\r
+ * @example\r
+ */\r
 CKEDITOR.editor.prototype.getResizable = function()\r
 {\r
        return this.container.getChild( 1 );\r
@@ -332,3 +350,10 @@ CKEDITOR.editor.prototype.getResizable = function()
  *     top : 'someElementId'\r
  * };\r
  */\r
+\r
+/**\r
+ * Fired after the editor instance is resized through\r
+ * the {@link CKEDITOR.editor.prototype.resize} method.\r
+ * @name CKEDITOR#resize\r
+ * @event\r
+ */\r