[library-web/new-website-style: 4/55] merging api search in main search, in devel channel
- From: Frederic Peters <fpeters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [library-web/new-website-style: 4/55] merging api search in main search, in devel channel
- Date: Sat, 19 Mar 2011 18:56:54 +0000 (UTC)
commit 421b27b2455ab2cc2f2690ec8e649b0680a17a52
Author: Frédéric Péters <fpeters 0d be>
Date: Fri Dec 3 23:33:00 2010 +0100
merging api search in main search, in devel channel
data/xslt/heading.xsl | 22 +++++++++++++++++++++-
data/xslt/indexes.xsl | 26 ++++++--------------------
2 files changed, 27 insertions(+), 21 deletions(-)
---
diff --git a/data/xslt/heading.xsl b/data/xslt/heading.xsl
index 94441e3..8f5f1b6 100644
--- a/data/xslt/heading.xsl
+++ b/data/xslt/heading.xsl
@@ -7,6 +7,7 @@
<xsl:import href="gettext.xsl"/>
<xsl:param name="libgo.channel">undefined</xsl:param>
+<xsl:param name="libgo.dbm_support" select="false()"/>
<xsl:template name="libgo.header">
<xsl:param name="channel"><xsl:value-of select="$libgo.channel"/></xsl:param>
@@ -76,9 +77,15 @@
</li>
</ul></div> </div>
<div class="right">
- <form role="search" method="get" id="searchform" action="http://www.google.com/custom" >
+ <form role="search" method="get" id="searchform">
+ <xsl:attribute name="action">
+ <xsl:if test="$channel = 'devel' and $libgo.dbm_support">/symbols/</xsl:if>
+ <xsl:if test="$channel != 'devel' or not($libgo.dbm_support)">http://www.google.com/custom</xsl:if>
+ </xsl:attribute>
+ <xsl:if test="$channel != 'devel' or not($libgo.dbm_support)">
<input type="hidden" name="domains" value="library.gnome.org" />
<input type="hidden" name="sitesearch" value="library.gnome.org" />
+ </xsl:if>
<div>
<label class="hidden" for="q">
<xsl:call-template name="gettext"><xsl:with-param name="lang"
@@ -87,6 +94,13 @@
</label><input type="text" value="" name="q" id="s" placeholder="Search" />
</div>
</form>
+ <xsl:if test="$channel = 'devel' and $libgo.dbm_support">
+ <script type="text/javascript">
+$('#s').autocomplete('/symbols/lookup/',
+ { minChars:3, matchSubset:1, matchContains:1, cacheLength:10,
+ selectOnly:1, rowsLimit:25 });
+ </script>
+ </xsl:if>
</div>
</div>
</div>
@@ -94,6 +108,7 @@
</xsl:template>
<xsl:template name="libgo.head">
+ <xsl:param name="channel"><xsl:value-of select="$libgo.channel"/></xsl:param>
<link rel="stylesheet" type="text/css" media="all"
href="http://wptest.gnome.org/wp-content/themes/gnome-grass/style.css" />
<link rel="stylesheet" type="text/css" media="all" href="/skin/lgo2010.css"/>
@@ -102,6 +117,11 @@
<link rel="SHORTCUT ICON" type="image/png" href="/skin/gnome-16.png"/>
<link rel="search" type="application/opensearchdescription+xml"
href="/gnome-library-search.xml" title="GNOME Library Search" />
+ <xsl:if test="$libgo.dbm_support and $channel = 'devel'">
+ <link rel="stylesheet" type="text/css" href="/skin/jquery.autocomplete.css"/>
+ <script type="text/javascript" src="/js/jquery.js" />
+ <script type="text/javascript" src="/js/jquery.autocomplete.js" />
+ </xsl:if>
</xsl:template>
<xsl:template name="libgo.footer">
diff --git a/data/xslt/indexes.xsl b/data/xslt/indexes.xsl
index 4b5f44d..fa22656 100644
--- a/data/xslt/indexes.xsl
+++ b/data/xslt/indexes.xsl
@@ -33,7 +33,6 @@ along with libgo; if not, write to the Free Software Foundation, Inc.,
<!-- This gets set on the command line ... -->
<xsl:param name="libgo.lang" select="''"/>
<xsl:param name="libgo.debug" select="false()"/>
-<xsl:param name="libgo.dbm_support" select="false()"/>
<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
@@ -280,7 +279,9 @@ doctype-system="http://www.w3.org/TR/html4/loose.dtd">
<html lang="{$lang}">
<head>
<title><xsl:value-of select="title" /> - GNOME Library</title>
- <xsl:call-template name="libgo.head"/>
+ <xsl:call-template name="libgo.head">
+ <xsl:with-param name="channel" select="@channel"/>
+ </xsl:call-template>
<script type="text/javascript" src="/js/strings.js" />
</head>
<body class="with-star">
@@ -585,7 +586,9 @@ doctype-system="http://www.w3.org/TR/html4/loose.dtd">
</xsl:otherwise>
</xsl:choose>
</title>
- <xsl:call-template name="libgo.head"/>
+ <xsl:call-template name="libgo.head">
+ <xsl:with-param name="channel" select="@channel"/>
+ </xsl:call-template>
<script type="text/javascript" src="/js/strings.js" />
<xsl:if test="$filename = 'references'">
<xsl:if test="$libgo.dbm_support">
@@ -633,23 +636,6 @@ doctype-system="http://www.w3.org/TR/html4/loose.dtd">
</div>
</xsl:if>
<xsl:if test="$filename = 'references'">
- <xsl:if test="$libgo.dbm_support">
- <form id="symlookup" action="/symbols/">
- <input id="symbol" class="searchTerms" name="q"/>
- <input class="searchButton" type="submit">
- <xsl:attribute name="value">
- <xsl:call-template name="gettext"><xsl:with-param name="lang"
- select="@lang"/><xsl:with-param name="msgid"
- select="'lookuplabel'"/></xsl:call-template>
- </xsl:attribute>
- </input>
- </form>
- <script type="text/javascript">
-$('#symbol').autocomplete('/symbols/lookup/',
- { minChars:3, matchSubset:1, matchContains:1, cacheLength:10,
- selectOnly:1, rowsLimit:25 });
- </script>
- </xsl:if>
<xsl:apply-templates select="." mode="toc">
<xsl:with-param name="lang" select="@lang"/>
</xsl:apply-templates>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]