github coderaiser/cloudcmd v5.11.0
cloudcmd v5.11.0

latest releases: v17.4.0, v17.3.3, v17.3.2...
7 years ago

Plugins

If you ever dreamed about having ability to expose functionality of Cloud Commander, now your dreams came true:
with help of plugins field in options you can specify client-side js files, that will be loaded strict after load of Cloud Commander.

app.use(cloudcmd({
    plugins: [
        __dirname + '/' + 'plugin.js'
    ]
}));

screen shot 2016-11-30 at 5 35 04 pm

On a client we going to embed RunKit.
Next code loads necessary files, viewer and puts RunKit to viewer.
Let's take a look at plugin.js.

'use strict';

const element = document.createElement('div');

exec.series([
    loadRunKit,
    notebook,
    CloudCmd.View,
    init,
]);

function loadRunKit(fn) {
    load.js('https://embed.runkit.com', fn);
}

function notebook(fn) {
    fn();
    RunKit.createNotebook({
        element,
        source: 'js source'
    });
}

function init() {
    CloudCmd.View.show(element, {
        autoSize: true
    });
}
}

For more information look at repository cloudcmd-plugin.

Changelog

feature

  • (cloudcmd) add plugins

Don't miss a new cloudcmd release

NewReleases is sending notifications on new releases.