data/TWiki/TinyMCEPlugin.txt
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
child 1 e2915a7cbdfa
permissions -rw-r--r--
RELEASE 4.2.0 freetown
colas@0
     1
---+!! !TinyMCEPlugin
colas@0
     2
<!--
colas@0
     3
One line description, required for extensions repository catalog.
colas@0
     4
   * Set SHORTDESCRIPTION = Integration of the !TinyMCE WYSIWYG Editor
colas@0
     5
-->
colas@0
     6
%SHORTDESCRIPTION%
colas@0
     7
colas@0
     8
<img src="%ATTACHURL%/screenshot.gif"/>
colas@0
     9
colas@0
    10
%TOC%
colas@0
    11
This is an integration of the <a href="http://tinymce.moxiecode.com?id=powered_by_tinymce_mini"><img src="http://tinymce.sourceforge.net/buttons/tinymce_button.png" border="0" width="80" height="15" alt="TinyMCE" /></a> WYSIWYG editor. This is great little editor, fast and highly functional, and supporting a wide range of browsers, including Firefox, IE and Safari. At the time of writing it doesn't work with Opera or Konqueror.
colas@0
    12
colas@0
    13
The integration uses the TWiki:Plugins.WysiwygPlugin to translate text to and from a format that !TinyMCE can edit.
colas@0
    14
colas@0
    15
Unlike the other editor integrations in TWiki, which install "Word in a Browser" style editors, this plugin is able to swap out the _standard_ text areas in an edit and replace them with WYSIWYG editors. This means you get WYSIWYG editors for textareas in forms, as well as for the main text of the topic. It can also co-exist alongside other WYSIWYG editors, such as Kupu.
colas@0
    16
colas@0
    17
The editor automatically "switches itself off" (i.e. reverts to the old text-only window) when editing topics that contain TWiki content it can't handle, such as complex TWiki variables.
colas@0
    18
colas@0
    19
---++ Editor Notes
colas@0
    20
The editor uses a translator module to convert from TWiki markup language (TML) to HTML and back. The translator converts special TWiki tags - such as %<nop>VARIABLES% - to plain text, and encloses them within HTML spans using a special style called =WYSIWYG_PROTECTED=. In this way the editor can detect text that is not meant to be HTML formatted. This style is _also_ used to protect special text you enter into the editor from being interpreted when the topic is translated back into TML. If you want to add any special TWiki features that are sensitive to formatting, such as =Set= statements, then you have to format those regions using 'Protect on save' or 'Protect forever'.
colas@0
    21
colas@0
    22
---++ Installation Instructions
colas@0
    23
colas@0
    24
__NOTES:__
colas@0
    25
   * This plugin comes pre-installed on TWiki 4.2.0. You should only need to re-install if there is an upgrade to the plugin.
colas@0
    26
   * It requires the very latest revision of WysiwygPlugin. It will *not* work with the version shipped with TWiki 4.1.2.
