diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2011-06-19 15:43:41 +0000 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2011-06-19 15:43:41 +0000 |
commit | e9e0cf59085cb3b3d77c8a2962fd8b80ac4d0c9d (patch) | |
tree | 33f3f6ac491d86fdef94b9a1cd9d6bbda9bfabf5 /manual/gsearch.js | |
parent | 8d9b9d247b7415f002fcc4253b4d0818e7f5fbaf (diff) | |
download | rockbox-e9e0cf59085cb3b3d77c8a2962fd8b80ac4d0c9d.tar.gz rockbox-e9e0cf59085cb3b3d77c8a2962fd8b80ac4d0c9d.zip |
Manual: add search box to HTML output.
To allow easy searching the HTML (multi page) output add a search box that
queries Google. The Google search will get restricted to the location the
manual is stored. Google seems to happily accept a subfolder when specifying a
domain to search. For this to work the search box has to be created dynamically
with the help of a bit JavaScript.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30017 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'manual/gsearch.js')
-rw-r--r-- | manual/gsearch.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/manual/gsearch.js b/manual/gsearch.js new file mode 100644 index 0000000000..9b5e3f7aa1 --- /dev/null +++ b/manual/gsearch.js | |||
@@ -0,0 +1,11 @@ | |||
1 | function gsearch() { | ||
2 | var expr=/(.*)\/([^/]+)$/; | ||
3 | var loc = expr.exec(window.location)[1]; | ||
4 | document.getElementById("gsearch").innerHTML = '' | ||
5 | + '<form action="http://www.google.com/search">' | ||
6 | + 'Search this manual ' | ||
7 | + '<input name="as_q" size="30">' | ||
8 | + '<input value="Google it" type="submit">' | ||
9 | + '<input type="hidden" name="as_sitesearch" value="' + loc + '">' | ||
10 | + '</form>'; | ||
11 | } | ||