summaryrefslogtreecommitdiff
path: root/source/online_transform.xsl
diff options
context:
space:
mode:
authorOlivier Hallot <ohallot@collabora.co.uk>2016-11-13 18:15:20 -0200
committerOlivier Hallot <olivier.hallot@edx.srv.br>2016-11-13 20:18:16 +0000
commite852c87f0bef8b19c4d733460bb10910a880e769 (patch)
tree19acefb99f8c49a54152059144e59cdcc1a8bcb8 /source/online_transform.xsl
parent106850a265b62c6a85d713c20afe131844013f0a (diff)
New <object> element in online help + cleanups
* Implementation of <object> element in XHP files, with corresponding transformation in XSLT. Video objects maps to HTML5 <video> and audio objects into <audio> elements. Generic <object> maps to HTML5 <object> (WIP) * CSS file with some cleanup and branding colors, includes the option to show debug info in .debug class. CSS fonts with recent changes. * Index.html file with new <div> and better font rendering * help.js with info on top right about the page displayed * Cleanup of getbookmark.sh * New README with instructions Change-Id: I856b99308ee008d8607dd0ba60a446224cc26e58 Reviewed-on: https://gerrit.libreoffice.org/30812 Reviewed-by: Olivier Hallot <olivier.hallot@edx.srv.br> Tested-by: Olivier Hallot <olivier.hallot@edx.srv.br>
Diffstat (limited to 'source/online_transform.xsl')
-rw-r--r--source/online_transform.xsl33
1 files changed, 30 insertions, 3 deletions
diff --git a/source/online_transform.xsl b/source/online_transform.xsl
index 42e5def05e..14c3dea329 100644
--- a/source/online_transform.xsl
+++ b/source/online_transform.xsl
@@ -327,7 +327,8 @@
<xsl:template match="meta" />
<!-- OBJECT (UNUSED) -->
-<xsl:template match="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>
<!-- PARAGRAPH -->
<xsl:template match="paragraph">
@@ -655,7 +656,7 @@
<!-- <p>href: <xsl:value-of select="$href"/></p>
<p>anchor: <xsl:value-of select="$anchor"/></p>
<p>document: <xsl:value-of select="$doc"/></p>-->
- <p class="bug">image source: <xsl:value-of select="$imgsrc"/></p>
+ <p class="debug">image source: <xsl:value-of select="$imgsrc"/></p>
<div class="{$type}">
<table border="0" class="{$type}" cellspacing="0" cellpadding="5">
<tr>
@@ -814,7 +815,7 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
- <p class="bug">Image: <xsl:value-of select="$src"/></p>
+ <p class="debug">Image: <xsl:value-of select="$src"/></p>
<!--<xsl:variable name="src"><xsl:value-of select="concat($img_url_prefix,@src)"/></xsl:variable>-->
<xsl:variable name="alt"><xsl:value-of select="./alt"/></xsl:variable>
<xsl:variable name="width">
@@ -827,6 +828,32 @@
<img src="{$src}" alt="{$alt}" title="{$alt}" style="{$istyle}"></img>
</xsl:template>
+<!-- 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:call-template name="convert2px"><xsl:with-param name="value" select="@width"/></xsl:call-template>
+ </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')">
+ <video src="{$data}" type="{$type}" width="{$width}" height="{$height}" controls="'1'"></video>
+ </xsl:when>
+ <xsl:when test="starts-with($type,'audio')">
+ <audio src="{$data}" type="{$type}" controls="'1'"></audio>
+ </xsl:when>
+ <xsl:otherwise>
+ <object width="{$width}" height="{$height}" data="{$data}"></object>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
<!-- changing measure to pixel -->
<xsl:template name="convert2px">
<xsl:param name="value"/>