diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2017-09-12 14:48:18 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2017-09-13 01:58:57 +0200 |
commit | 42fbc7890755b7f6322be2fc2c7bc934d3c07b1e (patch) | |
tree | f3a872b5eb4914b96eaa26a341cd8396eed5916a /help3xsl/online_transform.xsl | |
parent | 6005c5c31ca8e9f9107c5c0e35858d27e4a55490 (diff) |
TDF#97745 Add support custom search in helponline
Added some language support for the helponline global search
Each custom search engine of google has a unique token, which
configuration is handled by CSE owner.
The CSE attempt to seach in helponline in the page language. If a page
is already indexed, it shows what it has. If not, pages indexed from the
*.libreoffice.org domain and wiki.tdf.org are shown.
The CSE prevents display of indexed pages of other suites.
Change-Id: I133e1a7af867c2380ccb1f20c483af63337a58b9
Reviewed-on: https://gerrit.libreoffice.org/42218
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/online_transform.xsl')
-rw-r--r-- | help3xsl/online_transform.xsl | 59 |
1 files changed, 26 insertions, 33 deletions
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl index eebaced568..f3ddebee4a 100644 --- a/help3xsl/online_transform.xsl +++ b/help3xsl/online_transform.xsl @@ -238,8 +238,9 @@ <div id="content-2"> <script type="text/javascript"> <![CDATA[ - (function() { - var cx = '010161382024564278136:oejldkqc20o'; + (function() {]]> + <xsl:call-template name="getToken"><xsl:with-param name="lang" select="$lang"/></xsl:call-template> + <![CDATA[ var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; @@ -611,41 +612,33 @@ </xsl:choose> </xsl:template> - <!-- SECTION --> <xsl:template match="section"> - <a name="{@id}"></a> - - <xsl:choose> - - <xsl:when test="@id='relatedtopics'"> - <div class="relatedtopics"> - <!--<xsl:variable name="href"><xsl:value-of select="concat($urlpre,'text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>--> - <xsl:variable name="href"><xsl:value-of select="concat($urlpre,'text/shared/00/00000004.xhp')"/></xsl:variable> - <xsl:variable name="anchor"><xsl:value-of select="'related'"/></xsl:variable> - <xsl:variable name="doc" select="document($href)"/> - <p class="related" itemprop="mentions"> - <xsl:apply-templates select="$doc//variable[@id=$anchor]"/> - </p> - <div class="relatedbody" itemprop="mentions"> - <xsl:apply-templates /> - </div> - </div> - </xsl:when> - - <xsl:when test="@id='howtoget'"> - <xsl:call-template name="insert_howtoget" /> - </xsl:when> - - <xsl:otherwise> - <xsl:apply-templates/> - </xsl:otherwise> - - </xsl:choose> - + <a name="{@id}"></a> + <xsl:choose> + <xsl:when test="@id='relatedtopics'"> + <div class="relatedtopics"> + <!--<xsl:variable name="href"><xsl:value-of select="concat($urlpre,'text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>--> + <xsl:variable name="href"><xsl:value-of select="concat($urlpre,'text/shared/00/00000004.xhp')"/></xsl:variable> + <xsl:variable name="anchor"><xsl:value-of select="'related'"/></xsl:variable> + <xsl:variable name="doc" select="document($href)"/> + <p class="related" itemprop="mentions"> + <xsl:apply-templates select="$doc//variable[@id=$anchor]"/> + </p> + <div class="relatedbody" itemprop="mentions"> + <xsl:apply-templates /> + </div> + </div> + </xsl:when> + <xsl:when test="@id='howtoget'"> + <xsl:call-template name="insert_howtoget" /> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates/> + </xsl:otherwise> + </xsl:choose> </xsl:template> - <!-- SECTION --> <xsl:template match="section" mode="embedded"> <a name="{@id}"></a> |