Documentation

Addbar

  1. add

add #

Arguments
name String
button Object

Adds a button to the addbar.

ArticleEditor.add('plugin', 'myplugin', {
    start: function() {
        this.app.addbar.add('mybutton', {
            title: 'My Button',
            icon: '<i class="far fa-file-alt"></i>',
            command: 'myplugin.toggle'
        });
    },
    toggle: function(args) {
        // do something
    }
});

In this example, Font Awesome is used for the button icon. You can add your own HTML and SVG icon.

Now call the editor with the plugin created:

ArticleEditor('#entry', {
    plugins: ['myplugin'],
    css: '/your-article-dist-path/'
});

The button should appear in the addbar popup when you click on any block and when press the plus icon to show the addbar. The button click will call the plugin's toggle method.

See more about the parameters of the buttons.