Use form for login to enable enter
This commit is contained in:
parent
81751369a1
commit
e7f7627c64
3 changed files with 10 additions and 8 deletions
|
@ -28,7 +28,7 @@ input, button, textarea {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
button {
|
button, input[type=submit], input[type=button] {
|
||||||
padding: 0 0.5em;
|
padding: 0 0.5em;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 90%;
|
font-size: 90%;
|
||||||
|
@ -188,7 +188,7 @@ ul#server_selection_list {
|
||||||
#login:target {
|
#login:target {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
#login input {
|
#login input[type=text], #login input[type=password] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
#login_server {
|
#login_server {
|
||||||
|
|
10
index.html
10
index.html
|
@ -22,10 +22,10 @@
|
||||||
|
|
||||||
<div id="server_selection">
|
<div id="server_selection">
|
||||||
<ul id="server_selection_list"></ul>
|
<ul id="server_selection_list"></ul>
|
||||||
<a href="#login"><button id="server_selection_add">Add a server</button></a>
|
<button id="server_selection_add">Add a server</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="login">
|
<form id="login" action="#">
|
||||||
<h2>Add a server</h2>
|
<h2>Add a server</h2>
|
||||||
<div class="login-form">
|
<div class="login-form">
|
||||||
<input type="text" id="login_server" placeholder="Server URL" value="http://localhost:8080" required/>
|
<input type="text" id="login_server" placeholder="Server URL" value="http://localhost:8080" required/>
|
||||||
|
@ -34,10 +34,10 @@
|
||||||
<input type="password" id="login_password" placeholder="Password" required/>
|
<input type="password" id="login_password" placeholder="Password" required/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button id="login_button">Log in</button>
|
<input type="submit" id="login_button" value="Log in"/>
|
||||||
<a href="#"><button id="server_selection_add">Cancel</button></a>
|
<input type="button" id="login_no_button" value="Cancel"/>
|
||||||
<div id="login_message"></div>
|
<div id="login_message"></div>
|
||||||
</div>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul id="channel_list"></ul>
|
<ul id="channel_list"></ul>
|
||||||
|
|
4
main.js
4
main.js
|
@ -1,6 +1,8 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
byId("login_button").addEventListener("click", logIn);
|
byId("server_selection_add").addEventListener("click", e => { e.stopPropagation(); e.preventDefault(); window.location = "#login"; return false; });
|
||||||
|
byId("login").addEventListener("submit", e => { logIn(); e.stopPropagation(); e.preventDefault(); return false; });
|
||||||
|
byId("login_no_button").addEventListener("click", e => { e.stopPropagation(); e.preventDefault(); window.location = "#"; return false; });
|
||||||
|
|
||||||
updateComposeHeight();
|
updateComposeHeight();
|
||||||
checkScrolledToBottom();
|
checkScrolledToBottom();
|
||||||
|
|
Loading…
Reference in a new issue