racket/collects/scribblings/main/private/search-context.html
Eli Barzilay b9f4662af9 Very partial change, the only visible effect should be that "Pre-Query"
is no longer part of the interface in any way.

svn: r16136
2009-09-27 14:13:57 +00:00

48 lines
1.7 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
This page serves as a trampoline -- it finds an "hq" parameter,
stores it in a cookie, and continues to the search page. This
avoids having the "hq" argument be on the search page -- since then
when you refresh the search you will reset the cookie.
-->
<head>
<meta http-equiv="content-type" content="text-html; charset=utf-8" />
<title>Search Manuals</title>
<script type="text/javascript" src="../scribble-common.js"></script>
</head>
<body>
<noscript>Sorry, you must have JavaScript to use this page.<br></noscript>
<script>
if (location.search.length > 0) {
var paramstrs = location.search.substring(1).split(/[;&]/);
var newsearch = null;
for (var i=0; i<paramstrs.length; i++) {
var param = paramstrs[i].split(/=/);
// an empty "hq=" can be used to clear the cookie
if (param[0] == "hq") {
SetCookie("PLT_ContextQuery",
((param.length==2) ? unescape(param[1]) : ""));
} else if (param[0] == "label") {
SetCookie("PLT_ContextQueryLabel",
((param.length==2) ? unescape(param[1]) : ""));
} else {
newsearch = (newsearch == null)
? paramstrs[i] : (newsearch + "&" + paramstrs[i]);
}
}
newsearch = (newsearch == null) ? "" : ("?" + newsearch);
// localtion.replace => jump without leaving the current page in the history
// (the new url uses "index.html" and the new search part)
location.replace(location.href.replace(/\/[^\/?#]*[?][^#]*/,
"/index.html" + newsearch));
} else {
// no parameters found? just jump to the search page...
location.href = "index.html";
}
</script>
</body>
</html>