diff --git a/docs/api.md b/docs/api.md index 35ac0f32..4c8b4bee 100644 --- a/docs/api.md +++ b/docs/api.md @@ -18,9 +18,9 @@ export interface IAPI { #### IBlocksAPI -```moveDown()``` - method moves down the working block. +```moveDown()``` - method moves down the current block. -```moveUp()``` - method moves up the working block. +```moveUp()``` - method moves up the current block. #### ISanitizerAPI diff --git a/docs/toolbar-settings.md b/docs/toolbar-settings.md index ff2ce3c3..c313b60b 100644 --- a/docs/toolbar-settings.md +++ b/docs/toolbar-settings.md @@ -1,4 +1,4 @@ -# CodeX Editor Toolbar Settings Module +# CodeX Editor Toolbar Block Settings Module Toolbar Module has space for Block settings. Settings divided into: - space for plugin's settings, that is described by «Plugin»'s Developer @@ -33,7 +33,7 @@ Your Tune's constructor gets argument as object and it includes: - {Object} settings - settings contains block default state. This object could have information about cover, anchor and so on. -Example: +Example on TypeScript: ```js @@ -62,3 +62,30 @@ export default class YourCustomTune implements IBlockTune { } } ``` + +Example on ES6 + +```js +export default class YourCustomTune { + + constructor({api, settings}) { + this.api = api; + this.settings = settings; + } + + render() { + let someHTML = '...'; + return someHTML; + } + + save() { + // Return the important data that needs to be saved + return object + } + + someMethod() { + // moves current block down + this.api.blocks.moveDown(); + } +} +```