Closed (fixed)
Project:
TinyMCE
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
29 Oct 2007 at 19:58 UTC
Updated:
26 Jun 2008 at 16:16 UTC
Sometimes it is necessary to keep TinyMCE completely out of a given textarea.
With this patch, any textarea you define with class="mceNoEditor" will have no TinyMCE dressing added.
Index: tinymce/tinymce.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/tinymce/tinymce.module,v
retrieving revision 1.92
diff -u -r1.92 tinymce.module
--- tinymce/tinymce.module 31 Jul 2007 14:40:36 -0000 1.92
+++ tinymce/tinymce.module 29 Oct 2007 19:52:56 -0000
@@ -78,6 +78,10 @@
global $user;
static $profile_name;
+ // If FAPI element has a class set with mceNoEditor, don't add TinyMCE.
+ if ($element['#attributes']['class'] == 'mceNoEditor') {
+ return $element;
+ }
//$element is an array of attributes for the textarea but there is no just 'name' value, so we extract this from the #id field
$textarea_name = substr($element['#id'], strpos($element['#id'], '-') + 1);
| Comment | File | Size | Author |
|---|---|---|---|
| mceNoEditor.patch | 779 bytes | amanuel |
Comments
Comment #1
amanuel commentedAn example FAPI definition may be in order here:
The following body definition would have no TinyMCE applied to it.
Comment #2
amanuel commentedWorks as advertised.
Comment #3
geek-merlinthis would be great so that my "exec php" from devel module does not become wysiwyg.
i would advice to change it to "nowysiwyg" or something like this so other wysiwyg projecs can easier follow ;-)
Comment #4
sunSee http://drupal.org/project/wysiwyg
Comment #5
amanuel commented@Sun, wysiwyg module is great but this IMO is still necessary feature for TinyMCE for those that don't use the wysiwyg module.
Thanks for pointing out wysiwyg though....but this has lingered so long now though I wonder if the patch will still apply.
I won't update till I hear from one of the devs.
Comment #6
sunSorry, you won't hear from the devs. Look at the queue of this project. Some really important issues languish in the queue since more than one year. With important, I'm referring to bug fixes, not feature requests like this issue.
To override the default list of skipped textareas in TinyMCE module, you should implement a theme override function for theme_tinymce_theme() in your theme's template.php.
Implementing a #wysiwyg property for TinyMCE is absolutely out of scope currently.
Comment #7
celstonvml commentedPersonally, I don't like putting in logic in my theme template.php file. Suppose I want to use an out-of-the-box theme? Suppose I want to create a re-usable module that enables/disables TinyMCE regardless of theme?
I may explore the wysiwyg module but this patch works fine for my current needs. Thank you.
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.