Line: 1 to 1 | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Wysiwyg PluginTranslator framework for WYSIWYG editors | |||||||||||||||||
Added: | |||||||||||||||||
> > | On this page:
| ||||||||||||||||
Changed: | |||||||||||||||||
< < | Support for the integration of WYSIWYG (What-You-See-Is-What-You-Get) editors. On its own, the only thing this plugin gives you is a stand-alone HTML to TWiki translator script. For WYSIWYG editing in TWiki, you will also need to install a specific editor package such as TWiki:Plugins.KupuEditorContrib or TWiki:Plugins.WikiwygContrib. | ||||||||||||||||
> > | Introduction | ||||||||||||||||
Changed: | |||||||||||||||||
< < | This plugin provides a generic framework that supports editing of TWiki topics using any browser-based HTML editor. It works by transforming TML (TWiki Meta Language) into HTML for the editor, and then transforming HTML back into TML on save. | ||||||||||||||||
> > | Support for the integration of WYSIWYG (What-You-See-Is-What-You-Get) editors. On its own, the only thing this plugin gives you is a stand-alone HTML to TWiki translator script. For WYSIWYG editing in TWiki, you will also need to install a specific editor package such as TWiki:Plugins/KupuEditorContrib or TWiki:Plugins/WikiwygContrib. | ||||||||||||||||
Changed: | |||||||||||||||||
< < | On this page:
| ||||||||||||||||
> > | This plugin provides a generic framework that supports editing of TWiki topics using any browser-based HTML editor. It works by transforming TML (TWiki Meta Language) into HTML for the editor, and then transforming HTML back into TML on save. | ||||||||||||||||
Features | |||||||||||||||||
Added: | |||||||||||||||||
> > | |||||||||||||||||
| |||||||||||||||||
Line: 44 to 50 | |||||||||||||||||
Both translators can be used directly from Perl scripts, for example to build your own stand-alone translators. | |||||||||||||||||
Changed: | |||||||||||||||||
< < | A stand-alone convertor script for HTML to TWiki is included in the installation. It can be found in tools/html2tml.pl . | ||||||||||||||||
> > | A stand-alone converter script for HTML to TWiki is included in the installation. It can be found in tools/html2tml.pl . | ||||||||||||||||
Integrating a HTML Editor | |||||||||||||||||
Added: | |||||||||||||||||
> > | |||||||||||||||||
The plugin can be used to integrate an HTML editor in a number of different ways.
| |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
| |||||||||||||||||
Changed: | |||||||||||||||||
< < | Generating content directly in the standard edit template | ||||||||||||||||
> > | Generating content in standard edit template | ||||||||||||||||
This is the technique used by WYSIWYG editors that can sit on top of HTML
textareas, such as TinyMCE. The topic content is pre-converted to HTML before inclusion in the standard edit template. These editors use plugins that have a beforeEditHandler and an afterEditHandler . These handlers are responsible for the conversion of topic text to HTML, and post-conversion of HTML back to TML.
| |||||||||||||||||
Line: 65 to 73 | |||||||||||||||||
| |||||||||||||||||
Changed: | |||||||||||||||||
< < | Generating content directly in a specialised edit template | ||||||||||||||||
> > | Generating content in specialized edit template | ||||||||||||||||
This technique is useful when the editor requires the topic content in a variety of different formats at the same time. In this scenario the editor uses a custom edit template. The WYSIWYG content is made available for instantiation in that template in a number of different formats. WYSIWYGPLUGIN_WYSIWYGSKIN must be set for this to work.
The flow of control is as follows: | |||||||||||||||||
Line: 83 to 92 | |||||||||||||||||
Fetching content from a URL | |||||||||||||||||
Added: | |||||||||||||||||
> > | |||||||||||||||||
In this scenario, the edit template is generated without the content-to-be-edited. The content is retrieved from the server using a URL e.g. from an IFRAME .
The flow of control is as follows: | |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
| |||||||||||||||||
Line: 105 to 117 | |||||||||||||||||
Once the save script has completed it responds with a redirect, either to an Oops page if the save failed, or to the appropriate post-save URL (usually a view ). The editor must be ready to handle this redirect.
Handling Attachments | |||||||||||||||||
Added: | |||||||||||||||||
> > | |||||||||||||||||
Attachment uploads can be handled by URL requests from the editor template to the TWiki | |||||||||||||||||
Changed: | |||||||||||||||||
< < | upload script. The upload script normally redirects to the containing topic; a behaviour that you usually don't want in an editor! There are two ways to handle this: | ||||||||||||||||
> > | upload script. The upload script normally redirects to the containing topic; a behavior that you usually don't want in an editor! There are two ways to handle this: | ||||||||||||||||
| |||||||||||||||||
Line: 156 to 173 | |||||||||||||||||
Known issuesIncompatible with "non-standard" syntax | |||||||||||||||||
Changed: | |||||||||||||||||
< < | WysiwygPlugin is incompatible with plugins that expand non-standard syntax e.g. TWiki:Plugins.MathModePlugin (WysiwygPlugin) | ||||||||||||||||
> > | WysiwygPlugin is incompatible with plugins that expand non-standard syntax e.g. TWiki:Plugins.MathModePlugin (WysiwygPlugin) | ||||||||||||||||
Plugins that extend the syntax using TWiki variables, such as %MYVARIABLE% , should work fine.
Overlapping styles | |||||||||||||||||
Changed: | |||||||||||||||||
< < | Because TWiki uses a "best guess" approach to some formatting, it allows overlapping of tags in a way forbidden by HTML, and it is impossible to guarantee 100% that formating in the original TWiki document will still be there when the same document is loaded and then saved through the WysiwygPlugin. The most obvious case of this is to do with styles. For example, the sentence | ||||||||||||||||
> > | Because TWiki uses a "best guess" approach to some formatting, it allows overlapping of tags in a way forbidden by HTML, and it is impossible to guarantee 100% that formatting in the original TWiki document will still be there when the same document is loaded and then saved through the WysiwygPlugin. The most obvious case of this is to do with styles. For example, the sentence | ||||||||||||||||
*bold _bold-italic* italic_ | |||||||||||||||||
Line: 177 to 196 | |||||||||||||||||
Plugin Info | |||||||||||||||||
Deleted: | |||||||||||||||||
< < | This plugin is brought to you by a WikiRing ![]() ![]() | ||||||||||||||||
Many thanks to the following sponsors for supporting this work: | |||||||||||||||||
Changed: | |||||||||||||||||
< < | |||||||||||||||||
> > | |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
| |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
| |||||||||||||||||
Line: 207 to 226 | |||||||||||||||||
| |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
| |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
| |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
| |||||||||||||||||
Changed: | |||||||||||||||||
< < | Related Topics: TWikiPreferences, TWikiPlugins
| ||||||||||||||||
> > | Related Topics: TinyMCEPlugin, TWikiPreferences, TWikiPlugins |