fix empty searchbox label, again
svn: r10576 original commit: 7a98aa8db22867788f9c677fea8810edf2f2379f
This commit is contained in:
parent
9f77ab292d
commit
e47582cec2
|
@ -189,22 +189,24 @@
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
(define (search-box) ; appears on every page
|
(define search-box ; appears on every page
|
||||||
(let ([sa string-append])
|
(let ([sa string-append]
|
||||||
|
[emptylabel "...search manuals..."]
|
||||||
|
[dimcolor "#888"])
|
||||||
`(input
|
`(input
|
||||||
([style ,(sa "font-size: 60%; margin: 0px; padding: 0px;"
|
([style ,(sa "font-size: 60%; margin: 0px; padding: 0px;"
|
||||||
" background-color: #eee; color: #888;"
|
" background-color: #eee; color: "dimcolor";"
|
||||||
" border: 1px solid #ddd; text-align: center;")]
|
" border: 1px solid #ddd; text-align: center;")]
|
||||||
[type "text"]
|
[type "text"]
|
||||||
[value "...search manuals..."]
|
[value ,emptylabel]
|
||||||
[title "Enter a search string to search the manuals"]
|
[title "Enter a search string to search the manuals"]
|
||||||
[onkeypress ,(format "return DoSearchKey(event, this, ~s);" (version))]
|
[onkeypress ,(format "return DoSearchKey(event, this, ~s);" (version))]
|
||||||
[onfocus ,(sa "this.style.color=\"black\";"
|
[onfocus ,(sa "this.style.color=\"black\";"
|
||||||
" if (this.value.indexOf(\"...search...\")>=0)"
|
" if (this.value.indexOf(\""emptylabel"\")>=0)"
|
||||||
" this.value=\"\";")]
|
" this.value=\"\";")]
|
||||||
[onblur ,(sa "if (this.value.match(/^ *$/)) {"
|
[onblur ,(sa "if (this.value.match(/^ *$/)) {"
|
||||||
" this.style.color=\"#888\";"
|
" this.style.color=\""dimcolor"\";"
|
||||||
" this.value=\"...search...\"; }")]))))
|
" this.value=\""emptylabel"\"; }")]))))
|
||||||
|
|
||||||
;; ----------------------------------------
|
;; ----------------------------------------
|
||||||
;; main mixin
|
;; main mixin
|
||||||
|
@ -625,7 +627,7 @@
|
||||||
`[onclick . ,(format "return GotoPLTRoot(\"~a\");" (version))]))
|
`[onclick . ,(format "return GotoPLTRoot(\"~a\");" (version))]))
|
||||||
(define navleft
|
(define navleft
|
||||||
`(span ([class "navleft"])
|
`(span ([class "navleft"])
|
||||||
,(search-box)
|
,search-box
|
||||||
nbsp
|
nbsp
|
||||||
,@(render (make-element (if up-path top-link "nonavigation")
|
,@(render (make-element (if up-path top-link "nonavigation")
|
||||||
top-content))
|
top-content))
|
||||||
|
|
|
@ -46,7 +46,7 @@ function NormalizePath(path) {
|
||||||
|
|
||||||
function DoSearchKey(event, field, ver) {
|
function DoSearchKey(event, field, ver) {
|
||||||
var val = field.value;
|
var val = field.value;
|
||||||
if (event && event.keyCode == 13 && val.indexOf("...search manuals...") < 0) {
|
if (event && event.keyCode == 13) {
|
||||||
var u = GetCookie("PLT_Root."+ver, null);
|
var u = GetCookie("PLT_Root."+ver, null);
|
||||||
if (u == null) u = "../"; // default: go up
|
if (u == null) u = "../"; // default: go up
|
||||||
location = u + "search/index.html" + "?q=" + escape(val);
|
location = u + "search/index.html" + "?q=" + escape(val);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user