Logo, Kaptcha (captcha) a vylepšený formulář
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat Mar 07 15:36:13 2009 +0100 (2009-03-07)
changeset 243a6e33a4854
parent 1 f6b8c00ef3d3
child 3 6c77707f0e1a
Logo, Kaptcha (captcha) a vylepšený formulář
java/UpozorneniEmailem/nbproject/build-impl.xml
java/UpozorneniEmailem/nbproject/genfiles.properties
java/UpozorneniEmailem/nbproject/project.properties
java/UpozorneniEmailem/nbproject/project.xml
java/UpozorneniEmailem/web/WEB-INF/web.xml
java/UpozorneniEmailem/web/css/styl.css
java/UpozorneniEmailem/web/index.jsp
     1.1 --- a/java/UpozorneniEmailem/nbproject/build-impl.xml	Sat Mar 07 14:12:27 2009 +0100
     1.2 +++ b/java/UpozorneniEmailem/nbproject/build-impl.xml	Sat Mar 07 15:36:13 2009 +0100
     1.3 @@ -498,10 +498,15 @@
     1.4      </target>
     1.5      <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
     1.6      <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
     1.7 +        <copyfiles files="${libs.Kaptcha.classpath}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.libs.Kaptcha.classpath" todir="${dist.ear.dir}"/>
     1.8          <mkdir dir="${build.web.dir}/META-INF"/>
     1.9 -        <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
    1.10 +        <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update">
    1.11 +            <attribute name="Class-Path" value="${manifest.libs.Kaptcha.classpath} "/>
    1.12 +        </manifest>
    1.13      </target>
    1.14 -    <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir"/>
    1.15 +    <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
    1.16 +        <copyfiles files="${libs.Kaptcha.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
    1.17 +    </target>
    1.18      <target depends="init,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" name="do-ear-dist">
    1.19          <dirname file="${dist.ear.war}" property="dist.jar.dir"/>
    1.20          <mkdir dir="${dist.jar.dir}"/>
     2.1 --- a/java/UpozorneniEmailem/nbproject/genfiles.properties	Sat Mar 07 14:12:27 2009 +0100
     2.2 +++ b/java/UpozorneniEmailem/nbproject/genfiles.properties	Sat Mar 07 15:36:13 2009 +0100
     2.3 @@ -1,8 +1,8 @@
     2.4 -build.xml.data.CRC32=15ba57e8
     2.5 +build.xml.data.CRC32=b763cd1a
     2.6  build.xml.script.CRC32=6228cf8f
     2.7  build.xml.stylesheet.CRC32=c0ebde35
     2.8  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     2.9  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    2.10 -nbproject/build-impl.xml.data.CRC32=15ba57e8
    2.11 -nbproject/build-impl.xml.script.CRC32=1eabcb3d
    2.12 +nbproject/build-impl.xml.data.CRC32=b763cd1a
    2.13 +nbproject/build-impl.xml.script.CRC32=f0626c5f
    2.14  nbproject/build-impl.xml.stylesheet.CRC32=174458fc
     3.1 --- a/java/UpozorneniEmailem/nbproject/project.properties	Sat Mar 07 14:12:27 2009 +0100
     3.2 +++ b/java/UpozorneniEmailem/nbproject/project.properties	Sat Mar 07 15:36:13 2009 +0100
     3.3 @@ -23,7 +23,8 @@
     3.4  j2ee.platform=1.5
     3.5  j2ee.server.type=J2EE
     3.6  jar.compress=false
     3.7 -javac.classpath=
     3.8 +javac.classpath=\
     3.9 +    ${libs.Kaptcha.classpath}
    3.10  # Space-separated list of extra javac options
    3.11  javac.compilerargs=
    3.12  javac.debug=true
    3.13 @@ -49,7 +50,6 @@
    3.14  javadoc.windowtitle=
    3.15  jspcompilation.classpath=${jspc.classpath}:${javac.classpath}
    3.16  lib.dir=${web.docbase.dir}/WEB-INF/lib
    3.17 -no.dependencies=false
    3.18  persistence.xml.dir=${conf.dir}
    3.19  platform.active=default_platform
    3.20  resource.dir=setup
     4.1 --- a/java/UpozorneniEmailem/nbproject/project.xml	Sat Mar 07 14:12:27 2009 +0100
     4.2 +++ b/java/UpozorneniEmailem/nbproject/project.xml	Sat Mar 07 15:36:13 2009 +0100
     4.3 @@ -5,13 +5,18 @@
     4.4          <data xmlns="http://www.netbeans.org/ns/web-project/3">
     4.5              <name>UpozorneniEmailem</name>
     4.6              <minimum-ant-version>1.6.5</minimum-ant-version>
     4.7 -            <web-module-libraries/>
     4.8 +            <web-module-libraries>
     4.9 +                <library>
    4.10 +                    <file>${libs.Kaptcha.classpath}</file>
    4.11 +                    <path-in-war>WEB-INF/lib</path-in-war>
    4.12 +                </library>
    4.13 +            </web-module-libraries>
    4.14              <web-module-additional-libraries/>
    4.15              <source-roots>
    4.16 -                <root id="src.dir" name="Source Packages"/>
    4.17 +                <root id="src.dir"/>
    4.18              </source-roots>
    4.19              <test-roots>
    4.20 -                <root id="test.src.dir" name="Test Packages"/>
    4.21 +                <root id="test.src.dir"/>
    4.22              </test-roots>
    4.23          </data>
    4.24      </configuration>
     5.1 --- a/java/UpozorneniEmailem/web/WEB-INF/web.xml	Sat Mar 07 14:12:27 2009 +0100
     5.2 +++ b/java/UpozorneniEmailem/web/WEB-INF/web.xml	Sat Mar 07 15:36:13 2009 +0100
     5.3 @@ -7,5 +7,32 @@
     5.4      </session-config>
     5.5      <welcome-file-list>
     5.6          <welcome-file>index.jsp</welcome-file>
     5.7 -        </welcome-file-list>
     5.8 -    </web-app>
     5.9 +    </welcome-file-list>
    5.10 +
    5.11 +    <!-- Kaptcha -->
    5.12 +    <servlet>
    5.13 +        <servlet-name>Kaptcha</servlet-name>
    5.14 +        <servlet-class>com.google.code.kaptcha.servlet.KaptchaServlet</servlet-class>
    5.15 +        <init-param>
    5.16 +            <param-name>kaptcha.border</param-name>
    5.17 +            <param-value>no</param-value>
    5.18 +        </init-param>
    5.19 +        <init-param>
    5.20 +            <param-name>kaptcha.textproducer.font.color</param-name>
    5.21 +            <param-value>orange</param-value>
    5.22 +        </init-param>
    5.23 +        <init-param>
    5.24 +            <param-name>kaptcha.image.height</param-name>
    5.25 +            <param-value>50</param-value>
    5.26 +        </init-param>
    5.27 +        <init-param>
    5.28 +            <param-name>kaptcha.image.width</param-name>
    5.29 +            <param-value>300</param-value>
    5.30 +        </init-param>
    5.31 +    </servlet>
    5.32 +    <servlet-mapping>
    5.33 +        <servlet-name>Kaptcha</servlet-name>
    5.34 +        <url-pattern>/protiZlymRobotum.jpg</url-pattern>
    5.35 +    </servlet-mapping>
    5.36 +    <!-- Kaptcha - konec -->
    5.37 +</web-app>
     6.1 --- a/java/UpozorneniEmailem/web/css/styl.css	Sat Mar 07 14:12:27 2009 +0100
     6.2 +++ b/java/UpozorneniEmailem/web/css/styl.css	Sat Mar 07 15:36:13 2009 +0100
     6.3 @@ -32,6 +32,10 @@
     6.4      border: none;
     6.5  }
     6.6  
     6.7 +#logo {
     6.8 +    margin-right: 1em;
     6.9 +}
    6.10 +
    6.11  #licence {
    6.12      border: 1px solid silver;
    6.13      font-size: smaller;
    6.14 @@ -44,7 +48,7 @@
    6.15  
    6.16  form {
    6.17  	text-align: right;
    6.18 -	max-width: 22em;
    6.19 +	max-width: 32em;
    6.20  }
    6.21  
    6.22  fieldset {
    6.23 @@ -54,14 +58,24 @@
    6.24  input	{
    6.25  	margin: 2px;
    6.26  	padding: 2px;
    6.27 -	width: 200px;
    6.28 +	width: 300px;
    6.29 +    border: 1px solid silver;
    6.30  }
    6.31  
    6.32 -select	{
    6.33 +#protiZlymRobotum {
    6.34 +    margin: 2px;
    6.35 +	padding: 2px;
    6.36 +    border: 1px solid silver;
    6.37 +}
    6.38 +
    6.39 +textarea{
    6.40  	margin: 2px;
    6.41  	padding: 2px;
    6.42 -	width: 208px;
    6.43 +    width: 300px;
    6.44 +    height: 100px;
    6.45 +    border: 1px solid silver;
    6.46  }
    6.47 +
    6.48  button	{
    6.49  	margin: 2px;
    6.50  	margin-top: 2px;
     7.1 --- a/java/UpozorneniEmailem/web/index.jsp	Sat Mar 07 14:12:27 2009 +0100
     7.2 +++ b/java/UpozorneniEmailem/web/index.jsp	Sat Mar 07 15:36:13 2009 +0100
     7.3 @@ -14,7 +14,7 @@
     7.4          <script type="text/javascript" src="js/ui.datepicker-cs.js"></script>
     7.5      </head>
     7.6      <body>
     7.7 -        <h1>Upozornění e-mailem</h1>
     7.8 +        <h1><img src="logo.png" alt="logo" id="logo"/>Upozornění e-mailem</h1>
     7.9  
    7.10  
    7.11          <script type="text/javascript">
    7.12 @@ -40,9 +40,18 @@
    7.13                  <p>
    7.14                      <form action="?akce=zaloz" method="post">
    7.15                          <fieldset>
    7.16 -                            <label title="Kdy bude odesláno upozornění.">Datum: <input id="datepicker" type="text" name="datum"></label><br/>
    7.17 -                            <label title="Předmět upozorňovacího e-mailu.">Předmět: <input type="text" name="Předmět"></label><br/>
    7.18 -                            <button title="Vytvoží upozornění a pošle vám potvrzovací e-mail.">Přidat!</button>
    7.19 +                            <label title="Kam bude odesláno upozornění.">E-mail: <input type="text" name="email"/></label><br/>
    7.20 +                            <label title="Kdy bude odesláno upozornění.">Datum: <input id="datepicker" type="text" name="datum"/></label><br/>
    7.21 +                            <label title="Předmět upozorňovacího e-mailu.">Předmět: <input type="text" name="predmet"/></label><br/>
    7.22 +                            <label title="Text upozorňovacího e-mailu.">Text: <textarea type="text" name="text"></textarea></label><br/>
    7.23 +                            <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/>
    7.24 +                            <script type="text/javascript">
    7.25 +                                $(function(){
    7.26 +                                    $('#protiZlymRobotum').click(function () { $(this).attr('src', 'protiZlymRobotum.jpg?' + Math.floor(Math.random()*100) ); })
    7.27 +                                });
    7.28 +                            </script>
    7.29 +                            <label title="Opište kód z obrázku.">Kontrolní kód: <input type="text" name="protiZlymRobotum"/></label><br/>
    7.30 +                            <button title="Vytvoží upozornění a pošle vám potvrzovací e-mail.">Přidat upozornění!</button>
    7.31                          </fieldset>
    7.32                      </form>
    7.33                  </p>
    7.34 @@ -56,7 +65,6 @@
    7.35              <div id="tabs-3">
    7.36                  <p>
    7.37  
    7.38 -
    7.39                  </p>
    7.40              </div>
    7.41          </div>