# HG changeset patch # User souliane # Date 1449583862 -3600 # Node ID a6b39838353f79ceede223ad4b2d3095b9568309 # Parent 6a2fd7807770c4378b1024c555f70fe862fa9873 browser_side: inform the user that entering a full JID in the login box is only needed for external XMPP account diff -r 6a2fd7807770 -r a6b39838353f src/browser/public/libervia.css --- a/src/browser/public/libervia.css Mon Dec 07 21:21:44 2015 +0100 +++ b/src/browser/public/libervia.css Tue Dec 08 15:11:02 2015 +0100 @@ -410,11 +410,15 @@ .formWarning { /* used when a form is not valid and must be corrected before submission */ font-weight: bold; - color: red !important; - height: 30px; + color: lightcoral !important; + height: 45px; text-align: center; } +.formInfo { /* used when a form is being edited and we want to tell something to the user */ + color: lightcyan !important; +} + .contactsChooser { text-align: center; margin:auto; diff -r 6a2fd7807770 -r a6b39838353f src/browser/sat_browser/register.py --- a/src/browser/sat_browser/register.py Mon Dec 07 21:21:44 2015 +0100 +++ b/src/browser/sat_browser/register.py Tue Dec 08 15:11:02 2015 +0100 @@ -45,6 +45,9 @@ from constants import Const as C +KEY_AROBASE = 81 # XXX: this is the keycode for onKeyUp, the one which works for onKeyPress is 64! + + class RegisterPanel(FormPanel): def __init__(self, callback): @@ -148,6 +151,7 @@ self.register_login_box.setFocus(True) def onKeyPress(self, sender, keycode, modifiers): + # XXX: this is triggered before the textbox value has changed if keycode == KEY_ENTER: # Browsers offer an auto-completion feature to any # text box, but the selected value is not set when @@ -165,7 +169,12 @@ self.onRegister(None) def onKeyUp(self, sender, keycode, modifiers): - pass + # XXX: this is triggered after the textbox value has changed + if sender == self.login_box: + if keycode == KEY_AROBASE: + self.login_warning_msg.setHTML(_('Entering a full JID is only needed to connect with an external XMPP account.')) + elif "@" not in self.login_box.getText(): + self.login_warning_msg.setHTML("") def onKeyDown(self, sender, keycode, modifiers): pass