The "enable/disable rich text" is unavailable. I've attached a patch that corrects this (1 patch for tinymce 2.x and 1 patch for tinymce 3.x). The code has been adjusted to work with TinyMCE 3.0.
Explanation of what I did to get this to work.
- Add Enable/Disable
-- Add code to include $wysiwyg_link as a suffix to the processed element ($element['#suffix'] .= $wysiwyg_link)
- Adjust to TinyMCE 3.0
-- Change tinyMCE.getEditorId() to tinyMCE.get()
-- Change tinyMCE.addMCEControl(element, element.id) to tinyMCE.execCommand('mceAddControl',false,element.id);
-- Change tinyMCE.removeMCEControl(tinyMCE.getEditorId(element.id)); to tinyMCE.execCommand('mceRemoveControl',false,element.id);
Comment | File | Size | Author |
---|---|---|---|
#44 | tinymce_5.x_244066.patch | 541 bytes | christefano |
#44 | tinymce_6.x_244066.patch | 576 bytes | christefano |
#39 | ToggleTinyMCE.patch | 3.14 KB | spiffyd |
#24 | tinymce_richtext_toggle_1.patch | 3.93 KB | Murz |
#24 | tinymce-6.x-1.1-dev_width_toggle_and_codeprotect.tar_.gz | 565.8 KB | Murz |
Comments
Comment #1
thecarlhall CreditAttribution: thecarlhall commentedComment #2
yhager CreditAttribution: yhager commentedI can confirm the patch for tinyMCE 3.x works fine.
I am not sure this is related:
I select 'disabled' as tinyMCE default state in my user settings page. TinyMCE default state is still enabled when I try to edit a page, but the text below says 'Enable rich text editor'. When I click it, tinyMCE is disabled..
Comment #3
Bundus CreditAttribution: Bundus commentedI applied the patch but it doesn't take into account the default status. My profile has the box set to disabled by default but when I go to create content the editor appears but the link reads "enable rich-text". If I click on the "enable rich-text" the editor vanishes but the link remains the same (basically getting back in sync).
Comment #4
thecarlhall CreditAttribution: thecarlhall commentedI'll work on getting the patches updated to use the default state setting correctly.
Comment #5
asak CreditAttribution: asak commentedsub. (coming from here)
Comment #6
keva CreditAttribution: keva commentedsubscribing
Comment #7
esolano CreditAttribution: esolano commentedHi all. There seems to be a little bug in tinymce.module (version tinymce-6.x-1.1-dev.tar.gz) that overrides the default status. It is on line 501 (after applying thecarlhall's patch) under the tinymce_config() function; and it says: $status = 'true';. So go ahead and remove that single line, or apply the patch I created, and it should work fine.
Best Regards!
Comment #8
Shark Tek CreditAttribution: Shark Tek commentedAny guide on how to apply the patch for tinymce 3.x?
Comment #9
christefano CreditAttribution: christefano commentedsubscribing
Comment #10
asak CreditAttribution: asak commented@esolano: nice job! it works perfect now.
Comment #11
raspberryman CreditAttribution: raspberryman commented#7 works beautifully. Thank you!
Comment #12
yhager CreditAttribution: yhager commented#7 works for me as well
Comment #13
raspberryman CreditAttribution: raspberryman commentedHmm, don't know why yet but:
1) Create a Webform 6.x-2.0-beta5
2) Go to the edit page for that Webform
The screen is white except for:
<html><head></head><body><div><a href="javascript:mceToggle('edit-body', 'wysiwyg4body');" id="wysiwyg4body">disable rich-text</a></div><div><a href="javascript:mceToggle('edit-webform-confirmation', 'wysiwyg4webform-confirmation');" id="wysiwyg4webform-confirmation">disable rich-text</a></div></body></html>
Plus it looks like the page is still trying to load. But nothing else comes up.
Comment #14
Riccardo83 CreditAttribution: Riccardo83 commentedWorks like a charm, thanks mate...
Comment #15
keva CreditAttribution: keva commented#13 -
I'm having a very similar issue, but with other pages.
http://drupal.org/node/254396
Comment #16
rmiddle CreditAttribution: rmiddle commentedThat patch didn't work for me. It is kinda late need to check into why tomorrow just might the patch fubar'd the module. Wouldn't be the 1st time.
Comment #17
AD-DA CreditAttribution: AD-DA commentedFor TinyMCE 3.0 I would rather use the recommended form given in the TinyMCE examples:
tinyMCE.getInstanceById(element.id) instead of tinyMCE.get()
The example is available at http://wiki.moxiecode.com/examples/tinymce/installation_example_07.php and the toggle function is:
Comment #18
bell CreditAttribution: bell commentedI'm new to Drupal. Where/how do I apply the TinyMCE 3.0 patch? Does the patch get added to an existing file? Replace something in an existing file? Get added to a directory?
Thanks!
Comment #19
bell CreditAttribution: bell commentedI applied the patch as follows:
Works like a charm.
I figure there must be an easier way to do this, however. Is there? What is it?
Thanks.
Comment #20
Murz#7 patch works good with Drupal 6.2 and TinyMCE 3.0.8, thanks!
But I can't find method to disable code cleanup in TinyMCE 3.x, all PHP codes TinyMCE removes :(
Maybe anybody know how to disable cleanup?
For example, I have text on body
When I turn off TinyMCE with "disable rich-text", put this text and saves the node, all works good.
But when I press "Preview" button, TinyMCE loads again and removes all my php codes, the body becomes like this:
In Drupal 5.x and TinyMCE 2.x this method works good, the code always staying unchanged.
Comment #21
Murz#17 Andjety, thanks for info! With your method function mceToggle() must work more quickly:
On my Drupal 6.3 & TinyMCE 3.0.8 works perfectly!
Comment #22
MurzAbout #20 problem with eating PHP code by TinyMCE i have found a thread on TinyMCE forum:
http://tinymce.moxiecode.com/punbb/viewtopic.php?id=10778
But it have no answer at now. Maybe later..
Comment #23
MurzI have found a codeprotect TinyMCE 3.x plugin that protect php code from removing!
http://sourceforge.net/tracker/index.php?func=detail&aid=1901590&group_i...
Comment #24
MurzWith enabled TinyMCE 'disable rich-text' link module does not work on
admin/build/block/*
pages. I have found and correct the problem, patch from tinymce-6.x-1.1-dev is attached.And I have attached a full pached module and TinyMCE 3.0.8 with working codeprotect plugin for protecting remove php areas code (
<?php some_text that must not be removed ?>
).Comment #25
pieter333 CreditAttribution: pieter333 commentedHi Murz,
Thank you very much for your archive file!!! It works perfect.
But I discovered something, if I turn on in "admin/settings/performance" to put all javascript files into one file, I get the following error when a page is trying to load TinyMCE:
Firebug error log:
Does anyone know how to fix this?
Comment #26
LUTi CreditAttribution: LUTi commentedDrupal 6.3? Murz???
Comment #27
sunMarking as duplicate of #215580: Error: tinyMCE.getEditorId is not a function
Comment #28
abe.lincoln CreditAttribution: abe.lincoln commentedthecarlhall & esolano - THANK YOU! works perfectly!
Comment #29
gillianH CreditAttribution: gillianH commentedThanks thecarlhall and esolano - the patch fixed my problems with TinyMCE - or appeared to...
I now have the enable/disable links, but while enable enables, disable doesn't do anything. I can follow PHP and JavaScript a bit, but am just a beginner in these languages, so I'm not really sure where to look.
Here's my configuration:
Drupal 6.2
TinyMCE plugin 6.x-1.1-dev
TinyMCE 3.1.0.1
PHP 5.2.6
Windows XP
I'm adding this bit second in case it turns out to be completely irrelevant, in which case you can stop reading!
If I enable the Error console - I'm using Firefox 2.0.0.15 - I noticed that the following error occurs:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMNSHTMLDocument.execCommand]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame :: http://domain-not-yet-registered-so- omitted/sites/all/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js?v :: anonymous :: line 1" data: no]
I don't know whether this is relevant - other posts have reported errors like this with TinyMCE, but seem to indicate it is not necessarily harmful, or that it is to do with the TinyMCE compressor. I'm not using the compressor at the moment.
Just to be really annoying the JavaScript file complained about seems to consist of one very long line, so the fact that it complains about line 1 is not very helpful. I tried running 'od -c' on it via cygwin to see if there was a CR/LF Unix/windows problem but there's not a single \n nor \r in it anywhere.
Any help welcome!
gillianH
Comment #30
mariagwyn CreditAttribution: mariagwyn commented@Murz: this tar file works very well at allowing the enable/disable button to appear. thank you!!!!!
However: it does not seem to attend to the default state (which I have as disabled for both user and overall). So, every time I edit a page with php, it wipes the php out and I have to disable and repaste the code.
I applied the patch listed above (escalano?) and it works fine. Perhaps you can incorporate this into the tar?
@sun: this does not appear to be a duplicate as the issue you reference is for 5.x not 6.x. I am changing the settings since this is the only workable solution I have found so far for the issues mentioned specific to 6.x.
And it is ACTIVE b/c this is still not in the 6.x dev version. I am not sure it is perfect, but it is the easiest fix so far.
Comment #31
spiffyd CreditAttribution: spiffyd commentedI am using the TinyMCE v3 patch. Whenever a page with the TinyMCE editor loads, I see the page loads then quickly overlayed with white screen with a link that says "disable rich text." The page then doesn't seem to stop loading.
Suggestions? Please advise.
Comment #32
rmiddle CreditAttribution: rmiddle commented#31,
I had the same problem. I uninstall TinyMCE delete it database tables and reinstalled and the problem went away.
Thanks
Robert
Comment #33
spiffyd CreditAttribution: spiffyd commented@Robert...
I uninstalled TinyMCE, deleted the files, and did a fresh reinstall. The problem still came back right after I applied the patch. Had to reverse it b/c of that... so still no enable/disable funcionality at this moment. I recalled the patch worked for a short period of time before in the past, but I cannot recall what I did. Perhaps this could be a conflict with other modules or something.
Comment #34
rmiddle CreditAttribution: rmiddle commentedI had to clear the database records. It has something to with the Version 5 database info.
Thanks
Robert
Comment #35
spiffyd CreditAttribution: spiffyd commented@ Robert... I thought unchecking the module, then uninstalling it would clear the DB records. Correct me if I'm wrong.
or did you go into PHPMyAdmin to manually clear tables/entries? If so which ones did you clear?
Comment #36
rmiddle CreditAttribution: rmiddle commentedspiffyd,
I it has been some time since I had to do that. If when you reinstall the settings are still there it means the uninstall didn't work right.
Thanks
Robert
Comment #37
bflora CreditAttribution: bflora commentedI'm having the same problem as spiffyd....and uninstalling and reinstalling tinymce isn't solving it at all.
I think there's some issue with javascript/jquery at play here.
Anyone know how to fix this? My site's more or less become unusable.
Comment #38
spiffyd CreditAttribution: spiffyd commentedComment #39
spiffyd CreditAttribution: spiffyd commentedThis bug is fixed with a patch named: ToggleTinyMCE.patch
I found it on another thread... I'll post the link here as soon as I dig it up again! But in the meantime, try the attachment.
Comment #40
bflora CreditAttribution: bflora commentedI ended up fixing this by hacking tinymce to add in the rich-text toggle via jquery. I can't find the link to the explanation but a search should turn it up.
Comment #41
sunPlease note that the TinyMCE module for Drupal is unmaintained since quite a long time. You might want to consider upgrading to Wysiwyg API, which is continuously improved.
Comment #42
bflora CreditAttribution: bflora commentedHey sun,
I think I've seen you suggesting the wsywyg api elsewhere.
I'm not going to use it right now and I'll explain why in the hopes that the feedback will lead to a better module. I do not have a technical background. I'm a writer who chose Drupal to build an online magazine on since everyone said it was great. I speak for non-technical people building Drupal sites.
First impressions when I click on that link:
1. I see a big red box with "needs work" written in it. This is a clear sign that I don't want to run this unless I'm a programmer.
2. Instead of a description and a link to download the module, like I see on all other module pages, I see 8 boxes with a bunch of info in each of them. If I want to offer my readers a wysiwig text editor, why are there 8 pieces to it? That seems unnecessarily complicated for a solution.
3. I see a "experimental code" in bold letters. Another red flag. Quite a few modules that say they work don't. Something that claims to probably not work probably won't.
4. The overall goal of the project is to: "Abstract the configuration and integration for any client-side editor in one module, and allow Drupal modules to interact with any client-side editor."
This does not coincide with my goal to "offer my users a rich text editor." In fact I'm not sure how it relates at all.
So that's why I'm sticking with the tinymce. Does it suck? Kind of. yeah. But it more or less works and its just one module, not a whole handful with technical names.
Comment #43
astoltz CreditAttribution: astoltz commentedThis is the patch that worked for me including the default enable/disable status except for one detail. In tinymce.module change line 246 from:
to:
I don't have access to make a patch at this time.
Comment #44
christefano CreditAttribution: christefano commentedI haven't tested andyl56's proposed change in #43 yet, but here it is in patch form for both TinyMCE 6.x-dev and 5.x-dev. Please review.
Comment #45
caspercash CreditAttribution: caspercash commented#7 works for me! many thanks bords!
Comment #46
inventfilm CreditAttribution: inventfilm commentedI read post #19 and wrote some php to do exact what you said (except it's a + sign not an =) and made an easier way:
http://files.inventfilm.com/drupal/patcher.php
I put the text of the patch in the patch box, and the text of the module in the module box and it worked for me.
Feel free to use this for other module, as it should work (in theory).
NOTE: This patch gives me the link to disable/enable the editor, but now when I go to Site Configuration, TinyMCE, and try to edit a profile, it won't load. As per http://drupal.org/node/254396
edit- Post #21 on http://drupal.org/node/235972 fixed the issue replaced the code on line 209 (after applying the first patch on this page).
edit2- Still get "You must select at least one role." error when updating a profile.
Comment #47
docker CreditAttribution: docker commentedWorks fine. Thanks!
Comment #48
pcorbett CreditAttribution: pcorbett commented#39 works for me except that if you select that TinyMCE is OFF by default, it still appears ON on pages. The disable/enable toggle is always there, so this isn't a critical issue, and I don't have the time right now to fix this. #43 breaks #39 (doesn't show the toggle) if it is set to be OFF by default.
Comment #49
sun@bflora: Thanks for taking the time to provide some feedback. That's very appreciated. I hope that all of the issues you mentioned are fixed now. Please let me know if there still are "unfriendly" things flowing around. Thanks!
@all:
Please have a look at the TinyMCE project page. Marking as won't fix. (actually, it [still] works in Wysiwyg API)
Comment #50
helloari CreditAttribution: helloari commentedi had this same issue and found this page to be confusing. i don't know how to apply a diff file/patch. and i see the note at the top of the TinyMCE page says to stop using it and use the "Wysiwyg API" instead. i assume that advice applies to TinyTinyMCE - which sounds good but i have not tried.
but i found a simpler solution! on the TinyMCE edit page:
admin/settings/tinymce/edit/TinyMCE%2Bprofile%2B1
i went to the "Buttons and plugins" section and enabled the "code" button. this added a "html" button to the tinyMCE menu that gives similar functionality as the "disable rich text" button that wasn't appearing for me.
Comment #51
sunI have no idea what made you assume that.
Actually, the notice applies to the Drupal TinyMCE module. That is why it is on this project page and not on tinytinymce's project page.
Comment #52
diseño web palma de Mallorca CreditAttribution: diseño web palma de Mallorca commenteduff, Im not sweating any more,
cheers !!
Comment #53
qasimzee CreditAttribution: qasimzee commentedThe patch worked for me.
It will be better, if you guys add this issue to the project page.
Comment #54
gone404 CreditAttribution: gone404 commentedThe last line:
-- Change tinyMCE.removeMCEControl(tinyMCE.getEditorId(element.id)); to tinyMCE.execCommand('mceRemoveControl',false,element.id);
Doesn't work for me. Changing it to: "tinyMCE.execCommand('mceRemoveControl', false, params.field)" fixed things.
I am guessing that this goes for the other references to element.id.