<div class="intro">
<p>Creating and using custom ExecCommands.</p>
</div>

<div class="example">
    {{>editor-inline-exec-source}}
</div>

<h3>Working with InlineEditor</h3>
<p>`InlineEditor` is not a fully functional Editor, it is simply the base utility that will be used under the hood to create an Editor.</p>

<h3>Creating the Editor</h3>
<p>In this step we are going to do the initial render of the Editor, set its content, and focus it when it's ready.</p>

```
YUI().use('editor-inline', function(Y) {

    //Create the Inline Editor
    var editor = new Y.InlineEditor({
        content: '<p><b>This is <i class="foo">a test</i></b></p><p><b style="color: red; font-family: Comic Sans MS">This is <span class="foo">a test</span></b></p>',
        extracss: '.foo { font-weight: normal; color: black; background-color: yellow; }'
    });

    //Rendering the Editor.
    editor.render('#editor');

});
```

<h3>Registering a new execCommand</h3>

<p>ExecCommand overrides are stored on the `execCommand` plugin. This way, you can write a plugin for Editor and have it available
to all Editor instances in your sandbox.</p>

<p>To create a new execCommand, we simply add an object literal to the `Y.Plugin.ExecCommand.COMMANDS` static object like this:</p>

```
Y.mix(Y.Plugin.ExecCommand.COMMANDS, {
    foo: function(cmd, val) {
        logFn('You clicked on Foo');
        var container = this.get('host').get('container');
        container.setStyle('backgroundColor', 'yellow');
    }
});
```

<p>Now we can use this new command like:</p>

```
editor.execCommand('foo');
```


<h3>Full Example Source</h3>

<h4>HTML</h4>
```
{{>editor-inline-exec-source-html}}
```

<h4>CSS</h4>
```
{{>editor-inline-exec-source-css}}
```


<h4>Javascript</h4>
```
{{>editor-inline-exec-source-js}}
```
