TinyMCE wrapper kind

Hello,

I would like to share with you a wrapper kind that adds tinymce editor into your application.

tinymce version: 4.1.9
enyojs version: 2.3.0-pre.12

The wrapper kind


/**
* TinyMCE wrapper kind
*/
enyo.kind({
name: "the_textarea",
allowHtml: true,
classes: "textarea-container",

components: [{
name:'mytext',
tag:'textarea'
}],

mcecontent: false,
mced: false,

rendered: function()
{
this.inherited( arguments );
if( typeof tinymce != "undefined" )
{
if( this.mced )
{
this.mcecontent = this.mced.getContent({format: 'raw'});
}
this.mced = new tinymce.Editor( this.$.mytext.id, {
plugins: "table,image",
image_advtab: true
}, tinymce.EditorManager);
this.mced.render();
if( this.mcecontent )
{
this.mced.setContent(this.mcecontent,{format: 'raw'});
}
}
}
});

Setup

place the tinymce package into your project and include the

enyo.depends(
"tinymce.min.js"
);

Comments

  • Very nice! Sorry this fell through the cracks before. I'm sure someone will find this useful. Have you looked at proxying some of the mce commands/properties to your wrapper?
Sign In or Register to comment.