Author: manolo
Date: Wed May  9 21:11:38 2012
New Revision: 1336403

URL: http://svn.apache.org/viewvc?rev=1336403&view=rev
Log:
fix save password in chrome, it needs that submit is not cancelled

Modified:
    james/hupa/trunk/client/pom.xml
    
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginPresenter.java
    
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java
    james/hupa/trunk/client/src/main/webapp/Hupa.html

Modified: james/hupa/trunk/client/pom.xml
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/pom.xml?rev=1336403&r1=1336402&r2=1336403&view=diff
==============================================================================
--- james/hupa/trunk/client/pom.xml (original)
+++ james/hupa/trunk/client/pom.xml Wed May  9 21:11:38 2012
@@ -17,9 +17,7 @@
     specific language governing permissions and limitations
     under the License.
 -->
-<project
-    xmlns="http://maven.apache.org/POM/4.0.0";
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
     <modelVersion>4.0.0</modelVersion>
     <parent>
@@ -77,10 +75,10 @@
             <groupId>com.google.gwt</groupId>
             <artifactId>gwt-user</artifactId>
             <exclusions>
-              <exclusion>
-                <groupId>javax.validation</groupId>
-                <artifactId>validation-api</artifactId>
-              </exclusion>
+                <exclusion>
+                    <groupId>javax.validation</groupId>
+                    <artifactId>validation-api</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
         <dependency>
@@ -97,9 +95,9 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-          <groupId>org.hibernate</groupId>
-          <artifactId>hibernate-validator</artifactId>
-          <version>4.2.0.Final</version>
+            <groupId>org.hibernate</groupId>
+            <artifactId>hibernate-validator</artifactId>
+            <version>4.2.0.Final</version>
         </dependency>
         <dependency>
             <groupId>org.json</groupId>
@@ -117,14 +115,14 @@
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-log4j12</artifactId>
         </dependency>
-               <dependency>
-                   <groupId>org.eclipse.jetty</groupId>
-                   <artifactId>jetty-server</artifactId>
-               </dependency>
-               <dependency>
-                   <groupId>org.eclipse.jetty</groupId>
-                   <artifactId>jetty-webapp</artifactId>
-               </dependency>        
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-server</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.jetty</groupId>
+            <artifactId>jetty-webapp</artifactId>
+        </dependency>
     </dependencies>
     <build>
         
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
@@ -135,7 +133,7 @@
                 <configuration>
                     <runTarget>Hupa.html</runTarget>
                     <extraJvmArgs>
-                        -Xmx512M -Xss128M 
-Dhupa.config.file=${project.parent.basedir}/server/src/main/webapp/WEB-INF/conf/config.properties
+                        -Xmx512M -Xss128M
                     </extraJvmArgs>
                     <localWorkers>1</localWorkers>
                     <compileReport>true</compileReport>
@@ -187,11 +185,11 @@
                         </resource>
                     </webResources>
                     <warName>${project.artifactId}-${project.version}</warName>
-                               <archive>
-                                  <manifest>
-                                     
<mainClass>org.apache.hupa.Launcher</mainClass>
-                                  </manifest>
-                               </archive>
+                    <archive>
+                        <manifest>
+                            <mainClass>org.apache.hupa.Launcher</mainClass>
+                        </manifest>
+                    </archive>
                 </configuration>
             </plugin>
             <plugin>
@@ -246,7 +244,7 @@
                 </executions>
             </plugin>
             <plugin>
-               <groupId>org.apache.maven.plugins</groupId>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-resources-plugin</artifactId>
                 <executions>
                     <execution>
@@ -275,33 +273,33 @@
                             <resources>
                                 <resource>
                                     
<directory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</directory>
-                                     
<include>org/apache/hupa/Launcher.class</include>
+                                    
<include>org/apache/hupa/Launcher.class</include>
                                 </resource>
                             </resources>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
