:: libs :: js-as-form :: as-form-tinymce

Library index

Plugin: “as-form-tinymce”

This AS.form plugin is a wrap to TinyMCE.

Developed and maintained by balestra

Licensed under Creative Commons Attribution 4.0 License for free personal/professional/commercial use, with attribution.

Includes TinyMCE.

Version 1.1, released on 2021-05-05

Provides

Fields of type:

The double class name is intentional: other plugins, loaded before or after this one, could re-define field type html.

Load plugin

Plugin URI: https://cdn.altersoftware.org/js-as-form/plugin/as-form-tinymce.js

Plugin name: tinymce

tinymce

asForm.addField( fieldname, 'tinymce', {options…} )

In alternative: asForm.addField(fieldname,'html', {options…} )

Generates a text field with HTML content, and its own WYSIWYG editor.

Common option keys can be used, in addition:

Events

When an Editor is fully loaded a custom event as:tinyMceInited is fired on the document node.

event.detail is a reference to the actual asField object.

The event can be used e.g. to rezize the editor:

AS.addEvent(document,'as:tinyMceInited',e=>{
    let h = parseInt(window.innerHeight) - 200;
    h = String( h > 600 ? 600 : h )+'px';
    e.detail.getWrap().querySelector('.tox-tinymce').style.height=h;
});

Version history