diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss
index 18ae4273..4808c401 100644
--- a/collects/scribble/html-render.ss
+++ b/collects/scribble/html-render.ss
@@ -186,17 +186,16 @@
[onchange "delayed_search(this.value,event);"]
[onkeyup "delayed_search(this.value,event);"]))})
-(define (search-index-box index-url) ; appears on every page
+)
+
+(define (search-index-box) ; appears on every page
(let ([sa string-append])
`(input
([style ,(sa "font-size: 75%; margin: 0px; padding: 0px; border: 1px;"
" background-color: #eee; color: #888;")]
[type "text"]
[value "...search..."]
- [onkeypress ,(sa "if (event && event.keyCode==13"
- " && this.value.indexOf(\"...search...\")<0) {"
- " location=\"doc-index.html?q=\"+escape(this.value);"
- " };")]
+ [onkeypress ,(format "return DoSearchKey(event, this, ~s);" (version))]
[onfocus ,(sa "this.style.color=\"black\";"
" if (this.value.indexOf(\"...search...\")>=0)"
" this.value=\"\";")]
@@ -204,8 +203,6 @@
" this.style.color=\"#888\";"
" this.value=\"...search...\"; }")]))))
-)
-
;; ----------------------------------------
;; main mixin
@@ -611,9 +608,9 @@
#; ; no need for these index-local searches
,@(if (eq? d index)
null
- `((small nbsp
- ,(search-index-box (derive-filename index))))))
- null))
+ `((small nbsp ,(search-index-box)))))
+ null)
+ ,@(if up-path `(nbsp (small ,(search-index-box))) null))
(div ([class "navright"])
,@(render
(make-element
diff --git a/collects/scribble/scribble-common.js b/collects/scribble/scribble-common.js
index 1aef1c0d..859654a6 100644
--- a/collects/scribble/scribble-common.js
+++ b/collects/scribble/scribble-common.js
@@ -44,14 +44,15 @@ function NormalizePath(path) {
return path;
}
-function DoSearchKey(event, field) {
+function DoSearchKey(event, field, ver) {
var val = field.value;
if (event && event.keyCode == 13 && val.indexOf("...search...") < 0) {
- var u = GetCookie("PLT_Root");
+ var u = GetCookie("PLT_Root."+ver);
if (u == null) u = "../"; // default: go up
- u = u.replace(/[^\/\\]*$/, "") + "plt-search.html";
- location = u + "?q=" + escape(val);
+ location = u + "search/index.html" + "?q=" + escape(val);
+ return false;
}
+ return true;
}
// `noscript' is problematic in some browsers (always renders as a