-                       <plugin>
-                          <groupId>org.apache.maven.plugins</groupId>
-                          <artifactId>maven-dependency-plugin</artifactId>
-                          <executions>
-                             <execution>
-                                <id>jetty-classpath</id>
-                                <phase>prepare-package</phase>
-                                <goals>
-                                   <goal>unpack-dependencies</goal>
-                                </goals>
-                                <configuration>
-                                   
<includeGroupIds>org.eclipse.jetty,javax.servlet</includeGroupIds>
-                                   
<excludeArtifactIds>jsp-api,jstl</excludeArtifactIds>
-                                   <outputDirectory>
-                                      
${project.build.directory}/${project.artifactId}-${project.version}
-                                   </outputDirectory>
-                                </configuration>
-                             </execution>
-                          </executions>
-                       </plugin>            
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>jetty-classpath</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>unpack-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            
<includeGroupIds>org.eclipse.jetty,javax.servlet</includeGroupIds>
+                            
<excludeArtifactIds>jsp-api,jstl</excludeArtifactIds>
+                            <outputDirectory>
+                                
${project.build.directory}/${project.artifactId}-${project.version}
+                        </outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 </project>

Modified: 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginPresenter.java
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginPresenter.java?rev=1336403&r1=1336402&r2=1336403&view=diff
==============================================================================
--- 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginPresenter.java
 (original)
+++ 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginPresenter.java
 Wed May  9 21:11:38 2012
@@ -49,8 +49,6 @@ import com.google.inject.Inject;
 public class LoginPresenter extends WidgetPresenter<LoginPresenter.Display>{
     
     private HupaConstants constants = GWT.create(HupaConstants.class);
-    private int minUsernameLength = 1;
-    private int minPasswordLength = 1;
 
     public interface Display extends WidgetDisplay{
         public HasClickHandlers getLoginClick();
@@ -73,10 +71,10 @@ public class LoginPresenter extends Widg
      * Try to login the user
      */
     private void doLogin() {
-        String user = display.getUserNameValue().getValue();
-        String pass = display.getPasswordValue().getValue();
+        String user = display.getUserNameValue().getValue().trim();
+        String pass = display.getPasswordValue().getValue().trim();
         
-        if (user.length() < minUsernameLength || pass.length() < 
minPasswordLength)
+        if (user.isEmpty() || pass.isEmpty())
             return;
         
         display.setLoading(true);

Modified: 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java?rev=1336403&r1=1336402&r2=1336403&view=diff
==============================================================================
--- 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java 
(original)
+++ 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java 
Wed May  9 21:11:38 2012
@@ -81,9 +81,7 @@ public class LoginView extends Composite
         mainContainer.setStyleName(HupaCSS.C_login_container);
         flexTable.addStyleName(HupaCSS.C_login_form);
         usernameTextBox.addStyleName(HupaCSS.C_login_box);
-        usernameTextBox.setName("user");
         passwordTextBox.addStyleName(HupaCSS.C_login_box);
-        usernameTextBox.setName("password");
         
         buttonBar.add(submitButton);
         buttonBar.add(resetButton);
@@ -112,8 +110,10 @@ public class LoginView extends Composite
         // stores the presenter clickHandler.
         formPanel.addSubmitHandler(new FormPanel.SubmitHandler() {
             public void onSubmit(SubmitEvent event) {
-                event.cancel();
-                loginButton.click();
+                if (!usernameTextBox.getValue().trim().isEmpty() && 
!passwordTextBox.getValue().trim().isEmpty()) {
+                    loginButton.click();
+                }
+//                event.cancel();
             }
         });
         // loginButton must be in the document to handle the click() method
@@ -133,7 +133,7 @@ public class LoginView extends Composite
             if (event.getSource().equals(usernameTextBox)) {
                 passwordTextBox.setFocus(true);
             }  else if (event.getSource().equals(passwordTextBox)) {
-                submitButton.click();
+                formPanel.submit();
             }
         }
     }

Modified: james/hupa/trunk/client/src/main/webapp/Hupa.html
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/webapp/Hupa.html?rev=1336403&r1=1336402&r2=1336403&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/webapp/Hupa.html (original)
+++ james/hupa/trunk/client/src/main/webapp/Hupa.html Wed May  9 21:11:38 2012
@@ -53,7 +53,7 @@
     
     <!-- We need this because passwords in forms rendered by js are not saved 
in browsers -->
     <div id="login">
-         <form id="loginForm" action="hupa/hupa.nocache.js" method="post">
+         <form id="loginForm" action="hupa/clear.cache.gif" method="post">
            <input id="email" name="email" type="text">
            <input id="password" name="password" type="password">
          </form>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to