Plugins
We provide many built-in plugins, most of which are easy to use. Below are a few special plugins.
You can set the config
of a plugin to change some values. Take a look at the about plugin.
Configure
All plugins have some toolbar conf, like:
- addToNormalToolbar: add the button(s) and / or select(s) to normal toolbar
- addToNormalToolbarInsertMenu: add the button(s) and / or select(s) to normal toolbar’s insert menu
- addToBubbleToolbar: add the button(s) and / or select(s) to bubble toolbar
If the plugin only has one button or select, these three field is boolean type, otherwise they are object type.
For example, in plugin image, it likes:
and in plugin lists, it likes:
Plugin about
The about plugin is automatically loaded by default. There is no need to add it to the plugins
parameter of the existing.init
function.
If you have the authorization and want disable the about plugin:
If you have customized any functions, you should add your own information to about.conf.deveploers
.
Plugin redoAndUndo
You can provied two callback in redoAndUndo.conf
to compress and uncompress the content:
- compressCb: (str: string) => any
- uncompressCb: (value: any) => string
Plugin link
You can provied a callback in redoAndUndo.conf
:
- clickLinkCb: handle click event of tag
a
Plugin sourceCode
It will process the <pre><code>
tags.
Due to the fact that exsied does not have any dependencies, so it cannot highlight or edit code, developers should overwrite the functions in sourceCode.conf
:
- renderDataCb: Used to highlight code, highlight.js is recommended
- editDataCb: Used to edit code, codemirror is recommended. After editing, use const ele = document.querySelector(
[${DATA_ATTR.sign}="${sign}"]
) to find the original code element, and update it. - randomCharsCb: Used to generate random chars.
- aferInitSourceCodeViewCb: call it afer init source code view, you can add highlight functions here.
- inputInSourceCodeViewCb: call it when user input in source code view, you can add highlight functions here.