| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Alfresco
Revision: 2846
Author: kevinr
Date: 02 Sep 2008 07:32:40
Changes:Fix for SLNG-1112 - double click/Enter press on login page. I18N for unauthorised message on failed login.
Files:| ... | ...@@ -23,7 +23,10 @@ | |
| 23 | 23 | |
| 24 | 24 | # Messages |
| 25 | 25 | message.failure=Failure |
| 26 | message.loginfailure=Failed to Login | |
| 27 | message.loginautherror=The remote server may be unavailable or your authentication details have not been recognised. | |
| 26 | 28 | |
| 27 | 29 | # Text labels |
| 28 | 30 | label.username=User name |
| 29 | label.password=Password | |
| 30 | 31 | \ No newline at end of file |
| 32 | label.password=Password | |
| 33 | label.tags=Tags | |
| 31 | 34 | \ No newline at end of file |
| ... | ...@@ -15,7 +15,7 @@ | |
| 15 | 15 | <@template.body> |
| 16 | 16 | <div id="alflogin" class="login-panel"> |
| 17 | 17 | <div class="login-logo"></div> |
| 18 | <form accept-charset="UTF-8" method="post" action="${url.context}/login"> | |
| 18 | <form id="loginform" accept-charset="UTF-8" method="post" action="${url.context}/login"> | |
| 19 | 19 | <fieldset> |
| 20 | 20 | <div style="padding-top:96px"> |
| 21 | 21 | <span id="txt-username"></span> |
| ... | ...@@ -30,7 +30,7 @@ | |
| 30 | 30 | <input type="password" id="password" name="password" maxlength="256" style="width:200px"/> |
| 31 | 31 | </div> |
| 32 | 32 | <div style="padding-top:16px"> |
| 33 | <input type="submit" value="Login" id="btn-login" class="login-button" /> | |
| 33 | <input type="submit" id="btn-login" class="login-button" onclick="javascript:alfLogin()" /> | |
| 34 | 34 | </div> |
| 35 | 35 | <div style="padding-top:32px"> |
| 36 | 36 | <span class="login-copyright"> |
| ... | ...@@ -44,10 +44,38 @@ | |
| 44 | 44 | </div> |
| 45 | 45 | |
| 46 | 46 | <script type="text/javascript">//<![CDATA[ |
| 47 | function alfLogin() | |
| 48 | { | |
| 49 | Dom.get("btn-login").disabled = true; | |
| 50 | return true; | |
| 51 | } | |
| 52 | ||
| 47 | 53 | YAHOO.util.Event.onContentReady("alflogin", function() |
| 48 | 54 | { |
| 49 | 55 | var Dom = YAHOO.util.Dom; |
| 50 | 56 | |
| 57 | // Prevent the Enter key from causing a double form submission | |
| 58 | var form = Dom.get("loginform"); | |
| 59 | // add the event to the form and make the scope of the handler this form. | |
| 60 | YAHOO.util.Event.addListener(form, "submit", this._submitInvoked, this, true); | |
| 61 | var fnStopEvent = function(id, keyEvent) | |
| 62 | { | |
| 63 | if (form.getAttribute("alflogin") == null) | |
| 64 | { | |
| 65 | form.setAttribute("alflogin", true); | |
| 66 | } | |
| 67 | else | |
| 68 | { | |
| 69 | form.attributes.action.nodeValue = ""; | |
| 70 | } | |
| 71 | } | |
| 72 | ||
| 73 | var enterListener = new YAHOO.util.KeyListener(form, | |
| 74 | { | |
| 75 | keys: YAHOO.util.KeyListener.KEY.ENTER | |
| 76 | }, fnStopEvent, "keydown"); | |
| 77 | enterListener.enable(); | |
| 78 | ||
| 51 | 79 | // set I18N labels |
| 52 | 80 | Dom.get("txt-username").innerHTML = Alfresco.util.message("label.username") + ":"; |
| 53 | 81 | Dom.get("txt-password").innerHTML = Alfresco.util.message("label.password") + ":"; |
| ... | ...@@ -72,8 +100,8 @@ | |
| 72 | 100 | <#if url.args["error"]??> |
| 73 | 101 | Alfresco.util.PopupManager.displayPrompt( |
| 74 | 102 | { |
| 75 | title: "Failed to Login", | |
| 76 | text: "The remote server may be unavailable or your authentication details have not been recognised." | |
| 103 | title: Alfresco.util.message("message.loginfailure"), | |
| 104 | text: Alfresco.util.message("message.loginautherror") | |
| 77 | 105 | }); |
| 78 | 106 | </#if> |
| 79 | 107 | //]]></script> |