17 along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 --> |
18 --> |
19 <xsl:stylesheet version="2.0" |
19 <xsl:stylesheet version="2.0" |
20 xmlns="http://www.w3.org/1999/xhtml" |
20 xmlns="http://www.w3.org/1999/xhtml" |
21 xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro" |
21 xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro" |
|
22 xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace" |
22 xmlns:xs="http://www.w3.org/2001/XMLSchema" |
23 xmlns:xs="http://www.w3.org/2001/XMLSchema" |
23 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
24 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
24 exclude-result-prefixes="m xs"> |
25 exclude-result-prefixes="m k xs"> |
25 |
26 |
26 <!-- |
27 <!-- |
27 Interní odkazy |
28 Interní odkazy |
28 ************** |
29 ************** |
29 Slouží k vkládání odkazů na jiné stránky v rámci webu. |
30 Slouží k vkládání odkazů na jiné stránky v rámci webu. |
182 'https://tools.ietf.org/html/rfc', |
183 'https://tools.ietf.org/html/rfc', |
183 @href |
184 @href |
184 )"/> |
185 )"/> |
185 </xsl:call-template> |
186 </xsl:call-template> |
186 </xsl:template> |
187 </xsl:template> |
187 |
188 |
188 |
189 <!-- |
|
190 E-mail |
|
191 ****** |
|
192 Odkaz na e-mail v „obfuskovaném“ tvaru, |
|
193 aby spamovací roboti nemohli tak snadno sbírat e-mailové adresy z webů. |
|
194 Ale zároveň klikatelný, aby ho uživatel nemusel opisovat (vyžaduje JavaScript). |
|
195 Obsah elementu je nepovinný – pokud chybí, vloží se e-mailová adresa. |
|
196 * |
|
197 @href e-mailová adresa (bez „mailto:“) |
|
198 --> |
|
199 <xsl:template match="m:a[@typ='email']"> |
|
200 <xsl:variable name="česky" select="replace(replace(@href, '@', ' zavináč '), '\.', ' tečka ')"/> |
|
201 <xsl:variable name="klíč" select="concat(tokenize($konfigurace/k:web/k:uuid/text(), '-')[1], '9df1')"/> |
|
202 <xsl:variable name="pořadí"><xsl:number level="any"/></xsl:variable> |
|
203 <xsl:variable name="idSpanu" select="concat('c', $klíč, $pořadí)"/> |
|
204 <span title="{text()}" id="{$idSpanu}"> |
|
205 <xsl:value-of select="$česky"/> |
|
206 </span> |
|
207 <span id="{$idSpanu}b" style="display: none"> |
|
208 <xsl:apply-templates/> |
|
209 </span> |
|
210 <script type="text/javascript"> |
|
211 xwg.odkazNaElektronickouPoštu("<xsl:value-of select="$idSpanu"/>"); |
|
212 </script> |
|
213 </xsl:template> |
|
214 |
|
215 |
189 <xsl:template name="vložOdkaz"> |
216 <xsl:template name="vložOdkaz"> |
190 <xsl:param name="url"/> |
217 <xsl:param name="url"/> |
191 <a> |
218 <a> |
192 <!-- Zachováme pouze povolené atributy: --> |
219 <!-- Zachováme pouze povolené atributy: --> |
193 |
220 |