From 44b63a4dee46377f1657c94680ea82fb2545067e Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 27 Feb 2018 13:26:21 +0100 Subject: [PATCH] comments --- src/pluginManager.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/pluginManager.js b/src/pluginManager.js index 9efd34362a..fd263b31d6 100644 --- a/src/pluginManager.js +++ b/src/pluginManager.js @@ -7,12 +7,35 @@ * - compilationData (that is triggered just after a focus - and send the current compilation data or null) * - compilationFinished (that is only sent to the plugin that has focus) * - * @param {String} txHash - hash of the transaction + * Plugin can emit messages and receive response. + * + * CONFIG: + * - getConfig(filename). The data to send should be formatted like: + * { + * type: 'getConfig', + * arguments: ['filename.ext'], + * id: + * } + * the plugin will reveice a response like: + * { + * type: 'getConfig', + * id: + * error, + * result + * } + * same apply for the other call + * - setConfig(filename, content) + * - removeConfig + * + * See index.html and remix.js in test-browser folder for sample + * */ class PluginManager { constructor (api, events) { + var self = this this.plugins = {} this.inFocus + var allowedapi = {'setConfig': 1, 'getConfig': 1, 'removeConfig': 1} events.compiler.register('compilationFinished', (success, data, source) => { if (this.inFocus) { // trigger to the current focus