www.ThimbleOpenSource.com

Installation and usage in your scripts


Installation

Really simple, just upload contents of the zip file to your server and you are done. For example page go to this file in your browser in your directory tree where you have uploaded thimble_text files -> /www/editor_page.php

Implementing textarea with thimble_text

Minimalistic file which will get you <textarea> and converting capabalities, such as seen in our demo.

<?php
require_once('../editor/editor.php');
$textarea = new ThimbleTextEditor();
$textarea->textarea_name = 'form_text';
if (isset($_POST['form_text'])) $textarea->textarea_text = $_POST['form_text'];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<?php echo $textarea->html_head(); ?>
</head>
<body>
Write your code here:
<form method="POST">
<?php echo $textarea->html_body(); ?>
<br /><input type="submit" name="form_submit" value="Convert it">
</form>
See your XHTML converted text here:
<textarea cols="60" rows="8">
<?php
if (isset($_POST['form_text'])) {
require_once('../editor/thimble_text.php');
$thimble_text = new ThimbleText();
echo $thimble_text->parse_text($_POST['form_text']);
}
?>

</textarea>
<br />
XHTML in browser
<?php
if (isset($_POST['form_text'])) {
echo $thimble_text->parse_text($_POST['form_text']);
}
?>

</body>
</html>