Commit 428f735a authored by Robert Ricci's avatar Robert Ricci

Add an opensearch plugin for the Emulab documentation search page.

Basically, this lets you search the Emulab docs from the same little
toolbar box that lets you search google, etc.

Works with Firefox 2.0, and should work with IE 7
parent 1dd56891
......@@ -2502,7 +2502,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
www/xmlrpcpipe.php3 \
www/swish.conf www/websearch \
www/garcia-telemetry/GNUmakefile www/tutorial/GNUmakefile \
www/sec-check/GNUmakefile \
www/sec-check/GNUmakefile www/emusearch.xml \
vis/GNUmakefile vis/webvistopology vis/dbvistopology \
vis/prerender vis/prerender_all vis/render \
vis/floormap vis/webfloormap \
......
......@@ -886,7 +886,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
www/xmlrpcpipe.php3 \
www/swish.conf www/websearch \
www/garcia-telemetry/GNUmakefile www/tutorial/GNUmakefile \
www/sec-check/GNUmakefile \
www/sec-check/GNUmakefile www/emusearch.xml \
vis/GNUmakefile vis/webvistopology vis/dbvistopology \
vis/prerender vis/prerender_all vis/render \
vis/floormap vis/webfloormap \
......
......@@ -55,7 +55,8 @@ FILES += $(SRCDIR)/.htaccess $(SRCDIR)/error.shtml \
$(SRCDIR)/ssh-mime-winxp.pl $(SRCDIR)/rdp-mime-winxp.pl \
$(SRCDIR)/ssh-mime-winxp.c $(SRCDIR)/rdp-mime-winxp.c \
$(SRCDIR)/ssh-mime-winxp.exe $(SRCDIR)/rdp-mime-winxp.exe \
$(SRCDIR)/emulab-mime-winxp.zip $(SRCDIR)/emulab-mime-winxp.reg
$(SRCDIR)/emulab-mime-winxp.zip $(SRCDIR)/emulab-mime-winxp.reg \
$(SRCDIR)/emusearch.xml
AUTOICONS = $(wildcard $(SRCDIR)/autostatus-icons/*.gif)
AUTOICONS += $(wildcard $(SRCDIR)/autostatus-icons/*.png)
......
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<!-- Should be customized per-site -->
<ShortName>@THISHOMEBASE@ Search</ShortName>
<LongName>@THISHOMEBASE@ Documentation Search</LongName>
<Description>
Search the @THISHOMEBASE@ documentation and knowledge base
</Description>
<Contact>@TBOPSEMAIL_NOSLASH@</Contact>
<!-- I'm using https because it shouldn't make all that big of a
difference, and if we ever have searches that can return different
things for different users (ie. search their wikis), having full
cookies will be important-->
<moz:SearchForm>@TBBASE@/search.php3</moz:SearchForm>
<Url type="text/html"
template="@TBBASE@/search.php3?query={searchTerms}" />
<Image height="16" width="16" type="image/vnd.microsoft.icon">
@TBDOCBASE@/favicon.ico
</Image>
<Image height="64" width="64" type="image/png">
@TBDOCBASE@/favicon.png
</Image>
<!-- This stuff is the same for every site -->
<Developer>Flux Group, School of Computing, University of Utah</Developer>
<InputEncoding>inputEncoding</InputEncoding>
<OutputEncoding>UTF-8</OutputEncoding>
<InputEncoding>UTF-8</InputEncoding>
<Query role="example" searchTerms="node" />
<SyndicationRight>limited</SyndicationRight>
<Tags>emulab network research testbed</Tags>
</OpenSearchDescription>
......@@ -273,7 +273,7 @@ function WRITESIDEBAR() {
if ($rootEmulab) {
# Leave _NEW here about 2 weeks
WRITESIDEBARBUTTON_NEW("Papers and Talks (Mar 9)", $TBDOCBASE, "pubs.php3");
WRITESIDEBARBUTTON_NEW("Papers and Talks (Mar 9)", $TBDOCBASE, "pubs.php3");
WRITESIDEBARBUTTON("Software (Jul 18)",
$TBDOCBASE, "software.php3");
#WRITESIDEBARBUTTON("Add Widearea Node (CD)",
......@@ -629,6 +629,7 @@ function PAGEBEGINNING( $title, $nobanner = 0, $nocontent = 0,
<head>
<title>$THISHOMEBASE - $title</title>
<link rel=\"shortcut icon\" href=\"favicon.ico\" TYPE=\"image/vnd.microsoft.icon\">
<link rel=\"search\" type=\"application/opensearchdescription+xml\" title=\"$THISHOMEBASE Search\" href=\"emusearch.xml\">
<!-- dumbed-down style sheet for any browser that groks (eg NS47). -->
<link rel='stylesheet' href='$BASEPATH/common-style.css' type='text/css' />
<!-- do not import full style sheet into NS47, since it does bad job
......
......@@ -23,6 +23,7 @@ $optargs = OptionalPageArguments("submit", PAGEARG_STRING,
#
function SPITSEARCHFORM($query)
{
echo "<table align=center border=1>
<form action=search.php3 method=get>\n";
......@@ -111,6 +112,27 @@ else {
TBERROR("Query failed: $query", 0);
}
#
# Add search to the browser's toolbar
#
echo "
<script type='text/javascript' language='javascript'>
function addSearch() {
if (window.external &&
('AddSearchProvider' in window.external)) {
window.external.AddSearchProvider('$TBBASE/emusearch.xml');
} else {
alert('Sorry, your web browser does not support Opensearch');
}
}
</script>
<p>
<a onclick='addSearch();'>Add the Emulab search engine to your browser's
toolbar</a>
</p>
";
#
# Standard Testbed Footer
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment