df29235fb33efde65d97598fbf9f5c219c059d2b
2 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.html or http://ckeditor.com/license
5 CKEDITOR
.dialog
.add( 'textarea', function( editor
)
8 title
: editor
.lang
.textarea
.title
,
15 var element
= this.getParentEditor().getSelection().getSelectedElement();
16 if ( element
&& element
.getName() == "textarea" )
18 this.textarea
= element
;
19 this.setupContent( element
);
25 element
= this.textarea
,
26 isInsertMode
= !element
;
30 editor
= this.getParentEditor();
31 element
= editor
.document
.createElement( 'textarea' );
33 this.commitContent( element
);
36 editor
.insertElement( element
);
41 label
: editor
.lang
.textarea
.title
,
42 title
: editor
.lang
.textarea
.title
,
45 id
: '_cke_saved_name',
47 label
: editor
.lang
.common
.name
,
50 setup : function( element
)
53 element
.data( 'cke-saved-name' ) ||
54 element
.getAttribute( 'name' ) ||
57 commit : function( element
)
59 if ( this.getValue() )
60 element
.data( 'cke-saved-name', this.getValue() );
63 element
.data( 'cke-saved-name', false );
64 element
.removeAttribute( 'name' );
71 label
: editor
.lang
.textarea
.cols
,
75 validate
: CKEDITOR
.dialog
.validate
.integer( editor
.lang
.common
.validateNumberFailed
),
76 setup : function( element
)
78 var value
= element
.hasAttribute( 'cols' ) && element
.getAttribute( 'cols' );
79 this.setValue( value
|| '' );
81 commit : function( element
)
83 if ( this.getValue() )
84 element
.setAttribute( 'cols', this.getValue() );
86 element
.removeAttribute( 'cols' );
92 label
: editor
.lang
.textarea
.rows
,
96 validate
: CKEDITOR
.dialog
.validate
.integer( editor
.lang
.common
.validateNumberFailed
),
97 setup : function( element
)
99 var value
= element
.hasAttribute( 'rows' ) && element
.getAttribute( 'rows' );
100 this.setValue( value
|| '' );
102 commit : function( element
)
104 if ( this.getValue() )
105 element
.setAttribute( 'rows', this.getValue() );
107 element
.removeAttribute( 'rows' );