Revision: 9661
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=9661&view=rev
Author:   dnaber
Date:     2013-03-10 14:45:31 +0000 (Sun, 10 Mar 2013)
Log Message:
-----------
document how to put a text area with LT on a web page, using our public LT REST 
service

Modified Paths:
--------------
    trunk/website/include/header.php
    trunk/website/include/help.php
    trunk/website/www/usage/index.php

Added Paths:
-----------
    trunk/website/include/geshi/html4strict.php
    trunk/website/include/geshi/javascript.php
    trunk/website/www/website-integration/
    trunk/website/www/website-integration/index.php

Added: trunk/website/include/geshi/html4strict.php
===================================================================
--- trunk/website/include/geshi/html4strict.php                         (rev 0)
+++ trunk/website/include/geshi/html4strict.php 2013-03-10 14:45:31 UTC (rev 
9661)
@@ -0,0 +1,255 @@
+<?php
+/*************************************************************************************
+ * html4strict.php
+ * ---------------
+ * Author: Nigel McNie ([email protected])
+ * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
+ * Release Version: 1.0.7.20
+ * Date Started: 2004/07/10
+ *
+ * HTML 4.01 strict language file for GeSHi.
+ *
+ * CHANGES
+ * -------
+ * 2005/12/28 (1.0.4)
+ *   -  Removed escape character for strings
+ * 2004/11/27 (1.0.3)
+ *   -  Added support for multiple object splitters
+ * 2004/10/27 (1.0.2)
+ *   -  Added support for URLs
+ * 2004/08/05 (1.0.1)
+ *   -  Added INS and DEL
+ *   -  Removed the background colour from tags' styles
+ * 2004/07/14 (1.0.0)
+ *   -  First Release
+ *
+ * TODO (updated 2004/11/27)
+ * -------------------------
+ * * Check that only HTML4 strict attributes are highlighted
+ * * Eliminate empty tags that aren't allowed in HTML4 strict
+ * * Split to several files - html4trans, xhtml1 etc
+ *
+ 
*************************************************************************************
+ *
+ *     This file is part of GeSHi.
+ *
+ *   GeSHi is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   GeSHi 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.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with GeSHi; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ 
************************************************************************************/
+
+$language_data = array (
+       'LANG_NAME' => 'HTML',
+       'COMMENT_SINGLE' => array(),
+       'COMMENT_MULTI' => array('<!--' => '-->'),
+       'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+       'QUOTEMARKS' => array("'", '"'),
+       'ESCAPE_CHAR' => '',
+       'KEYWORDS' => array(
+               1 => array(
+                       ),
+               2 => array(
+                       '&lt;a&gt;', '&lt;abbr&gt;', '&lt;acronym&gt;', 
'&lt;address&gt;', '&lt;applet&gt;',
+                       '&lt;a', '&lt;abbr', '&lt;acronym', '&lt;address', 
'&lt;applet',
+                       '&lt;/a&gt;', '&lt;/abbr&gt;', '&lt;/acronym&gt;', 
'&lt;/address&gt;', '&lt;/applet&gt;',
+                       '&lt;/a', '&lt;/abbr', '&lt;/acronym', '&lt;/address', 
'&lt;/applet',
+
+                       '&lt;base&gt;', '&lt;basefont&gt;', '&lt;bdo&gt;', 
'&lt;big&gt;', '&lt;blockquote&gt;', '&lt;body&gt;', '&lt;br&gt;', 
'&lt;button&gt;', '&lt;b&gt;',
+                       '&lt;base', '&lt;basefont', '&lt;bdo', '&lt;big', 
'&lt;blockquote', '&lt;body', '&lt;br', '&lt;button', '&lt;b',
+                       '&lt;/base&gt;', '&lt;/basefont&gt;', '&lt;/bdo&gt;', 
'&lt;/big&gt;', '&lt;/blockquote&gt;', '&lt;/body&gt;', '&lt;/br&gt;', 
'&lt;/button&gt;', '&lt;/b&gt;',
+                       '&lt;/base', '&lt;/basefont', '&lt;/bdo', '&lt;/big', 
'&lt;/blockquote', '&lt;/body', '&lt;/br', '&lt;/button', '&lt;/b',
+
+                       '&lt;caption&gt;', '&lt;center&gt;', '&lt;cite&gt;', 
'&lt;code&gt;', '&lt;colgroup&gt;', '&lt;col&gt;',
+                       '&lt;caption', '&lt;center', '&lt;cite', '&lt;code', 
'&lt;colgroup', '&lt;col',
+                       '&lt;/caption&gt;', '&lt;/center&gt;', '&lt;/cite&gt;', 
'&lt;/code&gt;', '&lt;/colgroup&gt;', '&lt;/col&gt;',
+                       '&lt;/caption', '&lt;/center', '&lt;/cite', 
'&lt;/code', '&lt;/colgroup', '&lt;/col',
+
+                       '&lt;dd&gt;', '&lt;del&gt;', '&lt;dfn&gt;', 
'&lt;dir&gt;', '&lt;div&gt;', '&lt;dl&gt;', '&lt;dt&gt;',
+                       '&lt;dd', '&lt;del', '&lt;dfn', '&lt;dir', '&lt;div', 
'&lt;dl', '&lt;dt',
+                       '&lt;/dd&gt;', '&lt;/del&gt;', '&lt;/dfn&gt;', 
'&lt;/dir&gt;', '&lt;/div&gt;', '&lt;/dl&gt;', '&lt;/dt&gt;',
+                       '&lt;/dd', '&lt;/del', '&lt;/dfn', '&lt;/dir', 
'&lt;/div', '&lt;/dl', '&lt;/dt',
+
+                       '&lt;em&gt;',
+                       '&lt;em',
+                       '&lt;/em&gt;',
+                       '&lt;/em',
+
+                       '&lt;fieldset&gt;', '&lt;font&gt;', '&lt;form&gt;', 
'&lt;frame&gt;', '&lt;frameset&gt;',
+                       '&lt;fieldset', '&lt;font', '&lt;form', '&lt;frame', 
'&lt;frameset',
+                       '&lt;/fieldset&gt;', '&lt;/font&gt;', '&lt;/form&gt;', 
'&lt;/frame&gt;', '&lt;/frameset&gt;',
+                       '&lt;/fieldset', '&lt;/font', '&lt;/form', 
'&lt;/frame', '&lt;/frameset',
+
+                       '&lt;h1&gt;', '&lt;h2&gt;', '&lt;h3&gt;', '&lt;h4&gt;', 
'&lt;h5&gt;', '&lt;h6&gt;', '&lt;head&gt;', '&lt;hr&gt;', '&lt;html&gt;',
+                       '&lt;h1', '&lt;h2', '&lt;h3', '&lt;h4', '&lt;h5', 
'&lt;h6', '&lt;head', '&lt;hr', '&lt;html',
+                       '&lt;/h1&gt;', '&lt;/h2&gt;', '&lt;/h3&gt;', 
'&lt;/h4&gt;', '&lt;/h5&gt;', '&lt;/h6&gt;', '&lt;/head&gt;', '&lt;/hr&gt;', 
'&lt;/html&gt;',
+                       '&lt;/h1', '&lt;/h2', '&lt;/h3', '&lt;/h4', '&lt;/h5', 
'&lt;/h6', '&lt;/head', '&lt;/hr', '&lt;/html',
+
+                       '&lt;iframe&gt;', '&lt;ilayer&gt;', '&lt;img&gt;', 
'&lt;input&gt;', '&lt;ins&gt;', '&lt;isindex&gt;', '&lt;i&gt;',
+                       '&lt;iframe', '&lt;ilayer', '&lt;img', '&lt;input', 
'&lt;ins', '&lt;isindex', '&lt;i',
+                       '&lt;/iframe&gt;', '&lt;/ilayer&gt;', '&lt;/img&gt;', 
'&lt;/input&gt;', '&lt;/ins&gt;', '&lt;/isindex&gt;', '&lt;/i&gt;',
+                       '&lt;/iframe', '&lt;/ilayer', '&lt;/img', '&lt;/input', 
'&lt;/ins', '&lt;/isindex', '&lt;/i',
+
+                       '&lt;kbd&gt;',
+                       '&lt;kbd',
+                       '&t;/kbd&gt;',
+                       '&lt;/kbd',
+
+                       '&lt;label&gt;', '&lt;legend&gt;', '&lt;link&gt;', 
'&lt;li&gt;',
+                       '&lt;label', '&lt;legend', '&lt;link', '&lt;li',
+                       '&lt;/label&gt;', '&lt;/legend&gt;', '&lt;/link&gt;', 
'&lt;/li&gt;',
+                       '&lt;/label', '&lt;/legend', '&lt;/link', '&lt;/li',
+
+                       '&lt;map&gt;', '&lt;meta&gt;',
+                       '&lt;map', '&lt;meta',
+                       '&lt;/map&gt;', '&lt;/meta&gt;',
+                       '&lt;/map', '&lt;/meta',
+
+                       '&lt;noframes&gt;', '&lt;noscript&gt;',
+                       '&lt;noframes', '&lt;noscript',
+                       '&lt;/noframes&gt;', '&lt;/noscript&gt;',
+                       '&lt;/noframes', '&lt;/noscript',
+
+                       '&lt;object&gt;', '&lt;ol&gt;', '&lt;optgroup&gt;', 
'&lt;option&gt;',
+                       '&lt;object', '&lt;ol', '&lt;optgroup', '&lt;option',
+                       '&lt;/object&gt;', '&lt;/ol&gt;', '&lt;/optgroup&gt;', 
'&lt;/option&gt;',
+                       '&lt;/object', '&lt;/ol', '&lt;/optgroup', 
'&lt;/option',
+
+                       '&lt;param&gt;', '&lt;pre&gt;', '&lt;p&gt;',
+                       '&lt;param', '&lt;pre', '&lt;p',
+                       '&lt;/param&gt;', '&lt;/pre&gt;', '&lt;/p&gt;',
+                       '&lt;/param', '&lt;/pre', '&lt;/p',
+
+                       '&lt;q&gt;',
+                       '&lt;q',
+                       '&lt;/q&gt;',
+                       '&lt;/q',
+
+                       '&lt;samp&gt;', '&lt;script&gt;', '&lt;select&gt;', 
'&lt;small&gt;', '&lt;span&gt;', '&lt;strike&gt;', '&lt;strong&gt;', 
'&lt;style&gt;', '&lt;sub&gt;', '&lt;sup&gt;', '&lt;s&gt;',
+                       '&lt;samp', '&lt;script', '&lt;select', '&lt;small', 
'&lt;span', '&lt;strike', '&lt;strong', '&lt;style', '&lt;sub', '&lt;sup', 
'&lt;s',
+                       '&lt;/samp&gt;', '&lt;/script&gt;', '&lt;/select&gt;', 
'&lt;/small&gt;', '&lt;/span&gt;', '&lt;/strike&gt;', '&lt;/strong&gt;', 
'&lt;/style&gt;', '&lt;/sub&gt;', '&lt;/sup&gt;', '&lt;/s&gt;',
+                       '&lt;/samp', '&lt;/script', '&lt;/select', 
'&lt;/small', '&lt;/span', '&lt;/strike', '&lt;/strong', '&lt;/style', 
'&lt;/sub', '&lt;/sup', '&lt;/s',
+
+                       '&lt;table&gt;', '&lt;tbody&gt;', '&lt;td&gt;', 
'&lt;textarea&gt;', '&lt;text&gt;', '&lt;tfoot&gt;', '&lt;thead&gt;', 
'&lt;th&gt;', '&lt;title&gt;', '&lt;tr&gt;', '&lt;tt&gt;',
+                       '&lt;table', '&lt;tbody', '&lt;td', '&lt;textarea', 
'&lt;text', '&lt;tfoot', '&lt;tfoot', '&lt;thead', '&lt;th', '&lt;title', 
'&lt;tr', '&lt;tt',
+                       '&lt;/table&gt;', '&lt;/tbody&gt;', '&lt;/td&gt;', 
'&lt;/textarea&gt;', '&lt;/text&gt;', '&lt;/tfoot&gt;', '&lt;/thead', 
'&lt;/tfoot', '&lt;/th&gt;', '&lt;/title&gt;', '&lt;/tr&gt;', '&lt;/tt&gt;',
+                       '&lt;/table', '&lt;/tbody', '&lt;/td', '&lt;/textarea', 
'&lt;/text', '&lt;/tfoot', '&lt;/tfoot', '&lt;/thead', '&lt;/th', '&lt;/title', 
'&lt;/tr', '&lt;/tt',
+
+                       '&lt;ul&gt;', '&lt;u&gt;',
+                       '&lt;ul', '&lt;u',
+                       '&lt;/ul&gt;', '&lt;/ul&gt;',
+                       '&lt;/ul', '&lt;/u',
+
+                       '&lt;var&gt;',
+                       '&lt;var',
+                       '&lt;/var&gt;',
+                       '&lt;/var',
+
+                       '&gt;', '&lt;'
+                       ),
+               3 => array(
+                       'abbr', 'accept-charset', 'accept', 'accesskey', 
'action', 'align', 'alink', 'alt', 'archive', 'axis',
+                       'background', 'bgcolor', 'border',
+                       'cellpadding', 'cellspacing', 'char', 'char', 
'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 
'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 
'coords',
+                       'data', 'datetime', 'declare', 'defer', 'dir', 
'disabled',
+                       'enctype',
+                       'face', 'for', 'frame', 'frameborder',
+                       'headers', 'height', 'href', 'hreflang', 'hspace', 
'http-equiv',
+                       'id', 'ismap',
+                       'label', 'lang', 'language', 'link', 'longdesc',
+                       'marginheight', 'marginwidth', 'maxlength', 'media', 
'method', 'multiple',
+                       'name', 'nohref', 'noresize', 'noshade', 'nowrap',
+                       'object', 'onblur', 'onchange', 'onclick', 
'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 
'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 
'onreset', 'onselect', 'onsubmit', 'onunload',
+                       'profile', 'prompt',
+                       'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules',
+                       'scheme', 'scope', 'scrolling', 'selected', 'shape', 
'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
+                       'tabindex', 'target', 'text', 'title', 'type',
+                       'usemap',
+                       'valign', 'value', 'valuetype', 'version', 'vlink', 
'vspace',
+                       'width'
+                       )
+               ),
+       'SYMBOLS' => array(
+               '/', '='
+               ),
+       'CASE_SENSITIVE' => array(
+               GESHI_COMMENTS => false,
+               1 => false,
+               2 => false,
+               3 => false,
+               ),
+       'STYLES' => array(
+               'KEYWORDS' => array(
+                       1 => 'color: #b1b100;',
+                       2 => 'color: #000000; font-weight: bold;',
+                       3 => 'color: #000066;'
+                       ),
+               'COMMENTS' => array(
+                       'MULTI' => 'color: #808080; font-style: italic;'
+                       ),
+               'ESCAPE_CHAR' => array(
+                       0 => 'color: #000099; font-weight: bold;'
+                       ),
+               'BRACKETS' => array(
+                       0 => 'color: #66cc66;'
+                       ),
+               'STRINGS' => array(
+                       0 => 'color: #ff0000;'
+                       ),
+               'NUMBERS' => array(
+                       0 => 'color: #cc66cc;'
+                       ),
+               'METHODS' => array(
+                       ),
+               'SYMBOLS' => array(
+                       0 => 'color: #66cc66;'
+                       ),
+               'SCRIPT' => array(
+                       0 => 'color: #00bbdd;',
+                       1 => 'color: #ddbb00;',
+                       2 => 'color: #009900;'
+                       ),
+               'REGEXPS' => array(
+                       )
+               ),
+       'URLS' => array(
+               1 => '',
+               2 => 'http://december.com/html/4/element/{FNAME}.html',
+               3 => ''
+               ),
+       'OOLANG' => false,
+       'OBJECT_SPLITTERS' => array(
+               ),
+       'REGEXPS' => array(
+               ),
+       'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
+       'SCRIPT_DELIMITERS' => array(
+               0 => array(
+                       '<!DOCTYPE' => '>'
+                       ),
+               1 => array(
+                       '&' => ';'
+                       ),
+               2 => array(
+                       '<' => '>'
+                       )
+       ),
+       'HIGHLIGHT_STRICT_BLOCK' => array(
+               0 => false,
+               1 => false,
+               2 => true
+        ),
+    'TAB_WIDTH' => 4
+);
+
+?>

