]> git.immae.eu Git - perso/Immae/Projets/packagist/piedsjaloux-ckeditor-component.git/blobdiff - sources/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js
Add oembed
[perso/Immae/Projets/packagist/piedsjaloux-ckeditor-component.git] / sources / plugins / widget / dev / assets / simplebox / dialogs / simplebox.js
diff --git a/sources/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js b/sources/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js
new file mode 100644 (file)
index 0000000..45a150c
--- /dev/null
@@ -0,0 +1,51 @@
+// 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