JCE in CF5

kingb 25 May, 2014
I've found the code for displaying the wysiwyg editor in CF5 /administrator/com_chronoforms5/chronoforms/actions/html/html.php

$doc->addJsCode('jQuery(document).ready(function($){ $(\'*[data-wysiwyg="1"]\').each(function(){ tinymce.init({"selector":"#"+$(this).attr("id")}); }); });');


Seems that tinymce is hardcoded in there. How do I change this so that JCE and/or any default editor is used?

Thanks in advance!
-kb
kingb 26 May, 2014
Hi Folks

FWIW - I was able to modify the code above to get a "better" version of MCE working.

Here's my code:
			$doc->addJsCode('jQuery(document).ready(function($){ $(\'*[data-wysiwyg="1"]\').each(function(){ 
				// tinymce.init({"selector":"#"+$(this).attr("id")}); 
				tinymce.init({
					// General
					directionality: "ltr",
					language : "en",
					mode : "specific_textareas",
					autosave_restore_when_empty: false,
					skin : "lightgray",
					theme : "modern",
					schema: "html5",
					selector: "#"+$(this).attr("id"),
					// Cleanup/Output
					inline_styles : true,
					gecko_spellcheck : true,
					entity_encoding : "raw",
					extended_valid_elements : "iframe",
					force_br_newlines : false, force_p_newlines : true, forced_root_block : "p",
					toolbar_items_size: "small",
					invalid_elements : "script,applet,iframe",
					// Plugins
					plugins : "autolink,lists,image,charmap,print,preview,anchor,pagebreak,code,save,textcolor,importcss,searchreplace,insertdatetime,link,fullscreen,table,emoticons,media,hr,directionality,paste,visualchars,visualblocks,nonbreaking,template,print,wordcount,advlist,autosave,contextmenu",
					// Toolbar
					toolbar1: "undo redo | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent blockquote | styleselect",
					toolbar2: "table | subscript superscript | charmap hr | link unlink anchor image media | visualchars visualblocks code | template ",
					removed_menuitems: "newdocument",
					// URL
					relative_urls : true,
					remove_script_host : false,
					document_base_url : "http://cms.aurorastudios.tv/",
					rel_list : [
						{title: "Alternate", value: "alternate"},
						{title: "Author", value: "author"},
						{title: "Bookmark", value: "bookmark"},
						{title: "Help", value: "help"},
						{title: "License", value: "license"},
						{title: "Lightbox", value: "lightbox"},
						{title: "Next", value: "next"},
						{title: "No Follow", value: "nofollow"},
						{title: "No Referrer", value: "noreferrer"},
						{title: "Prefetch", value: "prefetch"},
						{title: "Prev", value: "prev"},
						{title: "Search", value: "search"},
						{title: "Tag", value: "tag"}
					],
					//Templates
					templates: [
					{title: "Layout", description: "HTMLLayout", url:"http://cms.aurorastudios.tv/media/editors/tinymce/templates/layout1.html"},
					{title: "Simple snippet", description: "Simple HTML snippet", url:"http://cms.aurorastudios.tv/media/editors/tinymce/templates/snippet1.html"}
				],
					// Layout
					content_css : "http://cms.aurorastudios.tv/templates/system/css/editor.css",
					importcss_append: true,
					// Advanced Options
					resize: "both",
					image_advtab: true,
					height : "150",
					width : "650",

				});
				}); 
				});
			');


Note - this is just my own layout. You can add/remove items as you like. A good method for seeing what's available is to config TinyMCE as your default editor, go into the plugin settings and turn on/off what you like. The open a page a look for "tinyMCE.init" in your source. Copy that code into the place above and make sure to make "tinyMCE" lowercase, and change the "selector" line to match above.
This topic is locked and no more replies can be posted.