Fix for browser responder for where vocab or word doesn't exist

cvs
Chris Double 2005-02-13 01:57:34 +00:00
parent f88bfcf2a8
commit b141634910
1 changed files with 10 additions and 8 deletions

View File

@ -46,6 +46,7 @@ USE: unparser
USE: logging USE: logging
USE: listener USE: listener
USE: url-encoding USE: url-encoding
USE: hashtables
: <browser> ( allow-edit? vocab word -- ) : <browser> ( allow-edit? vocab word -- )
#! An object for storing the current browser #! An object for storing the current browser
@ -101,9 +102,11 @@ USE: url-encoding
"edit-state" get [ "edit-state" get [
write-editable-word-source write-editable-word-source
] [ ] [
2dup swap unit search [
[ [
>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
] when
] ifte ] ifte
] bind drop ; ] bind drop ;
@ -199,7 +202,6 @@ USE: url-encoding
: browse ( <browser> -- ) : browse ( <browser> -- )
#! Display a Smalltalk like browser for exploring/modifying words. #! Display a Smalltalk like browser for exploring/modifying words.
[
[ [
[ [
<html> <html>
@ -227,10 +229,10 @@ USE: url-encoding
"words" get "words" get
"eval" get dup [ "vocabs" get swap eval-string ] [ drop ] ifte "eval" get dup [ "vocabs" get swap eval-string ] [ drop ] ifte
[ [
"vocabs" get "words" get browser-url forward-to-url "vocabs" get dup [ ] [ drop "unknown" ] ifte "words" get dup [ ] [ drop "unknown" ] ifte browser-url
forward-to-url
] show ] show
] bind <browser> ] bind <browser> ;
] forever ;
: browser-responder ( allow-edit? -- ) : browser-responder ( allow-edit? -- )
#! Start the Smalltalk-like browser. #! Start the Smalltalk-like browser.