From ef1eb66cc7a8d78c8d0b03738e97da30cad3621b Mon Sep 17 00:00:00 2001 From: PeterThoeny Date: Sun, 14 Dec 2003 00:53:00 +0000 Subject: [PATCH] none --- TWiki/EditTablePlugin.mdwn | 132 +++++++++++++++++++++++++++++---------------- 1 file changed, 85 insertions(+), 47 deletions(-) diff --git a/TWiki/EditTablePlugin.mdwn b/TWiki/EditTablePlugin.mdwn index 29c44de..961aaeb 100644 --- a/TWiki/EditTablePlugin.mdwn +++ b/TWiki/EditTablePlugin.mdwn @@ -1,16 +1,22 @@ -# Edit Table Plugin +# Edit Table Plugin -This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an **[ Edit table ]** button if preceeded by an `%EDITTABLE{...}%` variable. Each column can be a text field, a drop down box or a row number. Multiple tables per topic can be editable, but only one at a time canbe edited. +This plugin allows you to edit TWiki tables using edit fields and drop down boxes. Tables have an **[ Edit table ]** button if preceeded by an `%EDITTABLE{...}%` variable. Each column can be a text field, a drop down box or a row number. Multiple tables per topic are editable, but only one at a time can be edited. -## %TOPIC% Global Settings - -Plugin settings are stored as preferences variables. To reference a plugin setting write **%<plugin>\_<setting>%**, for example, **%INTERWIKIPLUGIN\_SHORTDESCRIPTION%** - -- One line description, shown in the [[TextFormattingRules]] topic: - - Set SHORTDESCRIPTION = Edit TWiki tables using edit fields and drop down boxes. - -- Set DEBUG to 1 to get debug messages in `data/debug.txt`. Default: `0` - - Set DEBUG = 0 +
+ +
## Per Table Settings @@ -29,39 +35,13 @@ Add a `%EDITTABLE{...}%` variable just before an existing table to make it edita format - The format of one row when editing the table. A cell can be a text input field, a drop down box, a fixed label, or a row number. Cell definitions: - - - - - - - - - - - - - - - - - - - - - - - - -
-Text input field (1 line): | text, <size>, <initial value> |
-Textarea input field: | textarea, <rows>x<columns>, <initial value> |
- Drop down box: | select, <size>, <option 1>, <option 2>, etc |
- Fixed label: | label, 0, <label text> |
- Row number: | row, <offset> |
- Date: | date, <sizet> |
- - "text, 16" for all cells + The format of one row when editing the table. A cell can be a text input field, a drop down box, a fixed label, or a row number. Cell definitions:%BR% - Text input field (1 line):%BR%   | text, <size>, <initial value> | %BR% - Textarea input field:%BR%   | textarea, <rows>x<columns>, <initial value> | %BR% - Drop down box: %BR%   | select, <size>, <option 1>, <option 2>, etc | %BR% - Fixed label: %BR%   | label, 0, <label text> | %BR% - Row number: %BR%   | row, <offset> | %BR% - Date: %BR%   | date, <size>, <initial value>, <DHTML date format> | + "text, 16" %BR% for all cells changerows Rows can be added and removed if "on";
Rows can be added but not removed if "add" - "on" + CHANGEROWS %BR% Plugin setting include @@ -100,6 +80,25 @@ Add a `%EDITTABLE{...}%` variable just before an existing table to make it edita +## Table Buttons + +
+ +
+ ## Examples Line before table: `%EDITTABLE{ header="|*Nr*|*Text field sandbox*|*Drop down sandbox*|*Timestamp*|" format="| row, -1 | text, 20, init | select, 1, one, two, three, four | label, 0, %SERVERTIME{"$day $mon $year $hour:$min"}% |" changerows="on" }%` @@ -155,7 +154,35 @@ If this plugin is installed you will see an **[ Edit table ]** button above; 27 Jun 2002 12:40 - (demo only, these buttons do not work) + (demo only, these buttons do not work) + +### Date Field Type + +Edit Table Calendar Example The `date` field type allows one to choose a date with a popup calendar. Popup calendar works for Netscape 6.0 or better, all other Gecko-based browsers, Internet Explorer 5.0 or better for Windows, Opera 7 and Konqueror 3.1.2. The `...` button is inactive if the browser cannot support the popup calendar. It uses the nice [Mishoo DHTML calendar](http://dynarch.com/mishoo/calendar.epl), see also TWiki:Codev/JavaScriptDatePickerForForm
+ +## Plugin Settings + +Plugin settings are stored as preferences variables. To reference a plugin setting write **%<plugin>\_<setting>%**, for example, **%EDITTABLEPLUGIN\_SHORTDESCRIPTION%** + +- One line description, shown in the [[TextFormattingRules]] topic: + - Set SHORTDESCRIPTION = Edit TWiki tables using edit fields and drop down boxes + +- Set DEBUG to 1 to get debug messages in `data/debug.txt`. Default: `0` + - Set DEBUG = 0 + +- Default for change rows flag: `on`, `off`, `add` + - Set CHANGEROWS = on + +- Date format of [Mishoo DHTML calendar](http://dynarch.com/mishoo/calendar.epl): + - Set JSCALENDARDATEFORMAT = %Y/%m/%d + +- Language of DHTML calendar, pointing to attached `calendar-.js` language file: `en`, `de`, `es`, `fr`, `jp` + - Set JSCALENDARLANGUAGE = en + +- Additional options of DHTML calendar: + - Set JSCALENDAROPTIONS = + +**_Note:_** The Plugin looks for the `JSCALENDAR*` settings first in the TWiki Preferences, then in above Plugin settings ## Limitations and Known Issues @@ -166,10 +193,11 @@ If this plugin is installed you will see an **[ Edit table ]** button above; - %RED% **Warning:** %ENDCOLOR% This plugin uses undocumented functions to read, save and lock a topic. The plugin will likely break in a future TWiki release. - You cannot put two %EDITTABLE% statements on the same line in the source. - You can include %-vars now in select values, by quoting them with <nop>, as in %<nop>X% for %X%, say for instance:
`select,1,%X%,%Y%` -- `date` field type for the `format` parameter adds a button popping a javascript calendar to choose the date on browsers supporting it. It uses the nice **Mishoo DHTML calendar** at , that should be included in Cairo release, or see TWiki:Codev/JavaScriptDatePickerForForm for installing it on Beijing Release ## Plugin Installation Instructions +**_Note:_** 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) - Unzip **%TOPIC%.zip** in your twiki installation directory. Content: @@ -190,26 +218,36 @@ If this plugin is installed you will see an **[ Edit table ]** button above;
- The plugin depends on the `viewauth` script to authenticate the user. As described in [[TWikiAccessControl]], copy the `view` script to `viewauth` (or better, create a symbolic link) and add `viewauth` to the list of authenticated scripts in the `.htaccess` file. +- The Mishoo DHTML calendar 0.9.5 is preinstalled and should work without any configuration. If you wish to use another language, attach the language files to the Plugin topic and change the Plugin settings - Test if the plugin is correctly installed: - Check above example if there is an **[ Edit table ]** button below the table in above example - Click on **[ Edit table ]**, make changes and save the table +## License + +- The Edit Table Plugin is released under the [GPL](http://www.gnu.org/licenses/gpl.html) +- The [Mishoo DHTML calendar](http://dynarch.com/mishoo/calendar.epl) bundled with this Plugin was created by Mihai Bazon and is released under the [LGPL](http://www.gnu.org/licenses/lgpl.html) -- thanks Mihai for the great tool :-) + ## Plugin Info - + - + + + + + @@ -227,7 +265,7 @@ If this plugin is installed you will see an **[ Edit table ]** button above; - + @@ -267,7 +305,7 @@ If this plugin is installed you will see an **[ Edit table ]** button above; - + @@ -285,4 +323,4 @@ If this plugin is installed you will see an **[ Edit table ]** button above; **_Related Topics:_** [[TWikiPreferences]], [[TWikiPlugins]] --- [[PeterThoeny]] - 08 Nov 2002 +-- TWiki:Main/PeterThoeny - 13 Dec 2003 -- 1.9.4
Plugin Author: [[TWiki/PeterThoeny]] TWiki:Main/PeterThoeny
Plugin Version: 16 Oct 2003 13 Dec 2003
Change History:  
13 Dec 2003: Added CHANGEROWS, JSCALENDARDATEFORMAT, JSCALENDARLANGUAGE, JSCALENDAROPTIONS settings
16 Oct 2003: small typo fixed (garbled if ---+ header on top)
18 Sep 2003: incompatibility: changed default of changerows to =on=
support for %-vars, Quietsave for saving without notification, all other fixes in Dev topic integrated - CN
incompatibility: changed default of changerows to on; support for %-vars, Quiet save for saving without notification; all other fixes in Dev topic integrated - CN
08 Nov 2002:
Other Dependencies: none Mishoo DHTML calendar (version 0.9.5 preinstalled)
Perl Version: