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( 'form', function( editor
)
17 title
: editor
.lang
.form
.title
,
24 var element
= this.getParentEditor().getSelection().getStartElement();
25 var form
= element
&& element
.getAscendant( 'form', true );
29 this.setupContent( form
);
36 isInsertMode
= !element
;
40 editor
= this.getParentEditor();
41 element
= editor
.document
.createElement( 'form' );
42 !CKEDITOR
.env
.ie
&& element
.append( editor
.document
.createElement( 'br' ) );
46 editor
.insertElement( element
);
47 this.commitContent( element
);
51 function autoSetup( element
)
53 this.setValue( element
.getAttribute( this.id
) || '' );
56 function autoCommit( element
)
58 if ( this.getValue() )
59 element
.setAttribute( this.id
, this.getValue() );
61 element
.removeAttribute( this.id
);
64 this.foreach( function( contentObj
)
66 if ( autoAttributes
[ contentObj
.id
] )
68 contentObj
.setup
= autoSetup
;
69 contentObj
.commit
= autoCommit
;
76 label
: editor
.lang
.form
.title
,
77 title
: editor
.lang
.form
.title
,
82 label
: editor
.lang
.common
.name
,
85 setup : function( element
)
87 this.setValue( element
.data( 'cke-saved-name' ) ||
88 element
.getAttribute( 'name' ) ||
91 commit : function( element
)
93 if ( this.getValue() )
94 element
.data( 'cke-saved-name', this.getValue() );
97 element
.data( 'cke-saved-name', false );
98 element
.removeAttribute( 'name' );
105 label
: editor
.lang
.form
.action
,
111 widths
: [ '45%', '55%' ],
117 label
: editor
.lang
.common
.id
,
124 label
: editor
.lang
.form
.encoding
,
125 style
: 'width:100%',
132 [ 'multipart/form-data' ],
133 [ 'application/x-www-form-urlencoded' ]
140 widths
: [ '45%', '55%' ],
146 label
: editor
.lang
.common
.target
,
147 style
: 'width:100%',
152 [ editor
.lang
.common
.notSet
, '' ],
153 [ editor
.lang
.common
.targetNew
, '_blank' ],
154 [ editor
.lang
.common
.targetTop
, '_top' ],
155 [ editor
.lang
.common
.targetSelf
, '_self' ],
156 [ editor
.lang
.common
.targetParent
, '_parent' ]
162 label
: editor
.lang
.form
.method
,