CKEditor Plugin Image Selector
Version 5.1 by Manuel Leduc on 2022/08/26 11:36
Contents
Add a tab in the image selection step of the new CKEditor Image Dialog
Usage
The extension point adds a tab inside the image selection modal of the new CKEditor Image Dialog.

Definition
This Extension Point is contributed by this extension and was added in version 1.63 of that extension.
- Category
- Tab
- Extension Id
- org.xwiki.contrib.ckeditor.plugins.imageSelector
- Content to be provided
The minimal code to add to add in the extension point should look like this:
{velocity}} ## Provides the Javascript code to notify the image selector of the selected image. #set ($discard = $xwiki.jsx.use('Some.JXS.XObject')) ## TODO: add the html content of the selector {{/velocity}}Javascript
require(['imageSelector'], function (imageSelector) { // Notify the image selector that some images has been selected. Note that currently we only support a single image selection, so the array must be of size 1 (other items are ignored). // After this call, the button to the next step is enabled. imageSelector.updateSelectedImageReferences([...]); // Notify the image selector that no image is currently selected. // After this call, the button to the next step is disabled. imageSelector.updateSelectedImageReferences([]); });ImageSelector API
updateSelectedImageReferences
Takes an array of attachment references in parameter to be inserted in the document.
createLoader
Helper to display a loader to the user for a file selector field.
Example:
imageSelector.createLoader($("selector").prop('files')[0], { onSuccess: function (entityReference) {; new XWiki.widgets.Notification('Success Message', 'done'); }, onError: function () { new XWiki.widgets.Notification('Error message', 'error'); }, onAbort: function () { new XWiki.widgets.Notification('Abort message', 'error'); } });- Parameters to be provided
- priority: the order in which the tabs will be displayed. The lower the number is, the more on the left the item is. Examples of correct orders: 100, 200 Please let enough room to add other UIX between existing ones and your own. The UIX with the lowest priority is opened by default
- title: the title of the tab
- id: the identifier of the tab