From b982e34d9627f7ca838f068c5c36fce366ff7e4f Mon Sep 17 00:00:00 2001 From: Murod Khaydarov Date: Sat, 25 Nov 2017 18:46:27 +0300 Subject: [PATCH] Update description --- src/codex.js | 11 ++++--- src/components/core.js | 2 +- .../{ => modules}/eventDispatcher.js | 30 +++++++++++++++++++ 3 files changed, 38 insertions(+), 5 deletions(-) rename src/components/{ => modules}/eventDispatcher.js (69%) diff --git a/src/codex.js b/src/codex.js index b6f30a07..20fbee63 100644 --- a/src/codex.js +++ b/src/codex.js @@ -26,11 +26,14 @@ * } * }); * - * - tools constist of object with key that is type/name of class constructor + * - tools is an object: { + * pluginName: PluginClass, + * ..... + * } * - toolsConfig is an additional configuration that uses Codex Editor API - * iconClassname - the name of icon class. Icon will be shown in toolbox + * iconClassname - CSS classname of toobox icon * displayInToolbox - if you want to see your Tool in toolbox hided in "plus" button, than set "True". By default : "False" - * enableLineBreaks - by default enter pastes new block that set as initialblock, but if you set this property "True", you break the lines + * enableLineBreaks - by default enter creates new block that set as initialblock, but if you set this property "True", enter will break the lines in current block * * @author CodeX-Team * @@ -115,7 +118,7 @@ module.exports = class CodexEditor { /** * Setting for configuration - * @param {object} config + * @param {Object} config */ set configuration(config = {}) { diff --git a/src/components/core.js b/src/components/core.js index ef7bba4b..34860653 100644 --- a/src/components/core.js +++ b/src/components/core.js @@ -2,7 +2,7 @@ * Codex Editor Core * * @author Codex Team - * @version 1.1.3 + * @version 2.0.0 */ module.exports = class Core { diff --git a/src/components/eventDispatcher.js b/src/components/modules/eventDispatcher.js similarity index 69% rename from src/components/eventDispatcher.js rename to src/components/modules/eventDispatcher.js index 8d382d2c..d73454f7 100644 --- a/src/components/eventDispatcher.js +++ b/src/components/modules/eventDispatcher.js @@ -5,9 +5,29 @@ * - {Function} on - appends subscriber to the event. If event doesn't exist - creates new one * - {Function} emit - fires all subscribers with data * + * @version 1.0.0 */ module.exports = class Events { + /** + * Module key name + * @returns {string} + */ + static get name() { + return 'Events'; + } + + /** + * @param Editor + * @param Editor.modules {@link CodexEditor#moduleInstances} + * @param Editor.config {@link CodexEditor#configuration} + */ + set state(Editor) { + + this.Editor = Editor; + + } + /** * @constructor * @@ -16,6 +36,7 @@ module.exports = class Events { constructor() { this.subscribers = {}; + this.Editor = null; } @@ -52,4 +73,13 @@ module.exports = class Events { } + /** + * Destroyer + */ + destroy() { + + this.Editor = null; + this.subscribers = null; + } + };