use character streams instead of binary streams in todo list.

get liveupdater working with native factor.
browser responder now works in native factor.
cvs
Chris Double 2004-08-23 20:22:57 +00:00
parent d99fce030f
commit c22b62215a
3 changed files with 10 additions and 8 deletions

View File

@ -44,6 +44,7 @@ USE: html
USE: parser USE: parser
USE: errors USE: errors
USE: unparser USE: unparser
USE: logging
: <browser> ( allow-edit? vocab word -- ) : <browser> ( allow-edit? vocab word -- )
#! An object for storing the current browser #! An object for storing the current browser
@ -72,7 +73,7 @@ USE: unparser
#! Write out the HTML for the list of words in a vocabulary. #! Write out the HTML for the list of words in a vocabulary.
<select name= "words" style= "width: 200" size= "20" onchange= "document.forms.main.submit()" select> <select name= "words" style= "width: 200" size= "20" onchange= "document.forms.main.submit()" select>
words [ words [
dup "current-word" get [ "" ] unless* str-compare 0 = [ word-name dup "current-word" get [ "" ] unless* str-compare 0 = [
"<option selected>" write "<option selected>" write
] [ ] [
"<option>" write "<option>" write
@ -107,7 +108,7 @@ USE: unparser
: write-vm-statistics ( -- ) : write-vm-statistics ( -- )
#! Display statistics about the JVM in use. #! Display statistics about the JVM in use.
room unparse >r unparse r> room swap unparse >r unparse r>
<table> <table>
<tr> <tr>
<td> "Free Memory" write </td> <td> "Free Memory" write </td>
@ -148,9 +149,9 @@ USE: unparser
: word-uses ( word -- list ) : word-uses ( word -- list )
#! Return a list of vocabularies that the given word uses. #! Return a list of vocabularies that the given word uses.
worddef worddef>list flatten [ word? ] subset [ worddef>list flatten [ word? ] subset [
word-vocabulary word-vocabulary
] inject ; ] map ;
: vocabulary-uses ( vocab -- list ) : vocabulary-uses ( vocab -- list )
#! Return a list of vocabularies that all words in a vocabulary #! Return a list of vocabularies that all words in a vocabulary
@ -230,6 +231,6 @@ USE: unparser
: browser-responder ( allow-edit? -- ) : browser-responder ( allow-edit? -- )
#! Start the Smalltalk-like browser. #! Start the Smalltalk-like browser.
"browser" "" <browser> browse ; "browser" f <browser> browse ;
"browser" [ f browser-responder ] install-cont-responder "browser" [ f browser-responder ] install-cont-responder

View File

@ -35,6 +35,7 @@ USE: stack
USE: kernel USE: kernel
USE: cont-utils USE: cont-utils
USE: cont-responder USE: cont-responder
USE: prettyprint
: live-search-apropos-word ( string -- ) : live-search-apropos-word ( string -- )
#! Given a string that is a factor word, show the #! Given a string that is a factor word, show the
@ -59,7 +60,7 @@ USE: cont-responder
<body> <body>
[ [
[ [
"millis" [ millis write ] "Display Server millis" live-anchor "millis" [ millis prettyprint ] "Display Server millis" live-anchor
<div id= "millis" div> <div id= "millis" div>
"The millisecond time from the server will appear here" write "The millisecond time from the server will appear here" write
</div> </div>

View File

@ -94,7 +94,7 @@ USE: url-encoding
: store-todo ( <todo> filename -- ) : store-todo ( <todo> filename -- )
#! store the todo list in the given file. #! store the todo list in the given file.
<filebw> [ write-todo ] with-stream ; <filecw> [ write-todo ] with-stream ;
: read-todo ( -- <todo> ) : read-todo ( -- <todo> )
#! Read a todo list from the current input stream. #! Read a todo list from the current input stream.
@ -109,7 +109,7 @@ USE: url-encoding
] times ; ] times ;
: load-todo ( filename -- <todo> ) : load-todo ( filename -- <todo> )
<filebr> [ read-todo ] with-stream ; <filecr> [ read-todo ] with-stream ;
: password-matches? ( password <todo> -- <todo> ) : password-matches? ( password <todo> -- <todo> )
#! Returns the <todo> if the password matches otherwise #! Returns the <todo> if the password matches otherwise