]>
git.immae.eu Git - perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git/blob - sources/plugins/forms/dialogs/form.js
2 * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
6 CKEDITOR
.dialog
.add( 'form', function( editor
) {
7 var autoAttributes
= { action: 1, id: 1, method: 1, enctype: 1, target: 1 };
10 title: editor
.lang
.forms
.form
.title
,
16 var path
= this.getParentEditor().elementPath(),
17 form
= path
.contains( 'form', 1 );
21 this.setupContent( form
);
27 isInsertMode
= !element
;
30 editor
= this.getParentEditor();
31 element
= editor
.document
.createElement( 'form' );
32 element
.appendBogus();
36 editor
.insertElement( element
);
37 this.commitContent( element
);
40 function autoSetup( element
) {
41 this.setValue( element
.getAttribute( this.id
) || '' );
44 function autoCommit( element
) {
45 if ( this.getValue() )
46 element
.setAttribute( this.id
, this.getValue() );
48 element
.removeAttribute( this.id
);
51 this.foreach( function( contentObj
) {
52 if ( autoAttributes
[ contentObj
.id
] ) {
53 contentObj
.setup
= autoSetup
;
54 contentObj
.commit
= autoCommit
;
60 label: editor
.lang
.forms
.form
.title
,
61 title: editor
.lang
.forms
.form
.title
,
66 label: editor
.lang
.common
.name
,
69 setup: function( element
) {
70 this.setValue( element
.data( 'cke-saved-name' ) || element
.getAttribute( 'name' ) || '' );
72 commit: function( element
) {
73 if ( this.getValue() )
74 element
.data( 'cke-saved-name', this.getValue() );
76 element
.data( 'cke-saved-name', false );
77 element
.removeAttribute( 'name' );
84 label: editor
.lang
.forms
.form
.action
,
90 widths: [ '45%', '55%' ],
94 label: editor
.lang
.common
.id
,
101 label: editor
.lang
.forms
.form
.encoding
,
108 [ 'multipart/form-data' ],
109 [ 'application/x-www-form-urlencoded' ]
115 widths: [ '45%', '55%' ],
119 label: editor
.lang
.common
.target
,
124 [ editor
.lang
.common
.notSet
, '' ],
125 [ editor
.lang
.common
.targetNew
, '_blank' ],
126 [ editor
.lang
.common
.targetTop
, '_top' ],
127 [ editor
.lang
.common
.targetSelf
, '_self' ],
128 [ editor
.lang
.common
.targetParent
, '_parent' ]
134 label: editor
.lang
.forms
.form
.method
,