I just installed Drupal-5.0 and also the latest applicabe versions of FCKeditor and Tinymce. For both editors I get all the icons for editing in rich text mode and am able to edit and save in this mode.

However, I do not get the toggle to disable/enable rich text. I have successfully used Tinymce in Drupal-4.7, and it worked ok for me.

- Some posts have mentioned similar problems like http://drupal.org/node/102741 but this was basically un-resolved in the replies.
- I also tried looking in the config files for FCKeditor and Tinymce but nothing was mentioned about the toggle.
- In the config pages for both these editors in drupal, there are no settings for the toggle, for example, I do not get the tinymce 'default state' I have in drupal-4.7+tinymce.

Thanks for any help,

Abe

Comments

coreyp_1’s picture

tinymce in 5.x is an ongoing saga.

This version (not official, but it solves the problem until the official code catches up) should do the trick for you.

- Corey

abe’s picture

I will try this out. I realize that the version I downloaded was -dev, so I guess lots of wrinkles need to be ironed out.

abe’s picture

Thanks. the toggle is appearing on the page, and tinymce is working :>)

vm’s picture

Tinymce for 5.0 no longer has this feature, Therefore your installation is not broken. Whether it will be returned, I can't say. Best advice i can give is to check the tinymce issues pages, and see if theres been a pacthed released to add this back or if the developer even has intentions of bringing it back.

fckEditor didnt have this ability. I put a feature request in for it awhile back and the developer stated it would be considered. I venture a guess that now that Drupal is using the JQuery javascript library that things using javascript had to be revisited to insure they do not conflict.

abe’s picture

thanks also for your patience in the other tinymce post http://drupal.org/tracker/69811.

steingold’s picture

I had your same issue, the enable disable button is really useful. By the way i solved this problem changing the profile js, including some js to add the button. If you are interested i can give you some more info.

Bye,
luigi.

abe’s picture

I applied the patch and it also worked. But it would be useful to know your fix.

Thanks,

Abe

steingold’s picture

Overwrite the original tinymce_full.js profile with this one

function mceToggle(){
    var areaId = 'edit-' + ($(this).attr('id').split('-'))[1];
    var element = document.getElementById(areaId);
    if (tinyMCE.getEditorId(areaId) == null){
	tinyMCE.addMCEControl(element, element.id);
	$(this).toggle();
	$(this).html("Disable TinyMCE-Editor", true);
	$(this).toggle();
        $(this).blur();
    }else{
	tinyMCE.removeMCEControl(tinyMCE.getEditorId(element.id));
	$(this).toggle();
	$(this).html("Enable TinyMCE-Editor");
	$(this).toggle();
	$(this).blur();
    }
}

function createMceShowAnchor(){
	$("textarea[@id='edit-comment']").each(
	    function(i){
		$(this).after("<a href=\"javascript:void(0)\" id=\"tinyMCE-comment\">Enable TinyMCE-Editor</a>");
	    }
	);
	
	$("textarea[@id='edit-body']").each(
	    function(i){
		anchor = $("<a href=\"javascript:void(0)\" id=\"tinyMCE-body\"></a>");
		$(anchor).html("Enable TinyMCE-Editor");
		$(this).after(anchor);
		anchor.click(mceToggle);
	    }
	);
}

if (Drupal.jsEnabled){
    $(createMceShowAnchor);
}


tinyMCE.init({
  mode : "none",
  theme : "advanced",
  elements : "edit-body",
  relative_urls : false,
  plugins : "style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras",
  theme_advanced_buttons1_add_before : "save,newdocument,separator",
  theme_advanced_buttons1_add : "fontselect,fontsizeselect",
  theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor,advsearchreplace",
  theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
  theme_advanced_buttons3_add_before : "tablecontrols,separator",
  theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
  theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,|,visualchars,nonbreaking",
  theme_advanced_toolbar_location : "top",
  theme_advanced_toolbar_align : "left",
  theme_advanced_path_location : "bottom",
  content_css : "example_full.css",
  plugin_insertdate_dateFormat : "%Y-%m-%d",
  plugin_insertdate_timeFormat : "%H:%M:%S",
  extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
  file_browser_callback : "fileBrowserCallBack",
  theme_advanced_resize_horizontal : false,
  theme_advanced_resizing : true,
  nonbreaking_force_tab : true,
  apply_source_formatting : true,
  debug : false
});
hansfn’s picture

Just for the record - the code above will not work if you are using TinyMCE 3.0. (See patch below.)

I'm happily using "tinymce 5.x-1.9", not the dev version, with a toggle link after applying my patch in this post:
http://drupal.org/node/215580#comment-719204

Happy Drupaling!

pjo’s picture

I use drupal 5.7 and TinyMCE 2.13 -
changed tinyMCE.get to tinyMCE.getEditorId in tinymce.module and that fixed it

thecarlhall’s picture

I've fixed this for Drupal 6 for TinyMCE 2 and TinyMCE 3. Patches available here [http://drupal.org/node/244066].