From b141634910a094258ff35d1444dca5d87b8b95b6 Mon Sep 17 00:00:00 2001 From: Chris Double Date: Sun, 13 Feb 2005 01:57:34 +0000 Subject: [PATCH] Fix for browser responder for where vocab or word doesn't exist --- contrib/cont-responder/browser.factor | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/contrib/cont-responder/browser.factor b/contrib/cont-responder/browser.factor index 3431dd0e4d..4e7992f9fa 100644 --- a/contrib/cont-responder/browser.factor +++ b/contrib/cont-responder/browser.factor @@ -46,6 +46,7 @@ USE: unparser USE: logging USE: listener USE: url-encoding +USE: hashtables : ( allow-edit? vocab word -- ) #! An object for storing the current browser @@ -100,10 +101,12 @@ USE: url-encoding "allow-edit?" get [ "Edit" [ "edit-state" t put ] quot-href
] when "edit-state" get [ write-editable-word-source - ] [ - [ - >r words r> swap [ over swap dup word-name rot = [ see ] [ drop ] ifte ] each drop - ] with-simple-html-output + ] [ + 2dup swap unit search [ + [ + >r words r> swap [ over swap dup word-name rot = [ see ] [ drop ] ifte ] each drop + ] with-simple-html-output + ] when ] ifte ] bind drop ; @@ -199,7 +202,6 @@ USE: url-encoding : browse ( -- ) #! Display a Smalltalk like browser for exploring/modifying words. - [ [ [ @@ -227,10 +229,10 @@ USE: url-encoding "words" get "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 - ] bind - ] forever ; + ] bind ; : browser-responder ( allow-edit? -- ) #! Start the Smalltalk-like browser.