implement existing account signin popup, hide popups after actions end
This commit is contained in:
Родитель
594ab57b4a
Коммит
a0e7e90479
|
@ -231,12 +231,22 @@ let gWeaveAuthenticator = {
|
|||
},
|
||||
|
||||
onConnect: function() {
|
||||
this._log.debug("Attempting to connect");
|
||||
this._log.debug("Attempting to sign in");
|
||||
this._curRealm.execute('connect');
|
||||
gBrowser.mCurrentBrowser.reload();
|
||||
this._popup.hidePopup();
|
||||
},
|
||||
|
||||
onExistingConnect: function() {
|
||||
this._log.debug("Saving existing account credentials");
|
||||
let id = document.getElementById("acct-existing-username");
|
||||
let pass = document.getElementById("acct-existing-password");
|
||||
WeaveID.Utils.persistLogin(id.value, pass.value,
|
||||
this._curRealm.domain, this._curRealm.realmUrl);
|
||||
this.onConnect();
|
||||
this._signinPopup.hidePopup();
|
||||
},
|
||||
|
||||
onDisconnect: function() {
|
||||
this._log.debug("Attempting to disconnect");
|
||||
this._curRealm.execute('disconnect');
|
||||
|
@ -254,7 +264,7 @@ let gWeaveAuthenticator = {
|
|||
this._log.debug("username is " + this._curRealm.username);
|
||||
this._curRealm.execute('register');
|
||||
gBrowser.mCurrentBrowser.reload();
|
||||
this._popup.hidePopup();
|
||||
this._registerPopup.hidePopup();
|
||||
},
|
||||
|
||||
onExistingAccount: function() {
|
||||
|
|
|
@ -34,13 +34,8 @@
|
|||
<vbox id="acct-auth-popup-signed-out">
|
||||
<description id="acct-auth-signed-out-desc">&acct-auth-connect-label1;</description>
|
||||
<description>&acct-auth-connect-label2;</description>
|
||||
<!-- <hbox>
|
||||
<menulist id="acct-signin-accts">
|
||||
<menupopup></menupopup>
|
||||
</menulist> -->
|
||||
<button label="Sign in" oncommand="gWeaveAuthenticator.onConnect();"/>
|
||||
<!-- </hbox> -->
|
||||
<button label="New account" oncommand="gWeaveAuthenticator.onRegister();"/>
|
||||
<button label="Sign in" oncommand="gWeaveAuthenticator.onConnect();"/>
|
||||
<!-- <button label="Register a new account" oncommand="gWeaveAuthenticator.onRegister();"/> -->
|
||||
</vbox>
|
||||
<vbox id="acct-auth-popup-unregistered">
|
||||
<description>Firefox doesn't have an account for you on this site.</description>
|
||||
|
@ -56,11 +51,17 @@
|
|||
<textbox id="acct-email" value="user@example.com"/>
|
||||
<label control="acct-username" value="Enter your preferred username:"/>
|
||||
<textbox id="acct-username" value="username"/>
|
||||
<description>Note: In this demo, your password will be automatically</description>
|
||||
<description>generated, future versions will offer it as an option</description>
|
||||
</vbox>
|
||||
<button label="Okay" oncommand="gWeaveAuthenticator.onRegisterOk();"/>
|
||||
</panel>
|
||||
<panel id="acct-signin-popup">
|
||||
signin popup
|
||||
<label control="acct-existing-username" value="Username or email:"/>
|
||||
<textbox id="acct-existing-username" value=""/>
|
||||
<label control="acct-existing-password" value="Password:"/>
|
||||
<textbox id="acct-existing-password" type="password" value=""/>
|
||||
<button label="Sign in" oncommand="gWeaveAuthenticator.onExistingConnect();"/>
|
||||
</panel>
|
||||
</popupset>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче