--- /dev/null
+// Note: This automatic widget to dialog window binding (the fact that every field is set up from the widget\r
+// and is committed to the widget) is only possible when the dialog is opened by the Widgets System\r
+// (i.e. the widgetDef.dialog property is set).\r
+// When you are opening the dialog window by yourself, you need to take care of this by yourself too.\r
+\r
+CKEDITOR.dialog.add( 'simplebox', function( editor ) {\r
+ return {\r
+ title: 'Edit Simple Box',\r
+ minWidth: 200,\r
+ minHeight: 100,\r
+ contents: [\r
+ {\r
+ id: 'info',\r
+ elements: [\r
+ {\r
+ id: 'align',\r
+ type: 'select',\r
+ label: 'Align',\r
+ items: [\r
+ [ editor.lang.common.notSet, '' ],\r
+ [ editor.lang.common.alignLeft, 'left' ],\r
+ [ editor.lang.common.alignRight, 'right' ],\r
+ [ editor.lang.common.alignCenter, 'center' ]\r
+ ],\r
+ // When setting up this field, set its value to the "align" value from widget data.\r
+ // Note: Align values used in the widget need to be the same as those defined in the "items" array above.\r
+ setup: function( widget ) {\r
+ this.setValue( widget.data.align );\r
+ },\r
+ // When committing (saving) this field, set its value to the widget data.\r
+ commit: function( widget ) {\r
+ widget.setData( 'align', this.getValue() );\r
+ }\r
+ },\r
+ {\r
+ id: 'width',\r
+ type: 'text',\r
+ label: 'Width',\r
+ width: '50px',\r
+ setup: function( widget ) {\r
+ this.setValue( widget.data.width );\r
+ },\r
+ commit: function( widget ) {\r
+ widget.setData( 'width', this.getValue() );\r
+ }\r
+ }\r
+ ]\r
+ }\r
+ ]\r
+ };\r
+} );\r