Difference: WysiwygPlugin (11 vs. 12)

Revision 122010-05-18 - TWikiContributor

Line: 1 to 1
 

Wysiwyg Plugin

Translator framework for WYSIWYG editors
Added:
>
>
Translator framework for WYSIWYG editors
 
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:
<
<
>
>
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:
>
>
 
  • Supports the input of malformed HTML
  • Full round-trip (TML -> XHTML -> TWiki syntax)
  • Framework is editor-agnostic
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.
  1. The HTML for the content-to-be-edited can be generated directly in the standard edit template.
Changed:
<
<
  1. The HTML for the content-to-be-edited can be generated directly in a specialised edit template.
>
>
  1. The HTML for the content-to-be-edited can be generated directly in a specialized edit template.
 
  1. A URL can be used to fetch the content-to-be-edited from the server, for use in an IFRAME.
  2. REST handlers can be called from Javascript to convert content.
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.
  1. User hits "edit".
Line: 65 to 73
 
  • Your plugin should set the textareas_hijacked context id, to signal to skins to suppress their textarea manipulation functions.
This is the recommended integration technique, if your editor can support it.
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: 86 to 96
 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:
<
<
  1. As Generating content directly in a specialised edit template
  2. As Generating content directly in a specialised edit template
  3. As Generating content directly in a specialised edit template
>
>
  1. As Generating content directly in a specialized edit template
  2. As Generating content directly in a specialized edit template
  3. As Generating content directly in a specialized edit template
 
  1. When the document loads in the browser, the JS editor invokes a content URL (using an IFRAME or a XmlHttpRequest) to obtain the HTML document to be edited
    • The content URL is just a TWiki view URL with the wysiwyg_edit parameter set.
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:
 
  • If the uploads are done in an IFRAME or via XmlHttpRequest, then the 302 redirect at the end of the upload can simply be ignored.
  • You can pass noredirect to the upload script to suppress the redirect. In this case
Line: 156 to 173
 

Known issues

Incompatible 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 partner - working together to improve your wiki experience!
 Many thanks to the following sponsors for supporting this work:
Changed:
<
<
>
>
 
Changed:
<
<
Plugin Author(s): TWiki:Main.CrawfordCurrie http://www.c-dot.co.uk
Copyright © ILOG 2005 http://www.ilog.fr, 2007 TWIKI.NET
>
>
Plugin Author: TWiki:Main/CrawfordCurrie http://www.c-dot.co.uk
Copyright © 2005 ILOG http://www.ilog.fr,
© 2007 Twiki, Inc.,
© 2005-2010 TWiki:TWiki/TWikiContributor
 
License GPL (Gnu General Public License)
Changed:
<
<
Plugin Version: 18083 (02 Sep 2009)
Change History:  
>
>
Plugin Version: 2010-05-17 18717 (2010-05-29)
Change History:
<-- versions below in reverse order -->
 
2010-05-17: TWikibug:Item6433 - more doc fixes; replacing TWIKIWEB with SYSTEMWEB
2010-04-24: TWikibug:Item6433 - doc improvements, prepare for TWiki 5.0 release
 
18 Apr 2009 Fixed TWikibug:Item6251 (require http post for REST upload)
22 Oct 2008 Fixed TWikibug:Item5961 (emphasis), TWikibug:Item6089 (backslash in verbatim)
7 Aug 2008 Fixed TWikibug:Item5707 (mod_perl)
Line: 207 to 226
 
17 Sep 2007 TWikibug:Item4647: TWikibug:Item4652: problems related to DIV fixed. TWikibug:Item4653: fixed multi-line twiki variables
16 Sep 2007 TWikibug:Item4630: polished up the way the secret string is done, to ensure synch between perl and JS. 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). Removed extra entity decoding steps that were causing problems. TWikibug:Item4629: fixed issues with verbatim, highlighted by previous mangling of this topic
13 Sep 2007 TWikibug:Item4613 cleaned up spurious message when navigating away TWikibug:Item4615 fixed incorrect rendering of emphasis next to br
Changed:
<
<
12 Sep 2007 TWikibug:Item4604 Fixes to REST handler, and add ability to trigger HTML2TML conversion from a content comment alone (required for some editors) TWikibug:Item4588 fixes to conversion of double-character emphases
>
>
12 Sep 2007 TWikibug:Item4604 Fixes to REST handler, and add ability to trigger HTML2TML conversion from a content comment alone (required for some editors) TWikibug:Item4588 fixes to conversion of double-character emphases
 
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 TWikibug:Item4550 section tags being eaten
4 Sep 2007 TWikibug:Item4534 TWikibug:Item4535 fixed
Changed:
<
<
See Subversion logs for earlier revisions
>
>
  See Subversion logs for earlier revisions
 
Dependencies:
NameVersionDescription
HTML::Parser>=3.28Required. Available from CPAN.
HTML::Entities>=1.25Required. Available from CPAN.
Encode>=2.01Required.
Plugin Home: http://twiki.org/cgi-bin/view/Plugins/WysiwygPlugin
Changed:
<
<
Feedback: TWiki:Plugins/WysiwygPluginDev
>
>
Feedback: http://twiki.org/cgi-bin/view/Plugins/WysiwygPluginDev
 
Appraisal: http://twiki.org/cgi-bin/view/Plugins/WysiwygPluginAppraisal
Changed:
<
<
Related Topics: TWikiPreferences, TWikiPlugins

META FILEATTACHMENT attr="h" comment="" name="wikiringlogo20x20.png" version="1"
>
>
Related Topics: TinyMCEPlugin, TWikiPreferences, TWikiPlugins
 
This site is powered by the TWiki collaboration platformCopyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.WysiwygPlugin.