colas@0
    27
   * When installed, it *replaces* the old "textarea" editor. If you want to maintain access to the old editor from the standard screens, follow the instructions under [[#InstallingOnOldTWikis][Configuring the buttons on TWiki < 4.2.0]].
colas@0
    28
colas@0
    29
First follow the installation instructions to install the Plugin:
colas@0
    30
colas@0
    31
You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server where TWiki is running.
colas@0
    32
colas@0
    33
Like many other TWiki extensions, this module is shipped with a fully
colas@0
    34
automatic installer script written using the Build<nop>Contrib.
colas@0
    35
   * If you have TWiki 4.2 or later, you can install from the =configure= interface (Go to Plugins->Find More Extensions)
colas@0
    36
      * See the [[http://twiki.org/cgi-bin/view/Plugins/BuildContribInstallationSupplement][installation supplement]] on TWiki.org for more information.
colas@0
    37
   * If you have any problems, then you can still install manually from the command-line:
colas@0
    38
      1 Download one of the =.zip= or =.tgz= archives
colas@0
    39
      1 Unpack the archive in the root directory of your TWiki installation.
colas@0
    40
      1 Run the installer script ( =perl &lt;module&gt;_installer= )
colas@0
    41
      1 Run =configure= and enable the module, if it is a plugin.
colas@0
    42
      1 Repeat for any missing dependencies.
colas@0
    43
   * If you are *still* having problems, then instead of running the installer script:
colas@0
    44
      1 Make sure that the file permissions allow the webserver user to access all files.
colas@0
    45
      1 Check in any installed files that have existing =,v= files in your existing install (take care *not* to lock the files when you check in)
colas@0
    46
      1 Manually edit !LocalSite.cfg to set any configuration variables.
colas@0
    47
colas@0
    48
%IF{"defined 'SYSTEMWEB'" else="<div class='twikiAlert'>%X% WARNING: SYSTEMWEB is not defined in this TWiki. Please add these definitions to your %MAINWEB%.TWikiPreferences, if they are not already there:<br><pre>   * <nop>Set SYSTEMWEB = %<nop>TWIKIWEB%<br>   * <nop>Set USERSWEB = %<nop>MAINWEB%</pre></div>"}%
colas@0
    49
colas@0
    50
colas@0
    51
   * *Enable* the WysiwygPlugin in =configure=.
colas@0
    52
   * *Enable* the TinyMCEPlugin in =configure=.
colas@0
    53
   * *Click* on edit of any topic.
colas@0
    54
colas@0
    55
---++ Settings
colas@0
    56
You can override this setting by defining TINYMCEPLUGIN_DEBUG to enable some simple debug features.
colas@0
    57
   * Set DEBUG = 0
colas@0
    58
colas@0
    59
This setting contains all the options passed to the TinyMCE editor on startup. 
colas@0
    60
For a full explanation of the available options, and guidance on reconfiguring TinyMCE, see the [[http://wiki.moxiecode.com/index.php/TinyMCE:Configuration][Moxicode TinyMCE Wiki]]. Note the inclusion of the Pattern Skin standard CSS files in the =content_css= setting.
colas@0
    61
<verbatim>
colas@0
    62
   * Set INIT = mode : "exact",
colas@0
    63
   save_on_tinymce_forms: true,
colas@0
    64
   elements : "text",
colas@0
    65
   cleanup : true,
colas@0
    66
   theme : "advanced",
colas@0
    67
   convert_urls : true,
colas@0
    68
   relative_urls : false,
colas@0
    69
   remove_script_host : false,
colas@0
    70
   setupcontent_callback : TWikiTiny.setUpContent,
colas@0
    71
   urlconverter_callback : "TWikiTiny.convertLink",
colas@0
    72
   hide_instance_callback : TWikiTiny.switchToRaw,
colas@0
    73
   show_instance_callback : TWikiTiny.switchToWYSIWYG,
colas@0
    74
   twikipuburl_callback : "TWikiTiny.convertPubURL",
colas@0
    75
   save_callback : "TWikiTiny.saveCallback",
colas@0
    76
   %IF{"$TINYMCEPLUGIN_DEBUG" then="debug:true,"}%
colas@0
    77
   plugins : "table,searchreplace,autosave,paste,twikibuttons,twikiimage%IF{"$TINYMCEPLUGIN_DEBUG" then=",devkit"}%",
colas@0
    78
   twiki_secret_id : "%WYSIWYG_SECRET_ID%",
colas@0
    79
   twiki_vars : { PUBURLPATH : "%PUBURLPATH%", PUBURL : "%PUBURL%", WEB : "%WEB%", TOPIC : "%TOPIC%", ATTACHURL : "%ATTACHURL%", ATTACHURLPATH : "%ATTACHURLPATH%", VIEWSCRIPTURL : "%SCRIPTURL{view}%", SCRIPTSUFFIX: "%SCRIPTSUFFIX%", SCRIPTURL : "%SCRIPTURL%" },
colas@0
    80
   theme_advanced_toolbar_align : "left",
colas@0
    81
   twikibuttons_formats : [
colas@0
    82
   { name: "Normal", el: "", style: null },
colas@0
    83
   { name: "Heading 1", el: "h1", style: false },
colas@0
    84
   { name: "Heading 2", el: "h2", style: false },
colas@0
    85
   { name: "Heading 3", el: "h3", style: false },
colas@0
    86
   { name: "Heading 4", el: "h4", style: false },
colas@0
    87
   { name: "Heading 5", el: "h5", style: false },
colas@0
    88
   { name: "Heading 6", el: "h6", style: false },
colas@0
    89
   { name: "VERBATIM", el: "pre", style: "TMLverbatim" },
colas@0
    90
   { name: "LITERAL", el: "span", style: "WYSIWYG_LITERAL" },
colas@0
    91
   { name: "Protect on save", el: null, style: "WYSIWYG_PROTECTED" },
colas@0
    92
   { name: "Protect forever", el: null, style: "WYSIWYG_STICKY" }
colas@0
    93
   ],
colas@0
    94
   paste_create_paragraphs : true,
colas@0
    95
   paste_create_linebreaks : false,
colas@0
    96
   paste_convert_middot_lists : true,
colas@0
    97
   paste_convert_headers_to_strong : false,
colas@0
    98
   paste_remove_spans: true,
colas@0
    99
   paste_remove_styles: true,
colas@0
   100
   paste_strip_class_attributes: "all",
colas@0
   101
   theme_advanced_buttons1 : "twikiformat,separator,bold,italic,tt,colour,removeformat,separator,bullist,numlist,outdent,indent,separator,link,unlink,anchor,separator,attach,image,charmap,hr,separator,undo,redo,separator,search,replace",
colas@0
   102
   theme_advanced_buttons2: "tablecontrols,separator,code,hide",
colas@0
   103
   theme_advanced_buttons3: "",
colas@0
   104
   theme_advanced_toolbar_location: "top",
colas@0
   105
   theme_advanced_resize_horizontal : false,
colas@0
   106
   theme_advanced_resizing : true,
colas@0
   107
   theme_advanced_path: false,
colas@0
   108
   theme_advanced_statusbar_location : "bottom",
colas@0
   109
   content_css : "%PUBURLPATH%/%TWIKIWEB%/TinyMCEPlugin/wysiwyg%IF{"$TINYMCEPLUGIN_DEBUG" then="_src"}%.css,%PUBURLPATH%/%TWIKIWEB%/TWikiTemplates/base.css,%TWIKISTYLEURL%,%TWIKICOLORSURL%"
colas@0
   110
</verbatim>
colas@0
   111
   * Additional settings for specific browsers.
colas@0
   112
      * Warning: if you enable =paste_auto_cleanup_on_paste then it automatically implies =past_use_dialog= on all non-MSIE browsers.
colas@0
   113
      * Set INIT_MSIE = paste_auto_cleanup_on_paste : true
colas@0
   114
      * Set INIT_OPERA = 
colas@0
   115
      * Set INIT_GECKO = 
colas@0
   116
      * Set INIT_SAFARI = 
colas@0
   117
colas@0
   118
You can override these settings in the same way as any other TWiki variable, by setting e.g. =TINYMCEPLUGIN_INIT= in the site, web or topic preferences. You are *not* recommended to edit the setting here.
colas@0
   119
colas@0
   120
   * You can *disable* the plugin in any web or topic, or for any specific user, by setting the =TINYMCEPLUGIN_DISABLE= variable to 1.
colas@0
   121
   * Some browsers don't support !TinyMCE. You can prevent the editor from
colas@0
   122
     being invoked on these browsers by setting =TINYMCEPLUGIN_BAD_BROWSERS= to a regular expression that matches the user-agent string for any broken browsers. The default is =(?i-xsm:Konqueror|Opera)=.   
colas@0
   123
colas@0
   124
%INCLUDE{"%TWIKIWEB%.WysiwygPluginSettings"}%
colas@0
   125
colas@0
   126
#InstallingOnOldTWikis
colas@0
   127
---++ Configuring the buttons on TWiki < 4.2.0
colas@0
   128
When installed on TWiki versions before 4.2.0, this plugin *replaces* the old textarea editor with the !TinyMCE editor. The shock of this change can be too much for some older contributors, so we have written instructions for reconfiguring your templates in TWiki:Plugins.TinyMCEFrequentlyAskedQuestions.
colas@0
   129
colas@0
   130
---++ Plugin Info
colas@0
   131
colas@0
   132
Another great TWiki extension from the <a style="text-decoration:none" href="http://wikiring.com"><img src="%ATTACHURLPATH%/wikiringlogo20x20.png" alt="" /> *WikiRing* </a> - working together to improve your wiki experience!
colas@0
   133
colas@0
   134
|  Plugin Author(s): | TWiki:Main.CrawfordCurrie |
colas@0
   135
|  Plugin Version: | 16268 (22 Jan 2008) |
colas@0
   136
|  Copyright: | &copy; 2007 Crawford Currie http://c-dot.co.uk |
colas@0
   137
|             | This package also includes the complete sources for version 2.1.1.1 of the !TinyMCE editor |
colas@0
   138
|  License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
colas@0
   139
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
colas@0
   140
| 20 Dec 2007 | TWikibug:Item5047: disable save and preview during page load TWikibug:Item5111: make the entry in the format menu sensitive to where the cursor is TWikibug:Item5022: made TT font size same as verbatim. Had to add a new style to do it, as TMCE didn't want to play with TT or CODE tags. |
colas@0
   141
|  19 Nov 2007 | TWikibug:Item4742: auto-disable if Wysiwyg is not enabled TWikibug:Item4820: validate mandatory fields on save TWikibug:Item4747: add &lt;sticky&gt; TWikibug:Item4811: noautolink *looks* like an HTML construct but in fact is not; the tag is infact an "on-off" switch and does not imply any HTML structure, so cannot be converted to a DIV or a span, so has to be removed. TWikibug:Item4817: added typewriter text button TWikibug:Item4850: added font colour controls TWikibug:Item4645: added attachment management features TWikibug:Item4945: added switch to raw and back |
colas@0
   142
|  16 Sep 2007 | TWikibug:Item4630: polished up the way the secret string is done, to ensure synch between perl and JS. TWikibug:Item4622: added UTF-8 handling steps that fixup malformed UTF8 strings before presenting them to the editor (saves Moz) and stops the editor passing them back to TWiki (saves IE). TWikibug:Item4603: added the draft help, so we can at least build the beta without the nasty warning |
colas@0
   143
|  13 Sep 2007 | TWikibug:Item4613 fixed navigate-away prompt when unchanged TWikibug:Item4583 TWikibug:Item4604 TWikibug:Item4614 TWikibug:Item4616 A clutch of issues caused by use of the wrong encoding function when passing UTF8 parameters to REST using XMLHttpRequest. |
colas@0
   144
|  12 Sep 2007 | TWikibug:Item4604 Converted to REST call for content conversion, to provide safe callback if JS is disabled in the browser TWikibug:Item4583 relaxed regex to try and make it work for UTF-8 topic names |
colas@0
   145
|  11 Sep 2007 | TWikibug:Item4535 refinements to link handling to improve topic name recognition |
colas@0
   146
|  7 Sep 2007 | TWikibug:Item4503 excess empty lines TWikibug:Item4486 no toc headers with unofficial syntax TWikibug:Item4560: empty lines lost TWikibug:Item4566: corrupted table on save |
colas@0
   147
|  6 Sep 2007 | TWikibug:Item4557 added missing files to package |
colas@0
   148
|  4 Sep 2007 | TWikibug:Item4534 TWikibug:Item4535 fixed |
colas@0
   149
|  14679 | TWikibug:Item4481 TWikibug:Item4524 fixed |
colas@0
   150
|  14668 | Bugfixes and refinements done as part of 4.2 release |
colas@0
   151
|  14543 | Added PROTECTED style, to allow protection of special text. Disable on unsupported browsers (untested) |
colas@0
   152
|  14538 | First release |
colas@0
   153
|  Dependencies: | <table border="1"><tr><th>Name</th><th>Version</th><th>Description</th></tr><tr><td align="left">TWiki::Plugins::BehaviourContrib</td><td align="left">&gt;=15357</td><td align="left">Javascript module</td></tr><tr><td align="left">TWiki::Plugins::WysiwygPlugin</td><td align="left">&gt;=14523</td><td align="left">Translator module</td></tr></table> |
colas@0
   154
|  Plugin Home: | http://twiki.org/cgi-bin/view/Plugins/TinyMCEPlugin |
colas@0
   155
|  Feedback: | http://twiki.org/cgi-bin/view/Plugins/TinyMCEPluginDev |
colas@0
   156
|  Appraisal: | http://twiki.org/cgi-bin/view/Plugins/TinyMCEPluginAppraisal |
colas@0
   157
colas@0
   158
Many thanks to the following sponsors for supporting this work:
colas@0
   159
   * [[http://ilog.fr][ILOG]]
colas@0
   160
   * [[http://www.carrier.com][Carrier Corporation]]
colas@0
   161
   * [[http://twiki.net][TWIKI.NET]]
colas@0
   162
colas@0
   163
<!-- Do _not_ attempt to edit this topic; it is auto-generated. Please add comments/questions/remarks to the Dev topic instead. -->
colas@0
   164
colas@0
   165
%META:FILEATTACHMENT{name="tinymce.gif" attr="h" comment="screenshot"}%
colas@0
   166
%META:FILEATTACHMENT{name="wikiringlogo20x20.png" attr="h" comment="" version="1"}%
colas@0
   167
%META:FILEATTACHMENT{name="screenshot.gif" attr="h" comment="" version="1"}%