Login form with/without wss input

This commit is contained in:
Sebastien Hut 2014-11-21 20:11:23 +01:00
parent e38fdf8b9e
commit d4dffab8df
4 changed files with 17 additions and 3 deletions

View File

@ -1559,6 +1559,9 @@ button.secondary:hover:not(:disabled) {
#loginbox {
margin-bottom: 120px;
}
.fieldContainerWSS {
display: none;
}
@media screen and (min-width: 768px) {
.box {
width: 50%;

View File

@ -1,6 +1,6 @@
.aux
background: lighten($gray-light, 93%)
header
margin-top: 8%
text-align: center
@ -49,6 +49,9 @@
#loginbox
margin-bottom: 120px
.fieldContainerWSS
display: none
@media screen and (min-width: 768px)
.box

View File

@ -1,7 +1,9 @@
$('#loginbox form').on('submit', function (e) {
var jid = $('#jid').val() + "@" + SERVER_CONFIG.domain;
var jid = $('#jid').val();
if (SERVER_CONFIG.domain && jid.indexOf('@') == -1)
jid += "@" + SERVER_CONFIG.domain;
var password = $('#password').val();
var connURL = SERVER_CONFIG.wss;
var connURL = SERVER_CONFIG.wss ? SERVER_CONFIG.wss : $('#connURL').val();
var transport;
var wsURL = '';

View File

@ -15,9 +15,15 @@ block content
.fieldContainer
label(for='password') Password
input(type='password', id='password', name='password', placeholder='•••••••••••••', tabindex='2')
.fieldContainer.fieldContainerWSS
label(for='wsURL') WebSocket or BOSH URL
input(type='text', id='connURL', name='connURL', placeholder='wss://aweso.me:5281/xmpp-websocket', tabindex='3')
button(type='submit', tabindex='3', class="primary") Go!
block scripts
script(src="/config.js")
script(src="/js/login.js")
script.
if ("#{config.wss}".length == 0)
$('.fieldContainerWSS').show();