* some fixes to make-search.ss
* rename search-context.html to .htm to avoid being deleted by setup/scribble * added context to help/search interface svn: r10717 original commit: bb562f9ee4e267d8f295d8838877e0a8c79d22c8
This commit is contained in:
parent
d289bbb2a2
commit
3d4b9088cd
|
@ -3,7 +3,7 @@
|
||||||
(require setup/dirs net/sendurl net/uri-codec)
|
(require setup/dirs net/sendurl net/uri-codec)
|
||||||
(provide perform-search send-main-page)
|
(provide perform-search send-main-page)
|
||||||
|
|
||||||
(define search-page "search/index.html")
|
(define search-dir "search/")
|
||||||
|
|
||||||
;; Almost nothing to do here -- the real work is done in the browser,
|
;; Almost nothing to do here -- the real work is done in the browser,
|
||||||
;; using javascript.
|
;; using javascript.
|
||||||
|
@ -14,5 +14,10 @@
|
||||||
[path (if (file-exists? path) path (build-path (find-doc-dir) sub))])
|
[path (if (file-exists? path) path (build-path (find-doc-dir) sub))])
|
||||||
(send-url/file path #:fragment fragment #:query query)))
|
(send-url/file path #:fragment fragment #:query query)))
|
||||||
|
|
||||||
(define (perform-search str)
|
(define (perform-search str [context #f])
|
||||||
(send-main-page #:sub search-page #:query (format "q=~a" (uri-encode str))))
|
(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)])
|
||||||
|
(send-main-page #:sub (string-append search-dir page) #:query query)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user