Welcome, Registration, and other StartingPoints; TWiki history & Wiki style; All the docs...
View   r1
NatEditContrib 1 - 03 Jan 2008 - Main.TWikiAdminGroup
Line: 1 to 1
Added:
>
>

Natural Edit Contrib

<--

PLEASE DO NOT EDIT THIS TOPIC

It is automatically generated from the subversion repository, and any changes you make will simply be overwritten the next time a release is generated.

Instead, you could check your fix in, raise a bug in the Bugs web, or mail the author. -->

Powered by
WikiRing Consultants

Description

The NatEdit is an wiki editor that helps in learning the TWikiMarkup Language by providing a GUI. By design, this is not a wysiwyg editor that tries to generate the correct TML in the background. Instead, the user is still in charge of writing correct wiki markup but with a bit more of assistance as a plain browser textarea. Therefor this editor helps to lower the learning curve but will not get in your way once you are aware of wiki markup.

NatEdit heavily depends on javascript. Hence browsers without javascript are not supported.

Screenshot

screenshot1.png

Configuration

To enable the NatEditContrib add the identifier natedit to the SKIN variable in TWikiPreferences or WebPreferences. So in case you are using PatternSkin this is
   * 
<-- -->
Set SKIN = natedit,pattern

Customization

Theming

The editor can be themed using CSS. The actual theme is set using the NATEDIT_THEME variable which defaults to
   * Set NATEDIT_THEME = default

This value determines the subdirectory under /twiki/pub/TWiki/NatEditContrib which contains a styles.css file and a bunch of button images. You can create a new theme "foo" by creating a CSS file /twiki/pub/TWiki/NatEditContrib/foo/styles.css and setting

   * 
<-- -->
Set NATEDIT_THEME = foo
See the default theme for the CSS classes used for the individual buttons.

word-natedit.jpg

Word theme

The Word theme for NatEditContrib uses not only a custom CSS style, but also a customisation of the icon order, and customised Help.

This is acheived through the use of the TWiki Template path - over-riding the original natedit edittoolbar, a natedit theme, and a custom help text topic.

Create new table can either be a static 3x3 table, or, If you install and enable JQueryPlugin, will use a popup dialog that lets the user choose the number of rows and columns.

   * 
<-- -->
Set SKIN = word.natedit,natedit,pattern *
<-- -->
Set NATEDIT_THEME = word *
<-- -->
Set NATEDIT_HELPTEXT = TWiki.NatEditWordHelpText

Markup

All buttons produce a certain amout of TWiki markup or HTML inserting it at the current position in the textarea. This can be configured to your needs using a set of preference variables. Please add them to your TWikiPreferences or WebPreferences to override the build-in defaults.

The NATEDIT_... variables have the format

'<open-tag>', '<sample-text>', '<close-tag>'
When the respective button is pressed, <open-tag><sample-text><close-tag> will be inserted. If there's a current selection, then it will be used instead of the <sample-text>.

Name Icon Description Default
NATEDIT_BOLD bold text '*', 'Bold text', '*'
NATEDIT_ITALIC italic text '_', 'Italic text', '_'
NATEDIT_MONO monospace text '=', 'Monospace text', '='
NATEDIT_UNDERLINE underlined text '<u>', 'Underlined text', ''
NATEDIT_STRIKE striked text '<strike>', 'Strike through text', '</strike>'
NATEDIT_LEFT left adjusted section '<div style=\"text-align:left\">\n','Align left','\n<\/div>\n'
NATEDIT_RIGHT right adjusted section '<div style=\"text-align:right\">\n','Align right','\n<\/div>\n'
NATEDIT_CENTER centered section '<div style=\"text-align:center\">\n','Center text','\n<\/div>\n'
NATEDIT_JUSTIFY justify section '<div style=\"text-align:justify\">\n','Justify text','\n<\/div>\n'
NATEDIT_H1 headline level 1 '\n---+ ','Headline text','\n'
NATEDIT_H2 headline level 2 '\n---++ ','Headline text','\n'
NATEDIT_H3 headline level 3 '\n---+++ ','Headline text','\n'
NATEDIT_H4 headline level 4 '\n---++++ ','Headline text','\n'
NATEDIT_IMAGE image button <img src=\"%ATTACHURLPATH%/','Example.jpg','\" title=\"Example\" />
or %IMAGE{\"','Example.jpg','|400px|Caption text|frame|center\"}% when the ImagePlugin is installed
NATEDIT_EXTLINK external link '[[http://...][','link text',']]'
NATEDIT_INTLINK internal link '[[','web.topic][link text',']]'
NATEDIT_MATH only visible if the MathModePlugin is installed '<latex title=\"Example\">\n','\\sum_{x=1}^{n}\\frac{1}{x}','\n</latex>'
NATEDIT_SIGNATURE signature button '-- ','%WIKIUSERNAME%',' - %DATE%'
NATEDIT_VERBATIM section ignoring contained wiki markup '<verbatim>\n','Insert non-formatted text here','\n<\/verbatim>\n'
NATEDIT_SUB   subscribed text '<sub>', 'Subscript text' , '</sub>'
NATEDIT_SUP   superscribed text '<sup>', 'Superscript text', '</sup>'
NATEDIT_TABLE   add table creates new table
NATEDIT_NUMBERED   make into numbered point 3 spaces 1 space
NATEDIT_BULLET   make into bullet point 3 spaces * space
NATEDIT_INDENT   indent adds 3 spaces
NATEDIT_UNDENT   un-indent removes 3 spaces, or 3 spaces * space or 3 spaces 1 space

If you want to customize the help text in the bottom part of the editor then set the variable NATEDIT_HELPTEXT to the name of a topic that contains the help text. The default is

* Set NATEDIT_HELPTEXT = %TWIKIWEB%.NatEditHelpText

<-- 
  • Set STUB = %$STUB%
  • Set SHORTDESCRIPTION = A Wikiwyg Editor
-->

Installation Instructions

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.

Like many other TWiki extensions, this module is shipped with a fully automatic installer script written using the BuildContrib.

  • If you have TWiki 4.2 or later, you can install from the configure interface (Go to Plugins->Find More Extensions)
  • If you have any problems, then you can still install manually from the command-line:
    1. Download one of the .zip or .tgz archives
    2. Unpack the archive in the root directory of your TWiki installation.
    3. Run the installer script ( perl <module>_installer )
    4. Run configure and enable the module, if it is a plugin.
    5. Repeat for any missing dependencies.
  • If you are still having problems, then instead of running the installer script:
    1. Make sure that the file permissions allow the webserver user to access all files.
    2. 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)
    3. Manually edit LocalSite.cfg to set any configuration variables.

