šablona/makra/odkazy.xsl
changeset 93 5b55827de220
parent 87 25dec6931f18
child 98 532deb4b908e
     1.1 --- a/šablona/makra/odkazy.xsl	Sat Jan 14 19:10:26 2012 +0100
     1.2 +++ b/šablona/makra/odkazy.xsl	Thu Feb 09 14:52:20 2012 +0100
     1.3 @@ -19,9 +19,10 @@
     1.4  <xsl:stylesheet version="2.0"
     1.5  	xmlns="http://www.w3.org/1999/xhtml"
     1.6  	xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"
     1.7 +	xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace"
     1.8  	xmlns:xs="http://www.w3.org/2001/XMLSchema"
     1.9  	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    1.10 -	exclude-result-prefixes="m xs">
    1.11 +	exclude-result-prefixes="m k xs">
    1.12  
    1.13  	<!--
    1.14  		Interní odkazy
    1.15 @@ -96,7 +97,7 @@
    1.16  				)"/>
    1.17  		</xsl:call-template>
    1.18  	</xsl:template>
    1.19 -	
    1.20 +
    1.21  	<!--
    1.22  		Wikipedia
    1.23  		*********
    1.24 @@ -114,7 +115,7 @@
    1.25  				)"/>
    1.26  		</xsl:call-template>
    1.27  	</xsl:template>
    1.28 -	
    1.29 +
    1.30  	<!--
    1.31  		Javadoc
    1.32  		*******
    1.33 @@ -133,7 +134,7 @@
    1.34  				)"/>
    1.35  		</xsl:call-template>
    1.36  	</xsl:template>
    1.37 -	
    1.38 +
    1.39  	<!-- 
    1.40  		Seznam.cz
    1.41  		*********
    1.42 @@ -167,7 +168,7 @@
    1.43  				)"/>
    1.44  		</xsl:call-template>	
    1.45  	</xsl:template>
    1.46 -	
    1.47 +
    1.48  	<!-- 
    1.49  		Request for comments
    1.50  		********************
    1.51 @@ -184,8 +185,34 @@
    1.52  				)"/>
    1.53  		</xsl:call-template>
    1.54  	</xsl:template>
    1.55 -	
    1.56 -	
    1.57 +
    1.58 +	<!--
    1.59 +		E-mail
    1.60 +		******
    1.61 +		Odkaz na e-mail v „obfuskovaném“ tvaru,
    1.62 +		aby spamovací roboti nemohli tak snadno sbírat e-mailové adresy z webů.
    1.63 +		Ale zároveň klikatelný, aby ho uživatel nemusel opisovat (vyžaduje JavaScript).
    1.64 +		Obsah elementu je nepovinný – pokud chybí, vloží se e-mailová adresa.
    1.65 +		*
    1.66 +		@href e-mailová adresa (bez „mailto:“)
    1.67 +	-->
    1.68 +	<xsl:template match="m:a[@typ='email']">
    1.69 +		<xsl:variable name="česky" select="replace(replace(@href, '@', ' zavináč '), '\.', ' tečka ')"/>
    1.70 +		<xsl:variable name="klíč" select="concat(tokenize($konfigurace/k:web/k:uuid/text(), '-')[1], '9df1')"/>
    1.71 +		<xsl:variable name="pořadí"><xsl:number level="any"/></xsl:variable>
    1.72 +		<xsl:variable name="idSpanu" select="concat('c', $klíč, $pořadí)"/>
    1.73 +		<span title="{text()}" id="{$idSpanu}">
    1.74 +			<xsl:value-of select="$česky"/>
    1.75 +		</span>
    1.76 +		<span id="{$idSpanu}b" style="display: none">
    1.77 +			<xsl:apply-templates/>
    1.78 +		</span>
    1.79 +		<script type="text/javascript">
    1.80 +			xwg.odkazNaElektronickouPoštu("<xsl:value-of select="$idSpanu"/>");
    1.81 +		</script>
    1.82 +	</xsl:template>
    1.83 +
    1.84 +
    1.85  	<xsl:template name="vložOdkaz">
    1.86  		<xsl:param name="url"/>
    1.87  		<a>