label browser column headings

cvs
Chris Double 2004-08-02 21:33:58 +00:00
parent 5503ce06ce
commit 5973009ed1
1 changed files with 67 additions and 39 deletions

View File

@ -55,6 +55,10 @@ USE: errors
: write-vocab-list ( -- ) : write-vocab-list ( -- )
#! Write out the HTML for the list of vocabularies #! Write out the HTML for the list of vocabularies
<table> [
<tr> [ <th> [ "Vocabularies" write ] </th> ] </tr>
<tr> [
<td> [
<select name= "vocabs" size= "20" onchange= "document.forms.main.submit()" select> [ <select name= "vocabs" size= "20" onchange= "document.forms.main.submit()" select> [
vocabs [ vocabs [
dup "current-vocab" get [ "" ] unless* = [ dup "current-vocab" get [ "" ] unless* = [
@ -65,10 +69,17 @@ USE: errors
chars>entities write chars>entities write
"</option>\n" write "</option>\n" write
] each ] each
] </select> ; ] </select>
] </td>
] </tr>
] </table> ;
: write-word-list ( vocab -- ) : write-word-list ( vocab -- )
#! Write out the HTML for the list of words in a vocabulary. #! Write out the HTML for the list of words in a vocabulary.
<table> [
<tr> [ <th> [ "Words" write ] </th> ] </tr>
<tr> [
<td> [
<select name= "words" size= "20" onchange= "document.forms.main.submit()" select> [ <select name= "words" size= "20" onchange= "document.forms.main.submit()" select> [
words [ words [
dup "current-word" get [ "" ] unless* str-compare 0 = [ dup "current-word" get [ "" ] unless* str-compare 0 = [
@ -79,19 +90,33 @@ USE: errors
chars>entities write chars>entities write
"</option>\n" write "</option>\n" write
] each ] each
] </select> ; ] </select>
] </td>
] </tr>
] </table> ;
: write-editable-word-source ( vocab word -- ) : write-editable-word-source ( vocab word -- )
#! Write the source in a manner allowing it to be edited. #! Write the source in a manner allowing it to be edited.
<table> [
<tr> [ <td> [ "<b>Source</b>" write ] </td> ] </tr>
<tr> [
<td> [
<textarea name= "eval" rows= "30" cols= "80" textarea> [ <textarea name= "eval" rows= "30" cols= "80" textarea> [
1024 <string-output-stream> dup >r [ 1024 <string-output-stream> dup >r [
>r words r> swap [ over swap dup word-name rot = [ see ] [ drop ] ifte ] each drop >r words r> swap [ over swap dup word-name rot = [ see ] [ drop ] ifte ] each drop
] with-stream r> stream>str chars>entities write ] with-stream r> stream>str chars>entities write
] </textarea> <br/> ] </textarea> <br/>
"Accept" button ; "Accept" button
] </td>
] </tr>
] </table> ;
: write-word-source ( vocab word -- ) : write-word-source ( vocab word -- )
#! Write the source for the given word from the vocab as HTML. #! Write the source for the given word from the vocab as HTML.
<table> [
<tr> [ <td> [ "<b>Source</b>" write ] </td> ] </tr>
<tr> [
<td> [
<namespace> [ <namespace> [
"responder" "inspect" put "responder" "inspect" put
"allow-edit?" get [ "Edit" [ "edit-state" t put ] quot-href <br/> ] when "allow-edit?" get [ "Edit" [ "edit-state" t put ] quot-href <br/> ] when
@ -102,7 +127,10 @@ USE: errors
>r words r> swap [ over swap dup word-name rot = [ see ] [ drop ] ifte ] each drop >r words r> swap [ over swap dup word-name rot = [ see ] [ drop ] ifte ] each drop
] with-simple-html-output ] with-simple-html-output
] ifte ] ifte
] bind drop ; ] bind drop
] </td>
] </tr>
] </table> ;
: get-vm-runtime ( -- java.lang.Runtime ) : get-vm-runtime ( -- java.lang.Runtime )
f "java.lang.Runtime" "getRuntime" jinvoke-static ; f "java.lang.Runtime" "getRuntime" jinvoke-static ;