/*\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
textarea.setAttributes(\r
{\r
dir : 'ltr',\r
- tabIndex : editor.tabIndex,\r
+ tabIndex : CKEDITOR.env.webkit ? -1 : editor.tabIndex,\r
'role' : 'textbox',\r
'aria-label' : editor.lang.editorTitle.replace( '%1', editor.name )\r
});\r
textarea.addClass( 'cke_source' );\r
textarea.addClass( 'cke_enable_context_menu' );\r
\r
+ editor.readOnly && textarea.setAttribute( 'readOnly', 'readonly' );\r
+\r
var styles =\r
{\r
// IE7 has overflow the <textarea> from wrapping table cell.\r
win.on( 'resize', onResize );\r
setTimeout( onResize, 0 );\r
}\r
- else\r
- {\r
- // By some yet unknown reason, we must stop the\r
- // mousedown propagation for the textarea,\r
- // otherwise it's not possible to place the caret\r
- // inside of it (non IE).\r
- textarea.on( 'mousedown', function( evt )\r
- {\r
- evt.data.stopPropagation();\r
- } );\r
- }\r
\r
// Reset the holder element and append the\r
// <textarea> to it.\r
});\r
});\r
\r
+ editor.on( 'readOnly', function()\r
+ {\r
+ if ( editor.mode == 'source' )\r
+ {\r
+ if ( editor.readOnly )\r
+ editor.textarea.setAttribute( 'readOnly', 'readonly' );\r
+ else\r
+ editor.textarea.removeAttribute( 'readOnly' );\r
+ }\r
+ });\r
+\r
editor.addCommand( 'source', sourcearea.commands.source );\r
\r
if ( editor.ui.addButton )\r
source :\r
{\r
modes : { wysiwyg:1, source:1 },\r
-\r
+ editorFocus : false,\r
+ readOnly : 1,\r
exec : function( editor )\r
{\r
if ( editor.mode == 'wysiwyg' )\r