Changeset 1179 for www/toilet.html


Ignore:
Timestamp:
Oct 1, 2006, 5:34:57 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • Updated TOIlet live test with newest fonts.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • www/toilet.html

    r1168 r1179  
    4848   $text = substr(stripslashes($_POST['text']), 0, 40);
    4949   $font = $_POST['font'];
    50    $fontlist = array('emboss', 'emboss2', 'smbraille');
    51    $path = "/tmp/trunk-toilet"; ?>
     50   $fontlist = array('emboss' => 'Emboss',
     51                     'emboss2' => 'Emboss 2',
     52                     'future' => 'Future',
     53                     'smbraille' => 'Small Braille',
     54                     'circle' => 'Circle');
     55   if(!isset($fontlist[$font])) $font = 'future'; ?>
    5256
    5357<form method="post" action="toilet.html">
    5458  <p>
    5559    <select name="font">
    56       <? foreach($fontlist as $i => $name) { ?>
    57         <option value="<?php echo $i; ?>"<? if($i == $font) echo ' selected="selected"';?>><?php echo $name; ?></option>
     60      <? foreach($fontlist as $name => $desc) { ?>
     61        <option value="<?php echo $name; ?>"<? if($name == $font) echo ' selected="selected"';?>><?php echo $desc; ?></option>
    5862      <? } ?>
    5963    </select>
     
    6569
    6670<? if($submit) { ?>
    67   <blockquote>
    68     <p><pre>
    69       <? exec($path.'/src/toilet -d '.$path.'/fonts -f "'.$fontlist[$font].'" '.escapeshellarg($text).' | sed "s/\x1b[^m]*m//g"', &$result);
     71  <div class="toilet">
     72    <p class="toilet"><pre><?
     73         $p = "/tmp/trunk-toilet";
     74         exec($p.'/src/toilet -d '.$p.'/fonts -f '.$font.' '.escapeshellarg($text).' | sed "s/\x1b[^m]*m//g"', &$result);
    7075         foreach($result as $line)
    71              echo "\n".htmlspecialchars($line);
    72       ?>
    73     </pre></p>
    74   </blockquote>
     76             echo htmlspecialchars($line)."\n";
     77      ?></pre></p>
     78  </div>
    7579<? } ?>
    7680
Note: See TracChangeset for help on using the changeset viewer.