[Libreoffice-commits] help.git: help3xsl/default.css help3xsl/online_transform.xsl source/text

Olivier Hallot olivier.hallot at libreoffice.org
Tue May 8 10:29:05 UTC 2018


 help3xsl/default.css               |    2 ++
 help3xsl/online_transform.xsl      |   36 +++++++++++++++++++++++++++++++-----
 source/text/shared/00/00000004.xhp |    4 +---
 3 files changed, 34 insertions(+), 8 deletions(-)

New commits:
commit bc322f3bc59d3d05b61cc229eba17f86d157c8f8
Author: Olivier Hallot <olivier.hallot at libreoffice.org>
Date:   Mon May 7 16:59:37 2018 -0300

    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 at libreoffice.org>
    Reviewed-by: Olivier Hallot <olivier.hallot at libreoffice.org>

diff --git a/help3xsl/default.css b/help3xsl/default.css
index d17f5b2c1..b352360e1 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 5ab53c8d7..b8b73361d 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, at 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, at 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, at 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, at 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, at 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, at 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, at 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 b151e9c35..1b3353af4 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>


More information about the Libreoffice-commits mailing list