Power Edit Plugin
OBSOLETE - THIS PLUGIN IS NO LONGER SUPPORTED
It might work, but don't bet on it.
The Plugin formerly known as TWiki:Plugins.PowerEditAddon
The PowerEditPlugin is a plug-in extension to TWiki that supports a Java 1.1 applet text editor. This applet works on most Java-enabled browsers (we haven't tested them all
The applet provides the same editing capabilities as a standard browser text area, and adds some common editor functionality:
- Cut, Copy, Paste - the cut buffer is a static variable in the applet as there is no access to the system cut buffer from an applet. The cut buffer persists over different invocations of PowerEditPlugin, however, and you can always use the cut and paste functions in the browser menus to cut and paste outside the window.
- Undo - undoes up to 100 commands per edit session.
- Do again - repeats the last command.
- Find, Replace - optionally use Emacs style regular expressions as provided by the gnu.regexp library. Replace is currently not smart enough to use field replacement, however.
- Can be invoked in a separate frame.
- Programmable buttons.
- Convertor from HTML to TWiki markup
Configuring the Buttons and Hot keys
Buttons and hotkeys are all created by reading a user-defined topic which is set by the POWEREDIT_CONTROLS variable (see TWikiVariables
). If the variable is not set, the topic TWiki.PowerEditControls is read instead. This allows administrators to set default buttons and keys for the whole installation, for each web, and users can to set up their own controls for the editor by defining this variable in their personal topics. The variable must be set to the full name
(including the web) of the topic that contains the control definitions; for example,
* Set POWEREDIT_CONTROLS = Main.MyPowerEditControls
The control file contains a set of button panel and macro definitions. For example:
"space" = " "
"Tele type" = "/cut/=/paste/="
"^X" = "/cut/"
In this example the first button in the top panel will be labelled "Tele type" and will perform the sequence /cut/=/paste/= - which will cut the currently selected text, enter an '=' sign, paste the text and enter another '=' sign. The second button will be labelled "A Space" and will execute the
macro, which in turn is defined to insert a ' ' character. The key "Ctrl+X" will be defined to perform the /cut/ command.
- The four button panels are named "top", "bottom", "left" and "right"
- There can be as many "macros" blocks as you like
- In button blocks, the name is used as the label on the button
- Control keys are denoted by a leading ^ character and must be in upper case e.g. ^A not ^a. Note that some browsers may not support key definitions.
- The command string is a mixture of basic editor commands (see below) and text to be inserted.
- The usual 'C' escapes are available in names and macro definitions i.e. prepending the character '\' will cause the next character to be interpreted literally. Note that '\/' will still be interpreted as '/' - to escape a '/' in the text, use a double-slash '//'.
- Single-line comments can be inserted into the file by starting a line with the '<' character. Thus HTML tags on a line of their own will be ignored.
- For some unexplained reason it isn't possible to use the PowerEditPlugin on the PowerEditControls file.
The default control definitions for this installation may be viewed here
The following commands are basic to the editor and can be used in button definitions:
|| Copy the currently selected text to the internal cut buffer
|| Cut the currently selected text to the internal cut buffer
|| Invoke the find dialog
|| Paste the internal cut buffer. Will erase the current selection.
|| Undo the last edit
|| Repeats the last command executed (does not repeat typing)
|| Repeat the last find
|| Invoke the replace dialog
|| Repeat the last replacement
|| "yes" or "no"
|| Whether to use a separate window or not
|| Number of columns
|| If useframe=yes, then defines the number of columns width of the edit area. Ignored if useframe=no.
|| Number of rows
|| If useframe=yes, then defines the number of rows height of the edit area. Ignored if useframe=no.
|| The URL that the editor will use to pass information back to the server.
It is a condition of use that any useful customisations are fed back to the TWiki:Plugins.PowerEditPluginDev
page at http://www.twiki.org
PowerEditPlugin Global Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Extend TWiki with a Java 1.1 Applet based text editor.
You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Download the ZIP file from the Plugin web (see below). Contents:
| File: || Description: |
| Ant build file |
| Plugin topic |
| Sample control configuration |
| Specialised skin |
| Specialised skin |
| JAR file |
| Source and test code |
| Plugin script |
PowerEditPlugin.zip in your twiki installation directory.
Related Topics: TWikiPreferences
If you see a message in the text area suggesting that the topic is not locked for edit, try refreshing the page with the applet on (shift+Reload in Netscape, shift+F5 in IE). It's not really a problem, just a side-effect of the security checking in the applet.
All the sources and unit tests are provided with the distribution, together with an Ant build file (see http://www.jakarta.org
) should further customisation be required. The source.zip is shipped in the
directory and when unzipped creates source, packages and test subdirectories. The
directory contains the PowerEdit
applet sources, the
directory contains JUnit unit tests, and the
directory contains the GNU 'regexp' packages, which is used by search and replace, and the kizna HTML parser.
This code is a development of the Architectures and Systems
Platforms group of Motorola Inc. and is protected by the following
- Copyright (C) 2001-2003 Motorola. All Rights Reserved.
As required for the publication of all extensions to TWiki, this
software is published under the terms of the GNU General Public
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details, published at
- 15 Mar 2003