Dear XWiki folks,
To introducte myself: being a big fan of wiki’s, I was using Confluence privately for notes, as in the past I’ve done a professional projects to tune it to clients needs and my employer uses it as well.
What has drawn me to XWiki is that their company recently announced to adjust their pricing to exhorbitant heights and as a result I decided to see if XWiki is the equaly amazing wiki I got as a first impression.
Having installed it I feel there’s quite some things better then Confluence: the advanced and simple user modes is absolutely amazing, design wise the breakcrumbs and the design looks more smooth, the way the page scales is better and the inline editing functionality is a great plus.
Getting used to XWiki however, I did sincerely miss one piece of functionality that will hopefully be added at some point in the future: on the image baloon toolbar I can’t find buttons to resize images to Small, Medium, Large or Original size with one click. Currently resizing is always at least three clicks away: (1) a dialog needs to be opened (2) you need to choose a size (3) then you need to confirm. I used the one-click functionality a lot and find it hard to live without.
Working my way around the absense of default image-size buttons, I found it very hard to determine image sizes, as XWiki doesn’t always show the original image size in the dialog window I have no reference values. For this I spend a day to write a piece of code myself that adds these regardless:
require(['deferred!ckeditor'], function(ckeditorPromise) {
ckeditorPromise.done(function(ckeditor) {
ckeditor.on('instanceCreated', function(event) {
// The editor instance was created but it not yet initialized. Unfortunately the configuration object passed when
// the instance was created has not been merged with the global configuration yet.
event.editor.once('configLoaded', function(event) {
// The editor configuration has been loaded (the instance configuration has been merged with the global
// configuration) but the editor has not been fully initialized yet so we can modify the configuration.
event.editor.on('dialogShow', function(e) {
var dialogName = e.data.getName();
var dialogData = e.data;
if (dialogName == 'image2') {
var dialogModel = e.data.getModel();
//If no width and height is shown, enter it:
if ((e.data.getContentElement('info', 'width').getValue() == "") && (e.data.getContentElement('info', 'height').getValue() == "")) {
//Set the height and width, it will get adjusted by the plugin:
dialogData.getContentElement('info', 'width').setValue(dialogModel.element.$.width)
dialogData.getContentElement('info', 'height').setValue(dialogModel.element.$.height)
}
}
});
});
});
});
});
For attaching this to XWiki, I used the method of attaching this as a JavaScriptObject, that the fix for external links not opening in an external window also uses, e.g.:
As you’re aiming at an easy XWiki UI by default, perhaps the addition could be considered as an contribution to the XWiki project, if you also agree it’s more userfriendly ?
PS: I didn’t try to change the image balloon toolbar, as this was too challenging, though if I’m going to move forward with this later, which option is preferred to contribute such code to XWiki ?