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

    (new Y.Console().render( "#console" ));

    Y.log('Interact with the Editor.');

    var logFn = function(e) {
        var tag = e.frameTarget.get('tagName').toLowerCase();
        Y.log('Event: ' + e.type + ' on element (' + tag + ')');
    };

    //Create the Base 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; }'
    });

    //Attaching a simple event to all DOM events
    Y.each(Y.Frame.DOM_EVENTS, function(v, k) {
        editor.on('dom:' + k, logFn);
    });

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

