summaryrefslogtreecommitdiffstats
path: root/help3xsl/online_transform.xsl
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2019-08-23 06:50:58 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2019-10-01 15:00:44 +0200
commitaa45ded698f25e8d3bc8eef621d727186fe18dd2 (patch)
tree705428909416c1e243d29db6cb909ce2b3f10eee /help3xsl/online_transform.xsl
parentMute l10n of standard attributes (diff)
downloadhelp-aa45ded698f25e8d3bc8eef621d727186fe18dd2.tar.gz
help-aa45ded698f25e8d3bc8eef621d727186fe18dd2.zip
redmine#2555 replace Help online Google search
This is the helpcontent2/ part of the patch. Add xapian-omega search to online Help. The patch replaces Google custom search with xapian-omega search. A new build key is introduced. --with-omindex=server : Localizes and adds the xapian result page template, adds the xapian form to each Help page. --with-omindex=noxap : do not localize the result template and do not add a form in the Help page. --with-omindex= will force Online Help build. Default is noxap NOTES: - xapian-omega databases are built in the server. - searches returns results only on localized Help pages, avoiding same resulis in many languages. TODO: - Tweak the xapian-omega result page CSS and markup. Change-Id: I3dc2b79c4111f61fd5fea01b1f8c95bfacab1e8f Reviewed-on: https://gerrit.libreoffice.org/79366 Tested-by: Jenkins Reviewed-by: Guilhem Moulin <guilhem@libreoffice.org> Tested-by: Guilhem Moulin <guilhem@libreoffice.org>
Diffstat (limited to 'help3xsl/online_transform.xsl')
-rw-r--r--help3xsl/online_transform.xsl41
1 files changed, 15 insertions, 26 deletions
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 2ca8deded7..f8d6dc2f91 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -21,7 +21,6 @@
<xsl:output indent="yes" method="html" doctype-system= "about:legacy-compat"/>
-<xsl:include href="localized.xsl"/>
<xsl:include href="links.txt.xsl"/>
<!--
############################
@@ -34,6 +33,7 @@
<xsl:param name="Language"/>
<xsl:param name="productname"/>
<xsl:param name="productversion"/>
+<xsl:param name="xapian"/>
<xsl:param name="System" select="'WIN'"/>
<xsl:param name="imgtheme" select="''"/>
@@ -142,7 +142,7 @@
<base href="{$install}"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<xsl:if test="$online">
- <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org *.google.com *.googleapis.com"/>
+ <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' piwik.documentfoundation.org"/>
</xsl:if>
<title><xsl:value-of select="$titleL10N"/></title>
<link rel="shortcut icon" href="{$target}media/navigation/favicon.ico"/>
@@ -221,32 +221,21 @@
<div id="DisplayArea" itemprop="articleBody">
<xsl:apply-templates select="/helpdocument/body"/>
</div>
- <div class="google-donation">
- <xsl:if test="$online">
- <div class="google-search">
- <script type="text/javascript">
- <![CDATA[
- (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;
- gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(gcse, s);
- })();
- ]]>
- </script>
- <xsl:text disable-output-escaping="yes">&lt;gcse:search&gt;&lt;/gcse:search&gt;</xsl:text>
- </div>
+ <xsl:if test="$online">
+ <div class="xapian-donation">
+ <xsl:if test="$xapian='yes'">
+ <div class="xapian-omega-search">
+ <form name="P" method="get" action="/{$productversion}/{$lang}/search" target="_top">
+ <input id="omega-autofocus" type="search" name="P" size="65"/>
+ <input type="submit" class="xapian-omega-search-button" value="&#x1f50d;"/>
+ </form>
+ </div>
+ </xsl:if>
<div class="donation">
- <p><a href="https://www.libreoffice.org/donate/?pk_campaign=help" target ="_blank">
- <xsl:value-of select="$ui_donate"/>
- </a></p>
+ <p><a href="https://www.libreoffice.org/donate/?pk_campaign=help" target ="_blank"><xsl:value-of select="$ui_donate"/></a></p>
</div>
- </xsl:if>
- </div>
+ </div>
+ </xsl:if>
<footer>
<xsl:if test="$online">
<p><a href="https://www.libreoffice.org/imprint" target="_blank">Impressum (Legal Info)</a> | <a href="https://www.libreoffice.org/privacy" target="_blank">Privacy Policy</a> | <a href="https://www.documentfoundation.org/statutes.pdf" target="_blank">Statutes (non-binding English translation)</a> - <a href="https://www.documentfoundation.org/satzung.pdf" target="_blank">Satzung (binding German version)</a> | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the <a href="https://www.libreoffice.org/download/license/" target="_blank">Mozilla Public License v2.0</a>. “LibreOffice” and “The Document Foundation” are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our <a href="https://wiki.documentfoundation.org/TradeMark_Policy" target="_blank">trademark policy</a>. LibreOffice was based on OpenOffice.org.</p>