Added: trunk/website/include/geshi/javascript.php
===================================================================
--- trunk/website/include/geshi/javascript.php                          (rev 0)
+++ trunk/website/include/geshi/javascript.php  2013-03-10 14:45:31 UTC (rev 
9661)
@@ -0,0 +1,144 @@
+<?php
+/*************************************************************************************
+ * javascript.php
+ * --------------
+ * Author: Ben Keen ([email protected])
+ * Copyright: (c) 2004 Ben Keen ([email protected]), Nigel McNie 
(http://qbnz.com/highlighter)
+ * Release Version: 1.0.7.20
+ * Date Started: 2004/06/20
+ *
+ * JavaScript language file for GeSHi.
+ *
+ * CHANGES
+ * -------
+ * 2004/11/27 (1.0.1)
+ *  -  Added support for multiple object splitters
+ * 2004/10/27 (1.0.0)
+ *  -  First Release
+ *
+ * TODO (updated 2004/11/27)
+ * -------------------------
+ *
+ 
*************************************************************************************
+ *
+ *     This file is part of GeSHi.
+ *
+ *   GeSHi is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   GeSHi 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.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with GeSHi; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ 
************************************************************************************/
+
+$language_data = array (
+  'LANG_NAME' => 'Javascript',
+  'COMMENT_SINGLE' => array(1 => '//'),
+  'COMMENT_MULTI' => array('/*' => '*/'),
+  'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+  'QUOTEMARKS' => array("'", '"'),
+  'ESCAPE_CHAR' => '\\',
+  'KEYWORDS' => array(
+    1 => array(
+      'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
+      'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
+      'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 
'void',
+      'while', 'write', 'with'
+      ),
+    2 => array(
+      'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
+      'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
+      'protected', 'public', 'super', 'true', 'use', 'var'
+      ),
+    3 => array(
+
+      // common functions for Window object
+      'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home',
+      'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
+      'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status',
+      'stop',
+      )
+    ),
+  'SYMBOLS' => array(
+    '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>'
+    ),
+  'CASE_SENSITIVE' => array(
+    GESHI_COMMENTS => false,
+    1 => false,
+    2 => false,
+    3 => false
+    ),
+  'STYLES' => array(
+    'KEYWORDS' => array(
+      1 => 'color: #000066; font-weight: bold;',
+      2 => 'color: #003366; font-weight: bold;',
+      3 => 'color: #000066;'
+      ),
+    'COMMENTS' => array(
+      1 => 'color: #009900; font-style: italic;',
+      'MULTI' => 'color: #009900; font-style: italic;'
+      ),
+    'ESCAPE_CHAR' => array(
+      0 => 'color: #000099; font-weight: bold;'
+      ),
+    'BRACKETS' => array(
+      0 => 'color: #66cc66;'
+      ),
+    'STRINGS' => array(
+      0 => 'color: #3366CC;'
+      ),
+    'NUMBERS' => array(
+      0 => 'color: #CC0000;'
+      ),
+    'METHODS' => array(
+      1 => 'color: #006600;'
+      ),
+    'SYMBOLS' => array(
+      0 => 'color: #66cc66;'
+      ),
+    'REGEXPS' => array(
+      0 => 'color: #0066FF;'
+      ),
+    'SCRIPT' => array(
+      0 => '',
+      1 => '',
+      2 => '',
+      3 => ''
+      )
+    ),
+  'URLS' => array(
+               1 => '',
+               2 => '',
+               3 => ''
+       ),
+  'OOLANG' => true,
+  'OBJECT_SPLITTERS' => array(
+       1 => '.'
+       ),
+  'REGEXPS' => array(
+    0 => "/.*/([igm]*)?"         // matches js reg exps
+    ),
+  'STRICT_MODE_APPLIES' => GESHI_MAYBE,
+  'SCRIPT_DELIMITERS' => array(
+    0 => array(
+      '<script type="text/javascript">' => '</script>'
+      ),
+    1 => array(
+      '<script language="javascript">' => '</script>'
+      )
+    ),
+  'HIGHLIGHT_STRICT_BLOCK' => array(
+    0 => true,
+    1 => true
+  )
+);
+
+?>

