bkyk8rc3zvpnsf5inmcqq4n3k98cv6hj-my-site-hyper-literate-git.test.suzanne.soy-0.0.1

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 81004dcf38a44f571e19f387b0fe3c55db5be94a
parent 29a7a0fa936ccb652eebc0e7900f26f00021db90
Author: Eli Barzilay <eli@racket-lang.org>
Date:   Fri, 25 Jul 2008 02:05:00 +0000

added context label

svn: r10906

original commit: 5c61c1b997286138a857ccbd1d9d2ed465640c54

Diffstat:
Mcollects/help/search.ss | 22+++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/collects/help/search.ss b/collects/help/search.ss @@ -15,9 +15,21 @@ (send-url/file path #:fragment fragment #:query query))) (define (perform-search str [context #f]) - (let* ([page (if context "search-context.htm" "index.html")] - [query (format "q=~a" (uri-encode str))] - [query (if context - (format "~a&hq=~a" query (uri-encode context)) - query)]) + ;; `context' can be a pre-filter query string to use for a context, + ;; optionally a list of one and a label to display for that context. + ;; In any case, when a context is specified, the search actually + ;; goes through the search-context.html page which tranpolines to + ;; the main search page after setting the cookies (so when the + ;; search page is refreshed it won't reset the context). + (let* ([label (and (list? context) (= 2 (length context)) (cadr context))] + [context (if (pair? context) (car context) context)] + [page (if context "search-context.htm" "index.html")] + [query (format "q=~a" (uri-encode str))] + [query (if context + (format "~a&hq=~a~a" + query (uri-encode context) + (if label + (format "&label=~a" (uri-encode label)) + "")) + query)]) (send-main-page #:sub (string-append search-dir page) #:query query)))