Merge pull request #2259 from Bhanu-mbvg/master
Wikidata login: form submittion by pressing Enter key
This commit is contained in:
commit
4edbd40b6a
@ -25,11 +25,11 @@
|
||||
<td><label for="remember-credentials" bind="rememberCredentialsLabel"></label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div class="wikibase-login-buttons">
|
||||
<div class="wikibase-login-buttons">
|
||||
<button class="button cancel-button" bind="cancelButton1"></button>
|
||||
<button class="button button-primary" bind="loginButton"></button>
|
||||
</div>
|
||||
<button class="button button-primary" type="submit" bind="loginButton"></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="wikibase-user-logout" bind="logoutArea">
|
||||
<p><span bind="loggedInAs"></span>
|
||||
|
@ -54,21 +54,24 @@ ManageAccountDialog.display = function(logged_in_username, saved_credentials, ca
|
||||
callback(null);
|
||||
});
|
||||
|
||||
elmts.loginButton.click(function() {
|
||||
frame.hide();
|
||||
Refine.postCSRF(
|
||||
"command/wikidata/login",
|
||||
elmts.loginForm.serialize(),
|
||||
function(data) {
|
||||
if (data.logged_in) {
|
||||
dismiss();
|
||||
callback(data.username);
|
||||
} else {
|
||||
frame.show();
|
||||
elmts.invalidCredentials.text("Invalid credentials.");
|
||||
}
|
||||
});
|
||||
});
|
||||
elmts.loginForm.submit(function(e) {
|
||||
frame.hide();
|
||||
Refine.postCSRF(
|
||||
"command/wikidata/login",
|
||||
elmts.loginForm.serialize(),
|
||||
function(data) {
|
||||
if (data.logged_in) {
|
||||
dismiss();
|
||||
callback(data.username);
|
||||
}
|
||||
else {
|
||||
frame.show();
|
||||
elmts.invalidCredentials.text("Invalid credentials.");
|
||||
}
|
||||
});
|
||||
e.preventDefault();
|
||||
}
|
||||
);
|
||||
|
||||
elmts.logoutButton.click(function() {
|
||||
Refine.postCSRF(
|
||||
|
Loading…
Reference in New Issue
Block a user