Author: dongxu Date: Thu Sep 12 02:02:42 2013 New Revision: 1522107 URL: http://svn.apache.org/r1522107 Log: constantly changed by manolo
Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/LoginView.java james/hupa/trunk/client/src/main/webapp/Hupa.css james/hupa/trunk/client/src/main/webapp/Hupa.html Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java?rev=1522107&r1=1522106&r2=1522107&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaCSS.java Thu Sep 12 02:02:42 2013 @@ -77,4 +77,6 @@ public class HupaCSS extends WidgetsCSS public static final String C_dialog = "hupa-dialog-box"; public static final String C_validate = "hupa-validate-error"; + + public static final String C_button = "hupa-button"; } Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java?rev=1522107&r1=1522106&r2=1522107&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java Thu Sep 12 02:02:42 2013 @@ -474,7 +474,7 @@ public class IMAPMessageListView extends pageBox.setSelectedIndex(0); cTableModel.clearCache(); cTableModel.setRowCount(CachedTableModel.UNKNOWN_ROW_COUNT); -// mailTable.gotoFirstPage(); + mailTable.gotoPage(0, false); } /* 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=1522107&r1=1522106&r2=1522107&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 Thu Sep 12 02:02:42 2013 @@ -23,18 +23,23 @@ import org.apache.hupa.client.HupaCSS; import org.apache.hupa.client.HupaConstants; import org.apache.hupa.widgets.ui.Loading; import org.apache.hupa.widgets.ui.RndPanel; -import org.cobogw.gwt.user.client.ui.Button; -import org.cobogw.gwt.user.client.ui.ButtonBar; import com.google.gwt.event.dom.client.HasClickHandlers; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; +import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.FlexTable; +import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.Focusable; +import com.google.gwt.user.client.ui.FormPanel; +import com.google.gwt.user.client.ui.FormPanel.SubmitEvent; import com.google.gwt.user.client.ui.HasValue; +import com.google.gwt.user.client.ui.Panel; import com.google.gwt.user.client.ui.PasswordTextBox; +import com.google.gwt.user.client.ui.SubmitButton; import com.google.gwt.user.client.ui.TextBox; import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Widget; @@ -46,38 +51,52 @@ import com.google.inject.Inject; */ public class LoginView extends Composite implements KeyUpHandler,LoginPresenter.Display{ - private Button loginButton; + private Button loginButton = new Button(); + private SubmitButton submitButton; private Button resetButton; - private TextBox usernameTextBox = new TextBox(); - private PasswordTextBox passwordTextBox = new PasswordTextBox(); private Loading loading; + + // We wrap login/password boxes with a form which must be in the html document, + // in this way, the browser knows that we are sending a login form and + // offers the save password dialog to the user + private TextBox usernameTextBox = TextBox.wrap(DOM.getElementById("email")); + private PasswordTextBox passwordTextBox = PasswordTextBox.wrap(DOM.getElementById("password")); + // wrap the form after inputs so as they are in the dom when are wrapped + final private FormPanel formPanel = FormPanel.wrap(DOM.getElementById("loginForm"), true); + @Inject public LoginView(HupaConstants constants) { VerticalPanel mainContainer = new VerticalPanel(); RndPanel rPanel = new RndPanel(); - FlexTable formPanel = new FlexTable(); - ButtonBar buttonBar = new ButtonBar(); - loginButton = new Button(constants.loginButton()); - resetButton = new Button(constants.resetButton()); + FlexTable flexTable = new FlexTable(); + Panel buttonBar = new FlowPanel(); + submitButton = new SubmitButton(constants.loginButton()); + resetButton = new Button(constants.resetButton()); + submitButton.getElement().setClassName(HupaCSS.C_button); + resetButton.getElement().setClassName(HupaCSS.C_button); + submitButton.getElement().setClassName(resetButton.getElement().getClassName()); loading = new Loading(constants.loading()); mainContainer.setStyleName(HupaCSS.C_login_container); - formPanel.addStyleName(HupaCSS.C_login_form); + 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(loginButton); + buttonBar.add(submitButton); buttonBar.add(resetButton); - formPanel.setText(0, 0, constants.usernameLabel()); - formPanel.setWidget(0, 1, usernameTextBox); - formPanel.setText(1, 0, constants.passwordLabel()); - formPanel.setWidget(1, 1, passwordTextBox); - formPanel.getFlexCellFormatter().setColSpan(2, 0, 2); - formPanel.setWidget(2, 0, buttonBar); + flexTable.setText(0, 0, constants.usernameLabel()); + flexTable.setWidget(0, 1, usernameTextBox); + flexTable.setText(1, 0, constants.passwordLabel()); + flexTable.setWidget(1, 1, passwordTextBox); + flexTable.getFlexCellFormatter().setColSpan(2, 0, 2); + flexTable.setWidget(2, 0, buttonBar); rPanel.add(formPanel); + formPanel.add(flexTable); mainContainer.add(rPanel); mainContainer.add(loading); initWidget(mainContainer); @@ -87,6 +106,19 @@ public class LoginView extends Composite passwordTextBox.addKeyUpHandler(this); loading.hide(); + + // The user submits the form so as the browser detect it and displays + // the save password dialog. Then we click on the hidden loginButton which + // stores the presenter clickHandler. + formPanel.addSubmitHandler(new FormPanel.SubmitHandler() { + public void onSubmit(SubmitEvent event) { + event.cancel(); + loginButton.click(); + } + }); + // loginButton must be in the document to handle the click() method + mainContainer.add(loginButton); + loginButton.setVisible(false); } /* @@ -101,7 +133,7 @@ public class LoginView extends Composite if (event.getSource().equals(usernameTextBox)) { passwordTextBox.setFocus(true); } else if (event.getSource().equals(passwordTextBox)) { - loginButton.click(); + submitButton.click(); } } } Modified: james/hupa/trunk/client/src/main/webapp/Hupa.css URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/webapp/Hupa.css?rev=1522107&r1=1522106&r2=1522107&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/webapp/Hupa.css (original) +++ james/hupa/trunk/client/src/main/webapp/Hupa.css Thu Sep 12 02:02:42 2013 @@ -737,7 +737,6 @@ div.hupa-main { } /**** HTML5 shadows and gradients ****/ - body { background: #eaeaea; } @@ -780,4 +779,41 @@ div.hupa-main { * html .hupa-bottom { filter: progid:DXImageTransform.Microsoft.Shadow(color='#666666', Direction=135, Strength=1); } +<<<<<<< HEAD >>>>>>> first commit +======= + +.hupa-button { + background: #FFFFFF; + background: -moz-linear-gradient(#FFFFFF, #EDEDED); + background: -webkit-linear-gradient(#FFFFFF, #EDEDED); + background: -o-linear-gradient(#FFFFFF, #EDEDED); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#EDEDED',GradientType=0 ); + border: 1px solid #B7B7B7; + color: #606060; + border-radius: 2em 2em 2em 2em; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); + cursor: pointer; + display: inline-block; + font: 10px; + margin: 0 2px; + outline: medium none; + padding: 2px 10px; + text-align: center; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3); + vertical-align: baseline; +} +.hupa-button:hover { + background: #ededed; + background: -moz-linear-gradient(#FFFFFF, #dcdcdc); + background: -webkit-linear-gradient(#FFFFFF, #dcdcdc); + background: -o-linear-gradient(#FFFFFF, #dcdcdc); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#dcdcdc',GradientType=0 ); +} + + + + + + +>>>>>>> constantly changed by manolo 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=1522107&r1=1522106&r2=1522107&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/webapp/Hupa.html (original) +++ james/hupa/trunk/client/src/main/webapp/Hupa.html Thu Sep 12 02:02:42 2013 @@ -52,7 +52,13 @@ top: 50%; left: 50%; } +<<<<<<< HEAD >>>>>>> first commit +======= + #login { + display: none; + } +>>>>>>> constantly changed by manolo </style> </head> @@ -80,6 +86,14 @@ >>>>>>> first commit </div> + <!-- 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"> + <input id="email" name="email" type="text"> + <input id="password" name="password" type="password"> + </form> + </div> + <!-- Necessary for history support --> <iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe> --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org