d709b38e5153126f40c5d2b503d59998cb11837b
2 * Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.html or http://ckeditor.com/license
8 function placeholderDialog( editor
, isEdit
)
11 var lang
= editor
.lang
.placeholder
,
12 generalLabel
= editor
.lang
.common
.generalTab
;
28 style
: 'width: 100%;',
32 validate
: CKEDITOR
.dialog
.validate
.notEmpty( lang
.textMissing
),
33 setup : function( element
)
36 this.setValue( element
.getText().slice( 2, -2 ) );
38 commit : function( element
)
40 var text
= '[[' + this.getValue() + ']]';
41 // The placeholder must be recreated.
42 CKEDITOR
.plugins
.placeholder
.createPlaceholder( editor
, element
, text
);
51 this._element
= CKEDITOR
.plugins
.placeholder
.getSelectedPlaceHoder( editor
);
53 this.setupContent( this._element
);
57 this.commitContent( this._element
);
63 CKEDITOR
.dialog
.add( 'createplaceholder', function( editor
)
65 return placeholderDialog( editor
);
67 CKEDITOR
.dialog
.add( 'editplaceholder', function( editor
)
69 return placeholderDialog( editor
, 1 );