initial commit
[namibia] / public / scripts / ckeditor / _source / plugins / pastetext / dialogs / pastetext.js
1 /*
2 Copyright (c) 2003-2011, 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                         return {
11                                 title : editor.lang.pasteText.title,
12
13                                 minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks ? 368 : 350,
14                                 minHeight : 240,
15
16                                 onShow : function(){ this.setupContent(); },
17                                 onOk : function(){ this.commitContent(); },
18
19                                 contents :
20                                 [
21                                         {
22                                                 label : editor.lang.common.generalTab,
23                                                 id : 'general',
24                                                 elements :
25                                                 [
26                                                         {
27                                                                 type : 'html',
28                                                                 id : 'pasteMsg',
29                                                                 html : '<div style="white-space:normal;width:340px;">' + editor.lang.clipboard.pasteMsg + '</div>'
30                                                         },
31                                                         {
32                                                                 type : 'textarea',
33                                                                 id : 'content',
34                                                                 className : 'cke_pastetext',
35
36                                                                 onLoad : function()
37                                                                 {
38                                                                         var label = this.getDialog().getContentElement( 'general', 'pasteMsg' ).getElement(),
39                                                                                 input = this.getElement().getElementsByTag( 'textarea' ).getItem( 0 );
40
41                                                                         input.setAttribute( 'aria-labelledby', label.$.id );
42                                                                         input.setStyle( 'direction', editor.config.contentsLangDirection );
43                                                                 },
44
45                                                                 focus : function()
46                                                                 {
47                                                                         this.getElement().focus();
48                                                                 },
49                                                                 setup : function()
50                                                                 {
51                                                                         this.setValue( '' );
52                                                                 },
53                                                                 commit : function()
54                                                                 {
55                                                                         var value = this.getValue();
56                                                                         setTimeout( function()
57                                                                         {
58                                                                                 editor.fire( 'paste', { 'text' : value } );
59                                                                         }, 0 );
60                                                                 }
61                                                         }
62                                                 ]
63                                         }
64                                 ]
65                         };
66                 });
67 })();