Web www.gerd-tentler.de
Version 1.4 (released Apr. 25, 2011) [Download]

Usage

Insert this script into your HTML page like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
...
<script src="codeedit.js" type="text/javascript"></script>
...
</head>
<body>
...
Note the first line, it is needed to fix the CSS box model bug of Internet Explorer.

Then insert one or more textareas and use "codeedit" followed by the script language as class name:
<textarea name="myEditor1" class="codeedit php" wrap="off"></textarea>
...
<textarea name="myEditor2" class="codeedit javascript" wrap="off"></textarea>
...
It is also possible to add several options in any order. For instance, you can focus the textarea by adding the option "focus":
<textarea name="myEditor" class="codeedit php focus" wrap="off"></textarea>
Note that if you focus more than one textarea, only the last one will actually get the focus.

Line numbers can be viewed by adding the option "lineNumbers":
<textarea name="myEditor" class="codeedit php lineNumbers" wrap="off"></textarea>
As already said, you can combine these options in any order; just make sure that the class name starts with "codeedit" and the language name:
<textarea name="myEditor" class="codeedit php lineNumbers focus" wrap="off"></textarea>

Comments