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