JSUnitContrib? based Unit tests

There is a small set of browser based unit tests defined in NatEditContribJSUnitTests that can be run as a problem diagnosing tool. These require the installation of TWiki:Plugins.JSUnitContrib, and then can be run from Run all tests

Testing has been carried out using Safari, Firefox, Opera and Internet Explorer.

Contrib Info

Sponsored by Trivadis AG & TWIKI.NET

Author: TWiki:Main/MichaelDaum
Copyright ©: 2007-2008 Michael Daum http://michaeldaumconsulting.com
License: GPL (GNU General Public License)
Version: v1.60
Change History:  
03 Jan 2008 added beforeSubmitHandler to give TWiki:Plugins/EditChapterPlugin a chance to hook in
13 Nov 2007 fixed calculation of textarea offset while autoresizing it to window height, fixed initialization not to use Behaviour anymore, fixed autohide/showing of word toolbar together with tinymce
08 Oct 2007 fixed word toolbar together with TinyMCEPlugin; fixed launching a popup by not relying on twiki's javascript; using css sprites instead of individual buttons
02 Oct 2007 be compatible with TinyMCEPlugin
23 Aug 2007 bug fixes for IE6&7 - Item4430
04 Aug 2007 added Word theme added bullet and numbered lists buttons & Javascript added create Table button and Javascript work done by TWiki:Main.SvenDowideit DistributedINFORMATION for TWIKI.NET
21 May 2007 fixed display of toolbar buttons
01 May 2007 made natedit themable
27 Apr 2007 made all button output configurable; standardized their defaults; fixed javascript in preview mode; added support for TWiki:Plugins/RevCommentPlugin; added monospace button; reworked some of the icons
23 Apr 2007 fixed IE freezing on resizing the edit window
05 Apr 2007 added support for EditContrib and editform
04 Apr 2007 added css file; added monospace <-> propotional font toggles; made signature text customizable; minor refactoring of the javascript; removed non-standard tags FORMATLIST and IFDEFINED
03 Apr 2007 added NATEDIT_HELPTEXT variable; be backwards compatible to PatternSkin (TWiki-4.1.2)
31 Mar 2007 Initial version
Dependencies:
NameVersionDescription
TWiki::Plugins::JQueryPlugin>=0.3Required. Download from the TWiki:Plugins/JQueryPlugin add-on.
Perl Version: -
Plugin Home: TWiki:Plugins/NatEditContrib
Feedback: TWiki:Plugins/NatEditContribDev
Appraisal: TWiki:Plugins/NatEditContribAppraisal

-- TWiki:Main.MichaelDaum - 03 Jan 2008

META FILEATTACHMENT attachment="screenshot1.png" attr="" comment="" date="1175688869" name="screenshot1.png" path="screenshot1.png" size="61040" stream="screenshot1.png" user="TWikiContributor" version="1"
META FILEATTACHMENT attachment="wikiringlogo40x40.png" attr="h" comment="" date="1189787359" name="wikiringlogo40x40.png" path="wikiringlogo40x40.png" size="2571" stream="wikiringlogo40x40.png" tmpFilename="" user="TWikiContributor" version="1"

Revision 1r1 - 03 Jan 2008 - 18:46:34 - TWikiAdminGroup
This site is powered by the TWiki collaboration platform.
All material on this collaboration platform is the property of the contributing authors.
All material marked as authored by Eben Moglen is available under the license terms CC-BY-SA version 4.
Syndicate this site RSSATOM