# HG changeset patch # User František Kučera <franta-hg@frantovo.cz> # Date 1236436573 -3600 # Node ID 43a6e33a4854adb6a694dae6bdd5083dd246a63a # Parent f6b8c00ef3d305139b0672025cc2767604158732 Logo, Kaptcha (captcha) a vylepšený formulář diff -r f6b8c00ef3d3 -r 43a6e33a4854 java/UpozorneniEmailem/nbproject/build-impl.xml --- a/java/UpozorneniEmailem/nbproject/build-impl.xml Sat Mar 07 14:12:27 2009 +0100 +++ b/java/UpozorneniEmailem/nbproject/build-impl.xml Sat Mar 07 15:36:13 2009 +0100 @@ -498,10 +498,15 @@ </target> <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/> <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest"> + <copyfiles files="${libs.Kaptcha.classpath}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.libs.Kaptcha.classpath" todir="${dist.ear.dir}"/> <mkdir dir="${build.web.dir}/META-INF"/> - <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/> + <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"> + <attribute name="Class-Path" value="${manifest.libs.Kaptcha.classpath} "/> + </manifest> </target> - <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"/> + <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"> + <copyfiles files="${libs.Kaptcha.classpath}" todir="${build.web.dir}/WEB-INF/lib"/> + </target> <target depends="init,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" name="do-ear-dist"> <dirname file="${dist.ear.war}" property="dist.jar.dir"/> <mkdir dir="${dist.jar.dir}"/> diff -r f6b8c00ef3d3 -r 43a6e33a4854 java/UpozorneniEmailem/nbproject/genfiles.properties --- a/java/UpozorneniEmailem/nbproject/genfiles.properties Sat Mar 07 14:12:27 2009 +0100 +++ b/java/UpozorneniEmailem/nbproject/genfiles.properties Sat Mar 07 15:36:13 2009 +0100 @@ -1,8 +1,8 @@ -build.xml.data.CRC32=15ba57e8 +build.xml.data.CRC32=b763cd1a build.xml.script.CRC32=6228cf8f build.xml.stylesheet.CRC32=c0ebde35 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=15ba57e8 -nbproject/build-impl.xml.script.CRC32=1eabcb3d +nbproject/build-impl.xml.data.CRC32=b763cd1a +nbproject/build-impl.xml.script.CRC32=f0626c5f nbproject/build-impl.xml.stylesheet.CRC32=174458fc diff -r f6b8c00ef3d3 -r 43a6e33a4854 java/UpozorneniEmailem/nbproject/project.properties --- a/java/UpozorneniEmailem/nbproject/project.properties Sat Mar 07 14:12:27 2009 +0100 +++ b/java/UpozorneniEmailem/nbproject/project.properties Sat Mar 07 15:36:13 2009 +0100 @@ -23,7 +23,8 @@ j2ee.platform=1.5 j2ee.server.type=J2EE jar.compress=false -javac.classpath= +javac.classpath=\ + ${libs.Kaptcha.classpath} # Space-separated list of extra javac options javac.compilerargs= javac.debug=true @@ -49,7 +50,6 @@ javadoc.windowtitle= jspcompilation.classpath=${jspc.classpath}:${javac.classpath} lib.dir=${web.docbase.dir}/WEB-INF/lib -no.dependencies=false persistence.xml.dir=${conf.dir} platform.active=default_platform resource.dir=setup diff -r f6b8c00ef3d3 -r 43a6e33a4854 java/UpozorneniEmailem/nbproject/project.xml --- a/java/UpozorneniEmailem/nbproject/project.xml Sat Mar 07 14:12:27 2009 +0100 +++ b/java/UpozorneniEmailem/nbproject/project.xml Sat Mar 07 15:36:13 2009 +0100 @@ -5,13 +5,18 @@ <data xmlns="http://www.netbeans.org/ns/web-project/3"> <name>UpozorneniEmailem</name> <minimum-ant-version>1.6.5</minimum-ant-version> - <web-module-libraries/> + <web-module-libraries> + <library> + <file>${libs.Kaptcha.classpath}</file> + <path-in-war>WEB-INF/lib</path-in-war> + </library> + </web-module-libraries> <web-module-additional-libraries/> <source-roots> - <root id="src.dir" name="Source Packages"/> + <root id="src.dir"/> </source-roots> <test-roots> - <root id="test.src.dir" name="Test Packages"/> + <root id="test.src.dir"/> </test-roots> </data> </configuration> diff -r f6b8c00ef3d3 -r 43a6e33a4854 java/UpozorneniEmailem/web/WEB-INF/web.xml --- a/java/UpozorneniEmailem/web/WEB-INF/web.xml Sat Mar 07 14:12:27 2009 +0100 +++ b/java/UpozorneniEmailem/web/WEB-INF/web.xml Sat Mar 07 15:36:13 2009 +0100 @@ -7,5 +7,32 @@ </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> - </welcome-file-list> - </web-app> + </welcome-file-list> + + <!-- Kaptcha --> + <servlet> + <servlet-name>Kaptcha</servlet-name> + <servlet-class>com.google.code.kaptcha.servlet.KaptchaServlet</servlet-class> + <init-param> + <param-name>kaptcha.border</param-name> + <param-value>no</param-value> + </init-param> + <init-param> + <param-name>kaptcha.textproducer.font.color</param-name> + <param-value>orange</param-value> + </init-param> + <init-param> + <param-name>kaptcha.image.height</param-name> + <param-value>50</param-value> + </init-param> + <init-param> + <param-name>kaptcha.image.width</param-name> + <param-value>300</param-value> + </init-param> + </servlet> + <servlet-mapping> + <servlet-name>Kaptcha</servlet-name> + <url-pattern>/protiZlymRobotum.jpg</url-pattern> + </servlet-mapping> + <!-- Kaptcha - konec --> +</web-app> diff -r f6b8c00ef3d3 -r 43a6e33a4854 java/UpozorneniEmailem/web/css/styl.css --- a/java/UpozorneniEmailem/web/css/styl.css Sat Mar 07 14:12:27 2009 +0100 +++ b/java/UpozorneniEmailem/web/css/styl.css Sat Mar 07 15:36:13 2009 +0100 @@ -32,6 +32,10 @@ border: none; } +#logo { + margin-right: 1em; +} + #licence { border: 1px solid silver; font-size: smaller; @@ -44,7 +48,7 @@ form { text-align: right; - max-width: 22em; + max-width: 32em; } fieldset { @@ -54,14 +58,24 @@ input { margin: 2px; padding: 2px; - width: 200px; + width: 300px; + border: 1px solid silver; } -select { +#protiZlymRobotum { + margin: 2px; + padding: 2px; + border: 1px solid silver; +} + +textarea{ margin: 2px; padding: 2px; - width: 208px; + width: 300px; + height: 100px; + border: 1px solid silver; } + button { margin: 2px; margin-top: 2px; diff -r f6b8c00ef3d3 -r 43a6e33a4854 java/UpozorneniEmailem/web/index.jsp --- a/java/UpozorneniEmailem/web/index.jsp Sat Mar 07 14:12:27 2009 +0100 +++ b/java/UpozorneniEmailem/web/index.jsp Sat Mar 07 15:36:13 2009 +0100 @@ -14,7 +14,7 @@ <script type="text/javascript" src="js/ui.datepicker-cs.js"></script> </head> <body> - <h1>Upozornění e-mailem</h1> + <h1><img src="logo.png" alt="logo" id="logo"/>Upozornění e-mailem</h1> <script type="text/javascript"> @@ -40,9 +40,18 @@ <p> <form action="?akce=zaloz" method="post"> <fieldset> - <label title="Kdy bude odesláno upozornění.">Datum: <input id="datepicker" type="text" name="datum"></label><br/> - <label title="Předmět upozorňovacího e-mailu.">Předmět: <input type="text" name="Předmět"></label><br/> - <button title="Vytvoží upozornění a pošle vám potvrzovací e-mail.">Přidat!</button> + <label title="Kam bude odesláno upozornění.">E-mail: <input type="text" name="email"/></label><br/> + <label title="Kdy bude odesláno upozornění.">Datum: <input id="datepicker" type="text" name="datum"/></label><br/> + <label title="Předmět upozorňovacího e-mailu.">Předmět: <input type="text" name="predmet"/></label><br/> + <label title="Text upozorňovacího e-mailu.">Text: <textarea type="text" name="text"></textarea></label><br/> + <img src="protiZlymRobotum.jpg" alt="Kaptcha" id="protiZlymRobotum" title="Pokud je obrázek nečitelný, klikněte na něj a vygeneruje se nový."/><br/> + <script type="text/javascript"> + $(function(){ + $('#protiZlymRobotum').click(function () { $(this).attr('src', 'protiZlymRobotum.jpg?' + Math.floor(Math.random()*100) ); }) + }); + </script> + <label title="Opište kód z obrázku.">Kontrolní kód: <input type="text" name="protiZlymRobotum"/></label><br/> + <button title="Vytvoží upozornění a pošle vám potvrzovací e-mail.">Přidat upozornění!</button> </fieldset> </form> </p> @@ -56,7 +65,6 @@ <div id="tabs-3"> <p> - </p> </div> </div>