erweiterung xml für video/medien, layout etc.

This commit is contained in:
vv01f 2017-05-10 16:19:58 +02:00
parent 1ee95871eb
commit 894fa52687
10 changed files with 238 additions and 12 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1009 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

View File

@ -576,6 +576,44 @@ a.mime:before {
text-align: right;
vertical-align: middle;
}
/* tab area */
.tabs { list-style: none; }
.tabs li { display: inline; }
.tabs li a { float: left; display: block; padding: 4px 10px; margin-left: -1px; position: relative; left: 0px; background: white; text-decoration: none; }
.tabs li a:hover { background: #ccc; text-decoration: underline; }
.tabs:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }
.tab-boxes { position: relative; }
.tab-area div div { background: white; padding: 20px; position: absolute; top: 0; left: 0; }
.tab-area div div, .tabs li a { border: 1px solid #ccc; }
.tab-boxes .tab-box[id]:target { z-index: 1;}
/* video and maybe other caption and licenses */
a[rel='license']{
border: 0 !important;
}
.line-height-size {
height: 1em;
position: relative;
top: 0.1em;
}
.caption figcaption {
font-size:1.2em;
}
/* toggle content with css */
input.toggle {
position: absolute;
left: -9000px;
z-index: -9;
}
.toggle ~ .toggled {
display: none;
}
.toggle:checked ~ .toggled {
display: block;
}
a[href$=".pdf"].mime:before {
content: url(../images/mime/document.png);
}

View File

@ -159,7 +159,6 @@
<xsl:if test="@itemtype">
<xsl:attribute name="itemtype"><xsl:value-of select="@itemtype"/></xsl:attribute>
</xsl:if>
<xsl:if test="@class">
<xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
</xsl:if>
@ -180,22 +179,179 @@
</xsl:template>
<xsl:template match="source">
<xsl:variable name="medium">
<xsl:value-of select="local-name(..)"/><!-- parent::node() -->
</xsl:variable>
<xsl:variable name="type">
<xsl:choose>
<xsl:when test="substring(@type,string-length(@type)-3,1)='/'"><xsl:value-of select="substring(@type,string-length(@type)-2,string-length(@type))"/></xsl:when>
<xsl:when test="substring(@type,string-length(@type)-4,1)='/'"><xsl:value-of select="substring(@type,string-length(@type)-3,string-length(@type))"/></xsl:when>
<xsl:when test="substring(@src,string-length(@src)-3,1)='.'"><xsl:value-of select="substring(@src,string-length(@src)-2,string-length(@src))"/></xsl:when>
<xsl:when test="substring(@src,string-length(@src)-4,1)='.'"><xsl:value-of select="substring(@src,string-length(@src)-3,string-length(@src))"/></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<source>
<xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute>
<xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
<xsl:if test="@src"><xsl:attribute name="src"><xsl:value-of select="@src"/></xsl:attribute></xsl:if>
<xsl:if test="@srcset"><xsl:attribute name="srcset"><xsl:value-of select="@srcset"/></xsl:attribute></xsl:if>
<xsl:if test="@media"><xsl:attribute name="media"><xsl:value-of select="@media"/></xsl:attribute></xsl:if>
<xsl:if test="@sizes"><xsl:attribute name="sizes"><xsl:value-of select="@sizes"/></xsl:attribute></xsl:if>
<xsl:if test="$type!=''">
<xsl:attribute name="type">
<xsl:call-template name="mime-by-extension">
<xsl:with-param name="extension"><xsl:value-of select="$type"/></xsl:with-param>
<xsl:with-param name="medium"><xsl:value-of select="$medium"/></xsl:with-param>
</xsl:call-template>
</xsl:attribute>
</xsl:if>
<xsl:value-of select="$medium"/>
</source>
</xsl:template>
<xsl:template match="video">
<video>
<xsl:if test="@type='loop'">
<xsl:attribute name="loop"><xsl:value-of select="@type"/></xsl:attribute>
<xsl:attribute name="autoplay">autoplay</xsl:attribute>
<xsl:attribute name="muted">muted</xsl:attribute>
</xsl:if>
<xsl:apply-templates/>
</video>
<xsl:template match="label">
<label>
<xsl:if test="@for"><xsl:attribute name="for"><xsl:value-of select="@for"/></xsl:attribute></xsl:if>
<xsl:if test="@id"><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute></xsl:if>
<xsl:if test="@class"><xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute></xsl:if>
<xsl:if test="@style"><xsl:attribute name="style"><xsl:value-of select="@style"/></xsl:attribute></xsl:if>
<xsl:apply-templates/>
</label>
</xsl:template>
<xsl:template match="input">
<input>
<xsl:if test="@type"><xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute></xsl:if>
<xsl:if test="@name"><xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute></xsl:if>
<xsl:if test="@value"><xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute></xsl:if>
<xsl:if test="@checked"><xsl:attribute name="checked"><xsl:value-of select="@checked"/></xsl:attribute></xsl:if>
<xsl:if test="@selected"><xsl:attribute name="selected"><xsl:value-of select="@selected"/></xsl:attribute></xsl:if>
<xsl:if test="@id"><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute></xsl:if>
<xsl:if test="@class"><xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute></xsl:if>
<xsl:if test="@style"><xsl:attribute name="style"><xsl:value-of select="@style"/></xsl:attribute></xsl:if>
<xsl:apply-templates/>
</input>
</xsl:template>
<xsl:template match="video">
<xsl:variable name="license">
<xsl:choose>
<xsl:when test="@license">
<xsl:value-of select="translate(@license, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="author">
<xsl:choose>
<xsl:when test="@author"><xsl:value-of select="@author"/></xsl:when>
<xsl:otherwise><!-- anonymous/unknown --></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="class"><xsl:if test="@class"><xsl:value-of select="@class"/></xsl:if></xsl:variable>
<figure>
<xsl:attribute name="class"><xsl:value-of select="$class"/></xsl:attribute>
<video>
<xsl:choose>
<xsl:when test="@type='loop'">
<xsl:attribute name="loop"><xsl:value-of select="@type"/></xsl:attribute>
<xsl:attribute name="autoplay">autoplay</xsl:attribute>
<xsl:attribute name="muted">muted</xsl:attribute>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
<xsl:if test="@id"><xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute></xsl:if>
<xsl:apply-templates/>
<p class="error">Dein Browser unterstützt keine HTML5-Videos.</p>
</video>
<xsl:variable name="caption">
<xsl:choose>
<xsl:when test="@caption"><xsl:value-of select="@caption"/></xsl:when>
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<figcaption>
<xsl:if test="$caption!=''"><em><xsl:value-of select="$caption"/></em></xsl:if>
<xsl:variable name="licenselink">
<xsl:call-template name="licenselinks"><xsl:with-param name="license"><xsl:value-of select="$license"/></xsl:with-param></xsl:call-template>
</xsl:variable>
<xsl:variable name="licensehref">
<xsl:call-template name="make-href"><xsl:with-param name="href">
<xsl:choose>
<xsl:when test="not(@licenselink) or @licenselink=''">
<xsl:value-of select="$licenselink"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@licenselink"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param></xsl:call-template>
</xsl:variable>
<xsl:if test="$license!=''">
<xsl:value-of select="' '"/>
<xsl:choose>
<xsl:when test="$licensehref=''">
<span><xsl:attribute name="rel">license</xsl:attribute><xsl:value-of select="$license"/></span>
</xsl:when>
<xsl:otherwise>
<a>
<xsl:attribute name="href"><xsl:value-of select="$licensehref"/></xsl:attribute>
<xsl:attribute name="rel">license</xsl:attribute>
<xsl:attribute name="class"><xsl:value-of select="concat('license-link ',@class)"/></xsl:attribute>
<xsl:call-template name="licenselogos"><xsl:with-param name="license"><xsl:value-of select="$license"/></xsl:with-param></xsl:call-template>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="$author!=''"><xsl:value-of select="' '"/><span><xsl:attribute name="rel">author</xsl:attribute><xsl:value-of select="$author"/></span></xsl:if>
</figcaption>
</figure>
</xsl:template>
<xsl:template name="licenselinks">
<xsl:param name="license"/>
<xsl:variable name="l">
<xsl:call-template name="string-to-upper">
<xsl:with-param name="string" select="$license"/>
<xsl:with-param name="forspace">-</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$l='PDM'">https://creativecommons.org/share-your-work/public-domain/pdm/</xsl:when>
<xsl:when test="$l='CC0'">https://creativecommons.org/publicdomain/zero/1.0/legalcode</xsl:when>
<xsl:when test="$l='CC-BY'">https://creativecommons.org/licenses/by/4.0/legalcode</xsl:when>
<xsl:when test="$l='CC-BY-SA'">https://creativecommons.org/licenses/by-sa/4.0/legalcode</xsl:when>
<xsl:when test="$l='CC-BY-ND'">https://creativecommons.org/licenses/by-nd/4.0/legalcode</xsl:when>
<xsl:when test="$l='CC-BY-NC'">https://creativecommons.org/licenses/by-nc/4.0/legalcode</xsl:when>
<xsl:when test="$l='CC-BY-NC-SA'">https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode</xsl:when>
<xsl:when test="$l='CC-BY-NC-ND'">https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="licenselogos">
<xsl:param name="license"/>
<xsl:variable name="image">
<xsl:choose>
<xsl:when test="$license='CC0'">0</xsl:when>
<xsl:when test="$license='PDM'">pd</xsl:when>
<xsl:when test="substring($license,1,2)='CC'"><xsl:value-of select="substring($license,4,string-length($license)-3)"/></xsl:when>
<xsl:otherwise><!-- no image/rude defined for this license --></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<img>
<xsl:attribute name="src">./images/cc-<xsl:call-template name="string-to-lower">
<xsl:with-param name="string" select="$image"/>
<xsl:with-param name="forspace">-</xsl:with-param>
</xsl:call-template>-88x31.png</xsl:attribute>
<xsl:attribute name="title"><xsl:value-of select="$license"/></xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="$license"/></xsl:attribute>
<xsl:attribute name="class"><xsl:value-of select="concat('line-height-size ',@class)"/></xsl:attribute>
</img>
</xsl:template>
<!-- Bilder in News-Einträgen haben Pfad immer relativ zu /images/news/ -->
<xsl:template match="image">
<xsl:variable name="path">
@ -315,6 +471,7 @@
</xsl:template>
<xsl:template match="figcaption">
<figcaption>
<xsl:attribute name="class">caption</xsl:attribute>
<xsl:apply-templates/>
</figcaption>
</xsl:template>
@ -700,6 +857,31 @@
</xsl:choose>
</xsl:template>
<xsl:template name="mime-by-extension">
<xsl:param name="extension"/>
<xsl:param name="medium">media</xsl:param>
<xsl:variable name="e">
<xsl:call-template name="string-to-lower">
<xsl:with-param name="string"><xsl:value-of select="$extension"/></xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="m">
<xsl:call-template name="string-to-lower">
<xsl:with-param name="string">
<xsl:choose>
<xsl:when test="$medium='picture'">image</xsl:when>
<xsl:when test="$medium='video' or $medium='audio'"><xsl:value-of select="$medium"/></xsl:when>
</xsl:choose>
</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$e='webm' or $e='mp4' or $e='ogg'"><xsl:value-of select="$m"/>/<xsl:value-of select="$e"/></xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template name="mime-for-human">
<xsl:param name="mime"/>
@ -810,4 +992,10 @@
<xsl:value-of select="translate($string, ' ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ', concat($forspace,'abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ'))"/>
</xsl:template>
<xsl:template name="string-to-upper">
<xsl:param name="string"/>
<xsl:param name="forspace"> </xsl:param>
<xsl:value-of select="translate($string,' abcdefghijklmnopqrstuvwxyzàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿžšœ',concat($forspace, 'ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞŸŽŠŒ'))"/>
</xsl:template>
</xsl:stylesheet>