Modified: trunk/website/include/header.php
===================================================================
--- trunk/website/include/header.php    2013-03-10 12:46:28 UTC (rev 9660)
+++ trunk/website/include/header.php    2013-03-10 14:45:31 UTC (rev 9661)
@@ -215,6 +215,16 @@
           <?php
            }
 
+           if ($page == "web-integration") {
+             ?>
+          <div class="submenuitem activeMenuitem">Website Integration</div>
+          <?php
+           } else {
+             ?>
+          <div class="submenuitem"><a href="<?php print $rootUrl 
?>/website-integration">Website Integration</a></div>
+          <?php
+           }
+
            if ($page == "links") {
              ?>
           <div class="submenuitem activeMenuitem">Links</div>

Modified: trunk/website/include/help.php
===================================================================
--- trunk/website/include/help.php      2013-03-10 12:46:28 UTC (rev 9660)
+++ trunk/website/include/help.php      2013-03-10 14:45:31 UTC (rev 9661)
@@ -11,6 +11,18 @@
        print "<div class='".$class."'>".$geshi->parse_code()."</div>";
 }
 
+function hlJavascript($code, $class="xmlcode") {
+       $geshi = new GeSHi($code, "Javascript", "../../include/geshi/");
+       $geshi->set_header_type(GESHI_HEADER_NONE);
+       print "<div class='".$class."'>".$geshi->parse_code()."</div>";
+}
+
+function hlHtml($code, $class="xmlcode") {
+       $geshi = new GeSHi($code, "html4strict", "../../include/geshi/");
+       $geshi->set_header_type(GESHI_HEADER_NONE);
+       print "<div class='".$class."'>".$geshi->parse_code()."</div>";
+}
+
 function show_simple_link($title, $url) {
     $html = "<a href='".$url."'>".$title."</a>";
     return $html;

Modified: trunk/website/www/usage/index.php
===================================================================
--- trunk/website/www/usage/index.php   2013-03-10 12:46:28 UTC (rev 9660)
+++ trunk/website/www/usage/index.php   2013-03-10 14:45:31 UTC (rev 9661)
@@ -2,7 +2,7 @@
 $page = "usage";
 $title = "LanguageTool";
 $title2 = "Usage";
-$lastmod = "2012-01-05 17:40:00 CET";
+$lastmod = "2013-03-10 15:40:00 CET";
 include("../../include/header.php");
 include('../../include/geshi/geshi.php');
 ?>
@@ -41,6 +41,13 @@
        <p>Use <tt>java -jar LanguageTool.jar --help</tt> to get detailed usage 
information.</p>
 
 
+<h2>Embedding LanguageTool on a Web Page</h2>
+
+<ul>
+  <li><?=show_link("Integration on Websites", "$rootUrl/website-integration/", 
0) ?></li>
+</ul>
+
+
 <h2>Embedding LanguageTool from other Applications</h2>
 
 <ul>

Added: trunk/website/www/website-integration/index.php
===================================================================
--- trunk/website/www/website-integration/index.php                             
(rev 0)
+++ trunk/website/www/website-integration/index.php     2013-03-10 14:45:31 UTC 
(rev 9661)
@@ -0,0 +1,167 @@
+<?php
+$page = "web-integration";
+$title = "LanguageTool";
+$title2 = "Integration on Websites";
+$lastmod = "2013-03-10 17:40:00 CET";
+include("../../include/header.php");
+include('../../include/geshi/geshi.php');
+?>
+
+<p class="firstpara">You can offer a text area for proofreading texts on own 
web page, just
+like we do on <a href="../">our homepage</a>. This will make use of <a 
href="../http-api/">our public REST service</a>
+so you don't have to install anything but a few files. The text will be sent 
to our server, and the result
+will be send back to the user's browser where potential errors will be 
underlined.
+For now, this way of integration assumes that your server supports PHP and 
that its PHP
+has <a href="http://php.net/manual/en/book.curl.php";>support for curl</a>.</p>
+
+<p>These are the three steps needed to integrate LanguageTool on a web 
page:</p>
+
+<ol>
+  <li>Add Javascript includes and initialization code of the textarea in the 
<tt>&lt;head&gt;</tt> section of your page</li>
+  <li>Add HTML code for the textarea</li>
+  <li>Add the PHP proxy</li>
+</ol>
+
+<p>We will now describe the installation in detail.</p>
+
+<h2>Javascript includes and initialization code</h2>
+
+<p>Add the following code to the <tt>&lt;head&gt;</tt> section of your 
page:</p>
+
+<div class="xmlrule">
+<?php hlJavascript('<script type="text/javascript"
+    src="http://www.languagetool.org/js/jquery-1.4.min.js";></script>
+<script type="text/javascript"
+    
src="http://www.languagetool.org/online-check/tiny_mce/tiny_mce.js";></script>
+<script type="text/javascript"
+    
src="http://www.languagetool.org/online-check/tiny_mce/plugins/atd-tinymce/editor_plugin.js";></script>
+
+<script language="javascript" type="text/javascript">  
+  tinyMCE.init({
+     mode : "textareas",
+     plugins : "AtD,paste",
+     paste_text_sticky : true,
+     setup : function(ed) {
+         ed.onInit.add(function(ed) {
+             ed.pasteAsPlainText = true;
+         });
+     },  
+     /* translations: */
+     languagetool_i18n_no_errors : {
+         // "No errors were found.":
+         "de-DE": "Keine Fehler gefunden."
+     },
+     languagetool_i18n_explain : {
+         // "Explain..." - shown if there is an URL with a detailed 
description:
+         "de-DE": "Mehr Informationen..."
+     },
+     languagetool_i18n_ignore_once : {
+         // "Ignore this error":
+         "de-DE": "Hier ignorieren"
+     },
+     languagetool_i18n_ignore_all : {
+         // "Ignore this kind of error":
+         "de-DE": "Fehler dieses Typs ignorieren"
+     },
+  
+     languagetool_i18n_current_lang :
+         function() { return document.checkform.lang.value; },
+     /* the URL of your proxy file - must be hosted on your domain: */
+     languagetool_rpc_url : "proxy.php?url=",
+     /* edit this file to customize how LanguageTool shows errors: */
+     languagetool_css_url :
+         "http://www.languagetool.org/online-check/"; +
+         "tiny_mce/plugins/atd-tinymce/css/content.css",
+     /* this stuff is a matter of preference: */
+     theme                              : "advanced",
+     theme_advanced_buttons1            : "",
+     theme_advanced_buttons2            : "",
+     theme_advanced_buttons3            : "",
+     theme_advanced_toolbar_location    : "none",
+     theme_advanced_toolbar_align       : "left",
+     theme_advanced_statusbar_location  : "bottom",
+     theme_advanced_path                : false,
+     theme_advanced_resizing            : true,
+     theme_advanced_resizing_use_cookie : false,
+     gecko_spellcheck                   : false
+  });
+  
+  function doit() {
+     var langCode = document.checkform.lang.value;
+     tinyMCE.activeEditor.execCommand("mceWritingImprovementTool", langCode);
+  }
+</script>
+'); ?>
+</div>
+
+<p>To be robust against changes on our server, you might want to download the 
files linked
+in the <tt>script</tt> elements and adapt the code accordingly. You can add 
translations
+for your language in the "translations" section.</p>
+
+
+
+<h2>HTML code for the textarea</h2>
+
+<p>Add this code at the place where you want the textarea to show up:</p>
+
+<div class="xmlrule">
+<?php hlHtml('<form name="checkform" 
action="http://community.languagetool.org"; method="post">
+              
+  <p id="checktextpara">
+      <textarea id="checktext" name="text" style="width: 100%" 
+        rows="6">Paste your own text here... or check check this 
text.</textarea>
+  </p>
+  
+  <div style="margin-top:0px; text-align: right">
+      <select name="lang" id="lang">
+          <option value="en-US">English</option>
+          <option value="de-DE">German</option>
+          <option value="it">Italian</option>
+      </select>
+      <input type="submit" name="_action_checkText"
+          value="Check Text" onClick="doit();return false;">
+  </div>
+
+</form>'); ?>
+</div>
+
+<ul>
+  <li>You can add as many languages as you want to the <tt>select</tt> element 
- see the 
+      <a href="../languages/">list of languages supported by 
LanguageTool</a>.</li>
+  <li>This textarea requires Javascript to work - if Javascript is not 
activated in the user's browser
+      or there's some other technical problem, the user will not get 
underlined errors but will instead
+      be redirected to <a 
href="http://community.languagetool.org";>community.languagetool.org</a> where
+      the checking result will be shown.</li>
+  <li>Depending on what kind of texts you expect your users to submit, you 
should consider supporting https
+      for encryption. The communication between the proxy on your server and 
our public server is encrypted, but the
+      communication between the user's browser and your proxy is not if you're 
using http instead of https.</li>
+</ul>
+
+
+
+<h2>PHP Proxy</h2>
+
+<p>Download the 
+<a 
href="https://languagetool.svn.sourceforge.net/svnroot/languagetool/trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/server/proxy.php";>proxy.php</a>
+and place it on your server, in the same directory as your page. If you want 
to place it somewhere else you
+need to adapt <tt>languagetool_rpc_url</tt> in the page's 
<tt>&lt;head&gt;</tt> section. In any case, the proxy script
+needs to be placed on the same domain as the page with the textarea. By the 
way, if you open the 
+proxy page with your browser, you will just see a message that it only 
supports POST.</p>
+
+
+
+<h2>Done!</h2>
+
+<p>That's it - your page should now show a text area with the default text and 
as soon as you click the "Check Text"
+button, errors detected by LanguageTool should become underlined. If you 
experience problems, please
+go to <a href="../forum">our forum</a> and post a description of your issue, 
including an URL where your page can be found.</p>
+
+<p>Please add a link back to <a 
href="http://www.languagetool.org";>www.languagetool.org</a> so your users know
+what the functionality is based on.</p> 
+
+<p>Finally, we'd like you to be aware of the fact that we provide the 
LanguageTool service for free, which
+implies that we cannot give any guarantees about the service's 
availability.</p>
+
+<?php
+include("../../include/footer.php");
+?>

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Languagetool-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-commits

Reply via email to