From 317f8f8f0651488f226b5280a8f036c7c135c639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 4 Dec 2017 17:54:04 +0100 Subject: Add oembed --- .../dev/assets/simplebox/dialogs/simplebox.js | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 sources/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js (limited to '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 index 0000000..45a150c --- /dev/null +++ b/sources/plugins/widget/dev/assets/simplebox/dialogs/simplebox.js @@ -0,0 +1,51 @@ +// Note: This automatic widget to dialog window binding (the fact that every field is set up from the widget +// and is committed to the widget) is only possible when the dialog is opened by the Widgets System +// (i.e. the widgetDef.dialog property is set). +// When you are opening the dialog window by yourself, you need to take care of this by yourself too. + +CKEDITOR.dialog.add( 'simplebox', function( editor ) { + return { + title: 'Edit Simple Box', + minWidth: 200, + minHeight: 100, + contents: [ + { + id: 'info', + elements: [ + { + id: 'align', + type: 'select', + label: 'Align', + items: [ + [ editor.lang.common.notSet, '' ], + [ editor.lang.common.alignLeft, 'left' ], + [ editor.lang.common.alignRight, 'right' ], + [ editor.lang.common.alignCenter, 'center' ] + ], + // When setting up this field, set its value to the "align" value from widget data. + // Note: Align values used in the widget need to be the same as those defined in the "items" array above. + setup: function( widget ) { + this.setValue( widget.data.align ); + }, + // When committing (saving) this field, set its value to the widget data. + commit: function( widget ) { + widget.setData( 'align', this.getValue() ); + } + }, + { + id: 'width', + type: 'text', + label: 'Width', + width: '50px', + setup: function( widget ) { + this.setValue( widget.data.width ); + }, + commit: function( widget ) { + widget.setData( 'width', this.getValue() ); + } + } + ] + } + ] + }; +} ); -- cgit v1.2.3