Sha256: 84e1858d82767879e14237d6a3385e85a7ed8fb65f741aaeab1d42c6d1bff821

Contents?: true

Size: 1.66 KB

Versions: 88

Compression:

Stored size: 1.66 KB

Contents

/*
 * Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.html or http://ckeditor.com/license
 */

(function()
{
	function placeholderDialog( editor, isEdit )
	{

		var lang = editor.lang.placeholder,
			generalLabel = editor.lang.common.generalTab;
		return {
			title : lang.title,
			minWidth : 300,
			minHeight : 80,
			contents :
			[
				{
					id : 'info',
					label : generalLabel,
					title : generalLabel,
					elements :
					[
						{
							id : 'text',
							type : 'text',
							style : 'width: 100%;',
							label : lang.text,
							'default' : '',
							required : true,
							validate : CKEDITOR.dialog.validate.notEmpty( lang.textMissing ),
							setup : function( element )
							{
								if ( isEdit )
									this.setValue( element.getText().slice( 2, -2 ) );
							},
							commit : function( element )
							{
								var text = '[[' + this.getValue() + ']]';
								// The placeholder must be recreated.
								CKEDITOR.plugins.placeholder.createPlaceholder( editor, element, text );
							}
						}
					]
				}
			],
			onShow : function()
			{
				if ( isEdit )
					this._element = CKEDITOR.plugins.placeholder.getSelectedPlaceHoder( editor );

				this.setupContent( this._element );
			},
			onOk : function()
			{
				this.commitContent( this._element );
				delete this._element;
			}
		};
	}

	CKEDITOR.dialog.add( 'createplaceholder', function( editor )
		{
			return placeholderDialog( editor );
		});
	CKEDITOR.dialog.add( 'editplaceholder', function( editor )
		{
			return placeholderDialog( editor, 1 );
		});
} )();

Version data entries

88 entries across 85 versions & 9 rubygems

Version Path
classiccms-0.7.5 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.7.4 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.7.3 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.7.2 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.7.1 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.7.0 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.6.9 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.6.8 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.6.7 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.6.6 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.6.5 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.6.4 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.6.3 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.6.2 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.6.1 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.6.0 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.5.17 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.5.16 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.5.15 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js
classiccms-0.5.14 lib/classiccms/public/js/ckeditor/_source/plugins/placeholder/dialogs/placeholder.js