Skip to content

Creates a TinyMCE 4 widget in Dojo 1.10 in which each instance can have a unique configuration

License

Notifications You must be signed in to change notification settings

caitlineatman/tinymce-dojo-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

tinymce-dojo-widget

Creates a TinyMCE 4 widget in Dojo 1.10 in which each instance can have a unique configuration

How to Use

In your Dojo config packages list, add the folder that the widget is in. We named ours 'dojo-widgets.'

<script type="text/javascript">
	dojoConfig = {
		async: true,
		baseUrl: '../path/to/dojo-src',
		packages: [
			'dojo',
			'dijit',
			'dojox',
			{name: 'dojo-widgets', location: '../dojo-widgets'}
		]
	};
</script>

Then add the widget as a new module in the require like so:

<script type="text/javascript">
require([
	'dojo-widgets/tinyMCE',
	],
	function(tinyMCE){

In your HTML body, create a div with a textarea nested within it to serve as the placeholder for your TinyMCE box.

<div id="tinymceBox">
  <textarea id="tinymceTextarea"></textarea>
</div>

To add the widget programmatically:

newTinyMCE = var tinymce({
  selector: "#tinymceTextarea"
},"tinymceBox");

If you want to configure TinyMCE to, say, be inline, you don't have to alter this tinyMCE.js file. Simply add it to the widget instance like so. You can also override the defaults in the same way.

newTinyMCE = var tinymce({
  selector: "#tinymceTextarea",
  inline: true
},"tinymceBox");

About

Creates a TinyMCE 4 widget in Dojo 1.10 in which each instance can have a unique configuration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published