+++ /dev/null
-/*\r
- * Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
- * For licensing, see LICENSE.html or http://ckeditor.com/license\r
- */\r
-\r
-(function()\r
-{\r
- function placeholderDialog( editor, isEdit )\r
- {\r
-\r
- var lang = editor.lang.placeholder,\r
- generalLabel = editor.lang.common.generalTab;\r
- return {\r
- title : lang.title,\r
- minWidth : 300,\r
- minHeight : 80,\r
- contents :\r
- [\r
- {\r
- id : 'info',\r
- label : generalLabel,\r
- title : generalLabel,\r
- elements :\r
- [\r
- {\r
- id : 'text',\r
- type : 'text',\r
- style : 'width: 100%;',\r
- label : lang.text,\r
- 'default' : '',\r
- required : true,\r
- validate : CKEDITOR.dialog.validate.notEmpty( lang.textMissing ),\r
- setup : function( element )\r
- {\r
- if ( isEdit )\r
- this.setValue( element.getText().slice( 2, -2 ) );\r
- },\r
- commit : function( element )\r
- {\r
- var text = '[[' + this.getValue() + ']]';\r
- // The placeholder must be recreated.\r
- CKEDITOR.plugins.placeholder.createPlaceholder( editor, element, text );\r
- }\r
- }\r
- ]\r
- }\r
- ],\r
- onShow : function()\r
- {\r
- if ( isEdit )\r
- this._element = CKEDITOR.plugins.placeholder.getSelectedPlaceHoder( editor );\r
-\r
- this.setupContent( this._element );\r
- },\r
- onOk : function()\r
- {\r
- this.commitContent( this._element );\r
- delete this._element;\r
- }\r
- };\r
- }\r
-\r
- CKEDITOR.dialog.add( 'createplaceholder', function( editor )\r
- {\r
- return placeholderDialog( editor );\r
- });\r
- CKEDITOR.dialog.add( 'editplaceholder', function( editor )\r
- {\r
- return placeholderDialog( editor, 1 );\r
- });\r
-} )();\r