1 /*
  2 Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
  3 For licensing, see LICENSE.html or http://ckeditor.com/license
  4 */
  5
  6 (function()
  7 {
  8 	CKEDITOR.dialog.add( 'pastetext', function( editor )
  9 		{
 10 			var textareaId = 'cke_' + CKEDITOR.tools.getNextNumber();
 11
 12 			return {
 13 				title : editor.lang.pasteText.title,
 14
 15 				minWidth : 400,
 16 				minHeight : 330,
 17
 18 				onShow : function()
 19 				{
 20 					// Reset the textarea value.
 21 					CKEDITOR.document.getById( textareaId ).setValue( '' );
 22 				},
 23
 24 				onOk : function()
 25 				{
 26 					// Get the textarea value.
 27 					var text = CKEDITOR.document.getById( textareaId ).getValue();
 28
 29 					// Restore the editing area selection.
 30 					this.restoreSelection();
 31 					this.clearSavedSelection();
 32
 33 					// Inserts the text.
 34 					this.getParentEditor().insertText( text );
 35 				},
 36
 37 				contents :
 38 				[
 39 					{
 40 						label : editor.lang.common.generalTab,
 41 						elements :
 42 						[
 43 							{
 44 								type : 'html',
 45 								id : 'pasteMsg',
 46 								html : '<div style="white-space:normal;width:340px;">' + editor.lang.clipboard.pasteMsg + '</div>'
 47 							},
 48 							{
 49 								type : 'html',
 50 								id : 'content',
 51 								style : 'width:340px;height:170px',
 52 								html :
 53 									'<textarea id="' + textareaId + '" style="' +
 54 										'width:346px;' +
 55 										'height:170px;' +
 56 										'border:1px solid black;' +
 57 										'background-color:white">' +
 58 									'</textarea>'
 59 							}
 60 						]
 61 					}
 62 				]
 63 			}
 64 		});
 65 })();
 66