Warning Tool for CodeX.Editor
npm install codex.editor.warning
Provides Warning Block for the CodeX Editor. Block has title and message. It can be used, for example, for editorials notifications or appeals.

Get the package
``shell`
npm i --save-dev codex.editor.warning
Include module at your application
`javascript`
const Warning = require('codex.editor.warning');
1. Upload folder dist from repositorydist/bundle.js
2. Add file to your page.
You can load specific version of package from jsDelivr CDN.
https://cdn.jsdelivr.net/npm/codex.editor.warning@2.0.0
Then require this script on page with CodeX Editor.
`html`
Add a new Tool to the tools property of the CodeX Editor initial config.
`javascript`
var editor = CodexEditor({
...
tools: {
...
warning: Warning,
},
...
});
Or init Warning Tool with additional settings
`javascript`
var editor = CodexEditor({
...
tools: {
...
warning: {
class: Warning,
inlineToolbar: true,
shortcut: 'CMD+SHIFT+W',
config: {
titlePlaceholder: 'Title',
messagePlaceholder: 'Message',
},
},
},
...
});
| Field | Type | Description |
| ------------------ | -------- | ----------------------------------|
| titlePlaceholder | string | Warning Tool's title placeholder |string
| messagePlaceholder | | Warning Tool's message placeholder|
| Field | Type | Description |
| --------- | -------- | -----------------|
| title | string | warning's title |string
| message | | warning's message|
`json``
{
"type" : "warning",
"data" : {
"title" : "Note:",
"message" : "Avoid using this method just for lulz. It can be very dangerous opposite your daily fun stuff."
}
}