@Override
public void ready(final YuiContext Y) {
final Console console1 = Y.newConsole(ConsoleConfig.create().width("50%"));
console1.render();
EditorBase editor = Y.newEditorBase(EditorBaseConfig.create().
content("<strong class=\"foo\">This is <em>a test</em></strong>. Please edit me. <strong>This is <em>a test</em></strong>")
);
//Add the BiDi plugin
editor.plug(Y.Plugin().EditorBidi());
editor.on(EditorBase.EVENT_NODECHANGE, new EventCallback<EditorBaseEvent>() {
@Override
public void call(EditorBaseEvent e) {
console1.log("node changed: "+e.changedType());
}
});
editor.on("dom:keydown", new EventCallback<EditorBaseEvent>() {
@Override
public void call(EditorBaseEvent e) {
console1.log("dom:keydown: target: "+e.frameTarget().get("id")+
" - keycode: "+e.frameEvent().keyCode());
}
});
editor.render(parent);
}
});
}