From b70318935e4e4a382214f50808e0b2d568953ea5 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 27 Oct 2008 13:06:01 +0000 Subject: [PATCH] put search-box input inside form in Scribbled HTML svn: r12137 original commit: 6be0f8f4dfdbd92cf3c057ffa1bcac9ef09e1aa6 --- collects/scribble/html-render.ss | 34 +++++++++++++++++--------------- collects/scribble/scribble.css | 6 ++++++ 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/collects/scribble/html-render.ss b/collects/scribble/html-render.ss index 04fcd0aa..92352f26 100644 --- a/collects/scribble/html-render.ss +++ b/collects/scribble/html-render.ss @@ -191,7 +191,7 @@ (define search-field @`p{Search: @(input ([type "text"] [id "search_box"] [onchange "delayed_search(this.value,event);"] - [onkeyup "delayed_search(this.value,event);"]))}) + [onkeyup "delayed_search(this.value,event);"])))}) ) @@ -199,21 +199,23 @@ (let ([sa string-append] [emptylabel "...search manuals..."] [dimcolor "#888"]) - `(input - ([class "searchbox"] - [style ,(sa "color: "dimcolor";")] - [type "text"] - [value ,emptylabel] - [title "Enter a search string to search the manuals"] - [onkeypress ,(format "return DoSearchKey(event, this, ~s, ~s);" - (version) top-path)] - [onfocus ,(sa "this.style.color=\"black\"; " - "this.style.textAlign=\"left\"; " - "if (this.value == \""emptylabel"\") this.value=\"\";")] - [onblur ,(sa "if (this.value.match(/^ *$/)) {" - " this.style.color=\""dimcolor"\";" - " this.style.textAlign=\"center\";" - " this.value=\""emptylabel"\"; }")])))) + `(form + ([class "searchform"]) + (input + ([class "searchbox"] + [style ,(sa "color: "dimcolor";")] + [type "text"] + [value ,emptylabel] + [title "Enter a search string to search the manuals"] + [onkeypress ,(format "return DoSearchKey(event, this, ~s, ~s);" + (version) top-path)] + [onfocus ,(sa "this.style.color=\"black\"; " + "this.style.textAlign=\"left\"; " + "if (this.value == \""emptylabel"\") this.value=\"\";")] + [onblur ,(sa "if (this.value.match(/^ *$/)) {" + " this.style.color=\""dimcolor"\";" + " this.style.textAlign=\"center\";" + " this.value=\""emptylabel"\"; }")]))))) (define search-box (make-search-box "../")) (define top-search-box (make-search-box "")) diff --git a/collects/scribble/scribble.css b/collects/scribble/scribble.css index 9e8d516c..9e106afd 100644 --- a/collects/scribble/scribble.css +++ b/collects/scribble/scribble.css @@ -101,6 +101,12 @@ table td { color: #e0e0e0; } +.searchform { + display: inline; + margin: 0; + padding: 0; +} + .searchbox { width: 16em; margin: 0px;