1 // Plugin for htmlArea to run code through the server's HTML Tidy
2 // By Adam Wright, for The University of Western Australia
4 // Email: zeno@ucc.gu.uwa.edu.au
5 // Homepage: http://blog.hipikat.org/
7 // Distributed under the same terms as HTMLArea itself.
8 // This notice MUST stay intact for use (see license.txt).
11 // Released to the outside world: 04/03/04
14 HtmlTidy is a plugin for the popular cross-browser TTY WYSIWYG editor,
15 htmlArea (http://www.interactivetools.com/products/htmlarea/). HtmlTidy
16 basically queries HTML Tidy (http://tidy.sourceforge.net/) on the
17 server side, getting it to make-html-nice, instead of relying on masses
18 of javascript, which the client would have to download.
20 Hi, this is a quick explanation of how to install HtmlTidy. Much better
21 documentation is probably required, and you're welcome to write it :)
24 * The HtmlTidy directory you should have found this file in should
25 include the following:
28 This file, providing help installing the plugin.
30 - html-tidy-config.cfg
31 This file contains the configuration options HTML Tidy uses to
32 clean html, and can be modified to suit your organizations
36 This is the php script, which is queried with dirty html and is
37 responsible for invoking HTML Tidy, getting nice new html and
38 returning it to the client.
41 The main htmlArea plugin, providing functionality to tidy html
42 through the htmlArea interface.
44 - htmlarea.js.onmode_event.diff
45 At the time of publishing, an extra event handler was required
46 inside the main htmlarea.js file. htmlarea.js may be patched
47 against this file to make the changes reuquired, but be aware
48 that the event handler may either now be in the core or
49 htmlarea.js may have changed enough to invalidate the patch.
51 UPDATE: now it exists in the official htmlarea.js; applying
52 this patch is thus no longer necessary.
55 The HtmlTidy icon, for the htmlArea toolbar. Created by Dan
56 Petty for The University of Western Australia.
59 English language file. Add your own language files here and
60 please contribute back into the htmlArea community!
62 The HtmlArea directory should be extracted to your htmlarea/plugins/
66 * Make sure the onMode event handler mentioned above, regarding
67 htmlarea.js.onmode_event.diff, exists in your htmlarea.js
70 * html-tidy-logic.php should be executable, and your web server should
71 be configured to execute php scripts in the directory
72 html-tidy-logic.php exists in.
75 * HTML Tidy needs to be installed on your server, and 'tidy' should be
76 an alias to it, lying in the PATH known to the user executing such
80 * In your htmlArea configuration, do something like this:
82 HTMLArea.loadPlugin("HtmlTidy");
84 editor = new HTMLArea("doc");
85 editor.registerPlugin("HtmlTidy");
88 * Then, in your htmlArea toolbar configuration, use:
91 This will create the 'tidy broom' icon on the toolbar, which
92 will attempt to tidy html source when clicked, and;
95 This will create an "Auto Tidy" / "Don't Tidy" dropdown, to
96 select whether the source should be tidied automatically when
97 entering source view. On by default, if you'd like it otherwise
98 you can do so programatically after generating the toolbar :)
99 (Or just hack it to be otherwise...)
104 Any bugs you find can be emailed to zeno@ucc.gu.uwa.edu.au