Home/Download | Install | To-do | About |
Go to http://codepress.org/ for updates.
Download and uncompress CodePress under a directory inside your webserver.
Example: http://yourserver/codepress/
Since CodePress is pure JavaScript and HTML, you can also test it without a webserver.
Insert CodePress script somewhere in your page inside the <head>
or above the </body>
tag.
<script src="/codepress/codepress.js" type="text/javascript"></script>
Add the <textarea>
tag to the place on your page you want CodePress to appear. CodePress will inherit the width and height of your textarea.
When the page loads, it will automatically replace your textarea with a CodePress window.
<textarea id="myCpWindow" class="codepress javascript linenumbers-off">
// your code here
</textarea>
javascript
portion of the class="" means that the language being edited is JavaScript.
codepress
portion of the class="" is mandatory and indicates a textarea to be replaced for a CodePress window.
linenumbers-off
, autocomplete-off
and readonly-on
.
<textarea id="xx"...>
)
textarea_id.edit('other_textarea_id','language')
textarea_id.getCode()
textarea_id.toggleEditor()
textarea_id.toggleLineNumbers()
textarea_id.toggleReadOnly()
textarea_id.toggleAutoComplete()
CodePress is distributed under the LGPL. If your software is compatible with this licence or it is under Creative Commons, you can use it as you want. Just keep the credits somewhere around.