summaryrefslogtreecommitdiff
path: root/help3xsl
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2018-03-20 19:38:21 -0300
committerOlivier Hallot <olivier.hallot@libreoffice.org>2018-03-21 19:38:56 +0100
commit4a1008b6ee7043031e9b050adcf836c2f0c88a47 (patch)
tree475a49411ead3dc89b9dc7db41e7f676a2e12df7 /help3xsl
parentbd71cddd5c343dc894e78bb9809acb94ca1db337 (diff)
Deploy videos in New Help (WIP)
Add YouTube videos in New help. add makefile NOTE: <object> is not rendered in old help. NOTE2: Removed online objects from offline help Change-Id: I829fe1858002a454417d36d0651fe49097e008d4 Reviewed-on: https://gerrit.libreoffice.org/51679 Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org> Tested-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl')
-rw-r--r--help3xsl/default.css6
-rw-r--r--help3xsl/online_transform.xsl48
2 files changed, 33 insertions, 21 deletions
diff --git a/help3xsl/default.css b/help3xsl/default.css
index bf5bac86f6..1ae99162b6 100644
--- a/help3xsl/default.css
+++ b/help3xsl/default.css
@@ -255,6 +255,12 @@ h6 {
.mediabutton {
background-color: cyan;
}
+.mediadiv{
+ padding-bottom:5%;
+ height:0;
+ display:inline-block;
+ border:none;
+}
.tintro {
color: white;
background-color: green;
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl
index 0e3a64950b..467f093a9b 100644
--- a/help3xsl/online_transform.xsl
+++ b/help3xsl/online_transform.xsl
@@ -571,7 +571,7 @@
<!-- META, SEE HEADER -->
<xsl:template match="meta" />
-<!-- OBJECT (UNUSED) -->
+<!-- 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>
@@ -1071,32 +1071,38 @@
<!-- Insert an object -->
<xsl:template name="insertobject">
- <xsl:variable name="data">
- <xsl:value-of select="concat($img_url_prefix,@data)"/>
- </xsl:variable>
- <p class="debug">Object: <xsl:value-of select="$data"/></p>
- <xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable>
- <xsl:variable name="width">
+ <xsl:variable name="data">
+ <xsl:value-of select="concat($img_url_prefix,@data)"/>
+ </xsl:variable>
+ <xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable>
+ <xsl:variable name="width">
<xsl:call-template name="convert2px"><xsl:with-param name="value" select="@width"/></xsl:call-template>
- </xsl:variable>
- <xsl:variable name="height">
+ </xsl:variable>
+ <xsl:variable name="height">
<xsl:call-template name="convert2px"><xsl:with-param name="value" select="@height"/></xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="starts-with($type,'video')">
- <div id="mediadiv">
- <video src="{$data}" type="{$type}" width="{$width}" height="{$height}" controls="'1'"></video>
- </div>
+ </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="starts-with($type,'audio')">
- <div id="mediadiv">
- <audio src="{$data}" type="{$type}" controls="'1'"></audio>
- </div>
+ <xsl:when test="not(starts-with(@type,'video/youtube')) and starts-with(@type,'video')">
+ <div id="mediadiv">
+ <video src="{$data}" type="{@type}" width="{$width}" height="{$height}" controls="'1'"></video>
+ </div>
+ </xsl:when>
+ <xsl:when test="starts-with(@type,'audio')">
+ <div id="mediadiv">
+ <audio src="{$data}" type="{@type}" controls="'1'"></audio>
+ </div>
</xsl:when>
<xsl:otherwise>
- <object width="{$width}" height="{$height}" data="{$data}" type="{$type}"></object>
+ <object width="{$width}" height="{$height}" data="{$data}" type="{@type}"></object>
</xsl:otherwise>
- </xsl:choose>
+ </xsl:choose>
</xsl:template>
<!-- changing measure to pixel -->