summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2018-05-07 16:59:37 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2018-05-08 12:28:41 +0200
commitbc322f3bc59d3d05b61cc229eba17f86d157c8f8 (patch)
treed72201bd911e1573689dbf5aa1e5ecad0454f31a
parent7e1d1370189e34e02b526d5a30095c1794d7546c (diff)
Refactor test for online case wrt objects
Also refactor the section "Open file with example". Wrap in a div with class. Change-Id: I14b1b7ca6ca788383824db3db4db4014b295976e Reviewed-on: https://gerrit.libreoffice.org/53946 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
-rw-r--r--help3xsl/default.css2
-rw-r--r--help3xsl/online_transform.xsl36
-rw-r--r--source/text/shared/00/00000004.xhp4
3 files changed, 34 insertions, 8 deletions
diff --git a/help3xsl/default.css b/help3xsl/default.css
index d17f5b2c10..b352360e19 100644
--- a/help3xsl/default.css
+++ b/help3xsl/default.css
@@ -236,6 +236,8 @@ h6 {
.howtogetbody {
margin: 0px;
}
+.samplefilesection{
+}
.wide {
width: 100%;
}
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 5ab53c8d75..b8b73361d8 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -568,8 +568,16 @@
<xsl:template match="meta" />
<!-- OBJECT -->
-<xsl:template match="object"><xsl:call-template name="insertobject"/></xsl:template>
-<xsl:template match="object" mode="embedded"><xsl:call-template name="insertobject"/></xsl:template>
+<xsl:template match="object">
+ <xsl:if test="$online">
+ <xsl:call-template name="insertobject"/>
+ </xsl:if>
+</xsl:template>
+<xsl:template match="object" mode="embedded">
+ <xsl:if test="$online">
+ <xsl:call-template name="insertobject"/>
+ </xsl:if>
+</xsl:template>
<!-- PARAGRAPH -->
<xsl:template match="paragraph">
@@ -1142,6 +1150,8 @@
<!-- Insert an object -->
<xsl:template name="insertobject">
+ <xsl:variable name="tmp_href"><xsl:value-of select="concat($urlpre,'text/shared/00/00000004.xhp')"/></xsl:variable>
+ <xsl:variable name="tmp_doc" select="document($tmp_href)"/>
<xsl:variable name="data">
<xsl:value-of select="concat($img_url_prefix,@data)"/>
</xsl:variable>
@@ -1154,11 +1164,9 @@
</xsl:variable>
<xsl:choose>
<xsl:when test="starts-with(@type,'video/youtube')">
- <xsl:if test="$online">
<div id="mediadiv">
<iframe id="{@id}" src="{@data}" width="{$width}" height="{$height}" frameborder="0" allowfullscreen="true"></iframe>
</div>
- </xsl:if>
</xsl:when>
<xsl:when test="not(starts-with(@type,'video/youtube')) and starts-with(@type,'video')">
<div id="mediadiv">
@@ -1171,22 +1179,40 @@
</div>
</xsl:when>
<xsl:when test="@type='application/vnd.oasis.opendocument.spreadsheet'">
+ <div class="samplefilesection">
+ <h3><xsl:apply-templates select="$tmp_doc//variable[@id='samplefile']"/></h3>
<a class="objectfiles" href="{concat($target,@data)}"><img src="{concat($target,'media/navigation/libo-calc.svg')}" width="25px" height="30px"></img></a>
+ </div>
</xsl:when>
<xsl:when test="@type='application/vnd.oasis.opendocument.text'">
+ <div class="samplefilesection">
+ <h3><xsl:apply-templates select="$tmp_doc//variable[@id='samplefile']"/></h3>
<a class="objectfiles" href="{concat($target,@data)}"><img src="{concat($target,'media/navigation/libo-writer.svg')}" width="25px" height="30px"></img></a>
+ </div>
</xsl:when>
<xsl:when test="@type='application/vnd.oasis.opendocument.presentation'">
+ <div class="samplefilesection">
+ <h3><xsl:apply-templates select="$tmp_doc//variable[@id='samplefile']"/></h3>
<a class="objectfiles" href="{concat($target,@data)}"><img src="{concat($target,'media/navigation/libo-impress.svg')}" width="25px" height="30px"></img></a>
- </xsl:when>
+ </div>
+ </xsl:when>
<xsl:when test="@type='application/vnd.oasis.opendocument.drawing'">
+ <div class="samplefilesection">
+ <h3><xsl:apply-templates select="$tmp_doc//variable[@id='samplefile']"/></h3>
<a class="objectfiles" href="{concat($target,@data)}"><img src="{concat($target,'media/navigation/libo-draw.svg')}" width="25px" height="30px"></img></a>
+ </div>
</xsl:when>
<xsl:when test="@type='application/vnd.oasis.opendocument.formula'">
+ <div class="samplefilesection">
+ <h3><xsl:apply-templates select="$tmp_doc//variable[@id='samplefile']"/></h3>
<a class="objectfiles" href="{concat($target,@data)}"><img src="{concat($target,'media/navigation/libo-math.svg')}" width="25px" height="30px"></img></a>
+ </div>
</xsl:when>
<xsl:when test="@type='application/vnd.oasis.opendocument.database'">
+ <div class="samplefilesection">
+ <h3><xsl:apply-templates select="$tmp_doc//variable[@id='samplefile']"/></h3>
<a class="objectfiles" href="{concat($target,@data)}"><img src="{concat($target,'media/navigation/libo-base.svg')}" width="25px" height="30px"></img></a>
+ </div>
</xsl:when>
<xsl:otherwise>
<object width="{$width}" height="{$height}" data="{$data}" type="{@type}"></object>
diff --git a/source/text/shared/00/00000004.xhp b/source/text/shared/00/00000004.xhp
index b151e9c35c..1b3353af46 100644
--- a/source/text/shared/00/00000004.xhp
+++ b/source/text/shared/00/00000004.xhp
@@ -38,9 +38,7 @@
<paragraph role="related" id="par_id3147212" xml-lang="en-US"><variable id="related"><emph>Related Topics</emph>
</variable></paragraph>
</section>
-<section id="samplefile">
- <paragraph role="heading" id="hd_id161521663319917" level="3" xml-lang="en-US"><variable id="samplefile">Open file with example:</variable></paragraph>
-</section>
+<paragraph role="heading" id="hd_id161521663319917" level="3" xml-lang="en-US"><variable id="samplefile">Open file with example:</variable></paragraph>
<section id="sytextfarbe">
<table id="tbl_id3156421">
<tablerow>