Changeset 1163 for www


Ignore:
Timestamp:
Sep 30, 2006, 11:25:56 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • Added TOIlet live test.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/toilet.html

    r1129 r1163  
    4343horizontal smushing. </p>
    4444
     45<h2> Live test </h2>
     46
     47<? $text = $_POST['text'];
     48   $submit = $_POST['submit'];
     49   $font = $_POST['font'];
     50   $fontlist = array('emboss', 'emboss2', 'smbraille'); ?>
     51
     52<form method="POST" action="toilet.html">
     53  <p>
     54    <select name="font">
     55      <? foreach($fontlist as $i => $name) { ?>
     56        <option value="<?php echo $i; ?>"<? if($i == $font) echo ' selected="selected"';?>><?php echo $name; ?></option>
     57      <? } ?>
     58    </select>
     59    <input type="text" size="50" name="text"
     60           value="<? if($text) echo htmlspecialchars($text); ?>" />
     61    <input type="submit" name="submit" value="Generate" />
     62  </p>
     63</form>
     64
     65<? if($submit) { ?>
     66  <blockquote>
     67    <p><pre>
     68      <? exec('/tmp/trunk-toilet/src/toilet -d /tmp/trunk-toilet/fonts -f "'.$fontlist[$font].'" "'.escapeshellcmd($text).'" | sed "s/\x1b[^m]*m//g"', &$result);
     69         foreach($result as $line)
     70             echo "<br />".htmlspecialchars($line);
     71      ?>
     72    </pre></p>
     73  </blockquote>
     74<? } ?>
     75
    4576<h2> Screenshot </h2>
    4677
Note: See TracChangeset for help on using the changeset viewer.