JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.3.2
[ckeditor.git] / _source / plugins / pastetext / dialogs / pastetext.js
index a0dfe48..82e4217 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
@@ -22,10 +22,13 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                onOk : function()\r
                                {\r
                                        // Get the textarea value.\r
-                                       var text = this.getContentElement( 'general', 'content' ).getInputElement().getValue();\r
+                                       var text = this.getContentElement( 'general', 'content' ).getInputElement().getValue(),\r
+                                               editor = this.getParentEditor();\r
 \r
-                                       // Inserts the text.\r
-                                       this.getParentEditor().insertText( text );\r
+                                       setTimeout( function()\r
+                                       {\r
+                                               editor.fire( 'paste', { 'text' : text } );\r
+                                       }, 0 );\r
                                },\r
 \r
                                contents :\r
@@ -41,17 +44,19 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                                html : '<div style="white-space:normal;width:340px;">' + editor.lang.clipboard.pasteMsg + '</div>'\r
                                                        },\r
                                                        {\r
-                                                               type : 'html',\r
+                                                               type : 'textarea',\r
                                                                id : 'content',\r
-                                                               style : 'width:340px;height:170px',\r
-                                                               html :\r
-                                                                       '<textarea style="' +\r
-                                                                               'width:346px;' +\r
-                                                                               'height:170px;' +\r
-                                                                               'resize: none;' +\r
-                                                                               'border:1px solid black;' +\r
-                                                                               'background-color:white">' +\r
-                                                                       '</textarea>',\r
+                                                               className : 'cke_pastetext',\r
+\r
+                                                               onLoad : function()\r
+                                                               {\r
+                                                                       var label = this.getDialog().getContentElement( 'general', 'pasteMsg' ).getElement(),\r
+                                                                               input = this.getElement().getElementsByTag( 'textarea' ).getItem( 0 );\r
+\r
+                                                                       input.setAttribute( 'aria-labelledby', label.$.id );\r
+                                                                       input.setStyle( 'direction', editor.config.contentsLangDirection );\r
+                                                               },\r
+\r
                                                                focus : function()\r
                                                                {\r
                                                                        this.getElement().focus();\r