# HG changeset patch # User František Kučera # Date 1326297719 -3600 # Node ID f866267d7b3c25edee1e921b5c63900b74340bfb # Parent b8e5f8f9c77b0ceeee55170d190d97e4337e02f6 ROT13 – šifrování #18 diff -r b8e5f8f9c77b -r f866267d7b3c vstup/css/styl.css --- a/vstup/css/styl.css Tue Jan 10 17:47:21 2012 +0100 +++ b/vstup/css/styl.css Wed Jan 11 17:01:59 2012 +0100 @@ -124,3 +124,18 @@ color:black; } +.rot13 span { + color: gray; + font-family: monospace; +} + +.rot13 a { + margin-left: -5px; + color: green; + text-decoration: none; +} + +.rot13 a:hover { + color: red; +} + diff -r b8e5f8f9c77b -r f866267d7b3c vstup/js/javascript.js --- a/vstup/js/javascript.js Tue Jan 10 17:47:21 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ - diff -r b8e5f8f9c77b -r f866267d7b3c vstup/js/skript.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vstup/js/skript.js Wed Jan 11 17:01:59 2012 +0100 @@ -0,0 +1,41 @@ +/** + * XML Web generátor – program na generování webových stránek + * Copyright © 2012 František Kučera (frantovo.cz) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * XML Web generátor – jmenný prostor + */ +var xwg = { + /** + * Zašifruje/dešifruje obsah elementu pomocí Rot13. + * @param id ID elementu, jehož text chceme změnit. + */ + rot13: function(id) { + var e = document.getElementById(id); + e.textContent = e.textContent.rot13(); + } +}; + +/** + * Vrací hodnotu textového řetězce zašifrovanou/dešifrovanou algoritmem Rot13 + */ +String.prototype.rot13 = function() { + return this.replace(/[a-zA-Z]/g, function(z) { + return String.fromCharCode((z <= "Z" ? 90 : 122) >= (z = z.charCodeAt(0) + 13) ? z : z - 26); + }); +}; + diff -r b8e5f8f9c77b -r f866267d7b3c vstup/produkty.xml --- a/vstup/produkty.xml Tue Jan 10 17:47:21 2012 +0100 +++ b/vstup/produkty.xml Wed Jan 11 17:01:59 2012 +0100 @@ -15,10 +15,11 @@

Vhodnost zvířete do domácnosti:

+

Tučňáky si prostě oblíbíte!

Panda malá

Vivamus nec dictum dolor. Aliquam et tellus dolor. Curabitur et est sapien. Sed nec neque massa. Integer luctus erat vel arcu molestie ac dapibus dolor pretium. Curabitur eget augue non ipsum pulvinar venenatis eget et lectus. Proin fringilla aliquet sapien, non luctus est lobortis vel. Nunc vehicula volutpat varius. Aliquam suscipit accumsan sollicitudin. Morbi ultricies, mauris id elementum pellentesque, nunc dolor viverra nisl, sit amet consequat velit libero at ligula. Nulla luctus rhoncus tortor nec sollicitudin. Vivamus posuere sodales ipsum, hendrerit cursus felis pharetra sit amet. Nunc interdum facilisis massa ac congue.

-

Aliquam erat volutpat. Quisque vitae libero est. Aliquam erat volutpat. Integer elementum, nisl nec lacinia facilisis, dolor tellus varius eros, sit amet facilisis sem sapien vitae nulla. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer rutrum sodales venenatis. Donec mollis aliquet enim, id venenatis urna faucibus sed. Suspendisse pharetra neque et nibh tincidunt suscipit. Morbi ut justo sit amet lectus faucibus tempor quis non libero. Aenean in dolor sem, in lacinia sem.

+

Aliquam erat volutpat. Quisque vitae libero est. Panda malá je menší než panda velká. Aliquam erat volutpat. Integer elementum, nisl nec lacinia facilisis, dolor tellus varius eros, sit amet facilisis sem sapien vitae nulla. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer rutrum sodales venenatis. Donec mollis aliquet enim, id venenatis urna faucibus sed. Suspendisse pharetra neque et nibh tincidunt suscipit. Morbi ut justo sit amet lectus faucibus tempor quis non libero. Aenean in dolor sem, in lacinia sem.

Vhodnost zvířete do domácnosti:

@@ -30,6 +31,7 @@ Pozor: v současné verzi se stahuje ze Sítě při každém generování. --> + diff -r b8e5f8f9c77b -r f866267d7b3c šablona/makra/šifra.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/šablona/makra/šifra.xsl Wed Jan 11 17:01:59 2012 +0100 @@ -0,0 +1,50 @@ + + + + + + + šifra- + + + + + + + + + + + + +