ckeditor image plugin fine configuration - ckeditor

It is possible to configure image plugin dialog to change defaults (for example, change alignment from to right, HSpace to some value, etc) without actually changing javascript code of the plugin?
The cmbAlign select is in the image.js and seems to be in some long and nested object structure, specifying UI.
What is the right place to introduce the change?

You should take a look at the CKEditor Javascript API which allows you to modify the editor without having to change the original javascript code, see
http://docs.cksource.com/ckeditor_api/index.html

Related

How to use url image inserting dialog instead of upload in CKEditor 5 Classic

I want to use CKEditor 5, insert image with URL dialog, instead of its default file upload dialog. how to do this in CKEditor 5 Classic?
There is, as far as I know, no such feature officially provided.
There is, however, a tutorial provided in the documentation on how to write such a feature: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/creating-simple-plugin.html
There is also a separate project on github for the same purpose, which appears to be a bit more stylish: https://github.com/khanhna/ckeditor5-image-via-url
Both approaches require to configure a modified build, and both appear to lack an important component: a button in the image's toolbar to edit that URL later on.
So, a more simple approach that does achieve practically the same is to just drag the images into the editor from some browser window.

Work in 'source mode' but enable toolbar buttons

I am building a simple forum on my website using CKEditor as a BBCode editor. I managed to make CKEditor output BBCode just fine by following the example.
However, I do not want to use the 'WYSIWYG' interface. I just want a plain "bbcode source" editor. The WYSIWYG output is not exactly the same as how the output will look on my forum (because I translate the bbcode to html myself and then apply some additional styling) and I don't really like the difference. More importantly, I have a couple "custom bbcode" tags that make no sense outside of my forum and obviously CKEditor doesn't know what to do with them, so I get a mix of bbcode and WYSIWYG output which looks odd.
I can force the CKEditor into 'source mode' by setting the startupMode and removing the source button, but when I do that it disables the entire toolbar!
I want to work in source mode, but still use the various buttons like B, I, etc. When such a button is pressed I just want it to insert the [b] [/b] tags for example around the selected text.
This is pretty much how every forum I've ever seen works, but I can't figure out how to configure CKEditor to do this.
Unfortunately it's impossible. Most of the plugins require WYSIWYG mode and don't work without it.
However you could try to control the output of the editor and change it according to your needs by adjusting editor's filter or implementing custom data processor.

CKEditor use forcePasteAsPlainText unless copied from CKEditor

I'm using CKEditor and am setting
config.forcePasteAsPlainText = true;
so I don't get any goofy formatting coming in from the outside. However, I would like to be able to copy and paste from the same (or other) CKEditor instances and retain the formatting. How do I go about doing that? I didn't see any settings like that. Is it possible?
Thanks for any help, I really appreciate it.
#Smamatti is right. That would not be possible to determine the origin of the content. However, if you have the Advanced Content Filter configured correctly (e.g. left to defaults), then CKEditor will limit data pasted from all sources to the features which are enabled in its configuration.

fine-uploader multi-file upload example pure javascript

On the project page, it states that multi-file uploads are possible with fine-uploader.
What parameter needs to be set to make this possible?
Is there an example with progress bars?
Nothing needs to be set to make this possible. By default, Fine Uploader supports the multiple attribute on file input elements. You should be able to select multiple files without setting any related options.
Note that IE9 and older do not support multiple file selection, nor does Android.

CKEditor plugin rendering different in WYSIWYG and source mode

I'm starting to develop a plugin for CKEditor that needs to be used to insert some HTML snippets in a web page. This is done. Nonetheless I also need to include some special items when switching to WYSIWYG mode (e.g. something more or less similar to Show Blocks plugin, but not just using styles since I need some elements included in there). So my question is :
How could I include extra items or styles (e.g. to hide parts of the contents in WYSIWYG mode) in WYSIWYG view without altering HTML output ?
If someone could provide some information about a working (maybe simple) example, I'd also appreciate your help.
PS: If you need to know further details please ask, but for instance assume inserted raw HTML code is
<div class="xxx">Hello world !</div>
... but in WYSIWYG mode need to display a link on top of it that pops up an alert and toggles dotted border.
About injecting CSS classes in WYSIWYG mode, use addCss function.
About creating fake elements in WYSIWYG mode ... I think I can solve the problem using context menu instead.

Resources