1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-28 04:02:27 -05:00

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 { #loginbox {
margin-bottom: 120px; margin-bottom: 120px;
} }
.fieldContainerWSS {
display: none;
}
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
.box { .box {
width: 50%; width: 50%;

View File

@ -49,6 +49,9 @@
#loginbox #loginbox
margin-bottom: 120px margin-bottom: 120px
.fieldContainerWSS
display: none
@media screen and (min-width: 768px) @media screen and (min-width: 768px)
.box .box

View File

@ -1,7 +1,9 @@
$('#loginbox form').on('submit', function (e) { $('#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 password = $('#password').val();
var connURL = SERVER_CONFIG.wss; var connURL = SERVER_CONFIG.wss ? SERVER_CONFIG.wss : $('#connURL').val();
var transport; var transport;
var wsURL = ''; var wsURL = '';

View File

@ -15,9 +15,15 @@ block content
.fieldContainer .fieldContainer
label(for='password') Password label(for='password') Password
input(type='password', id='password', name='password', placeholder='•••••••••••••', tabindex='2') 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! button(type='submit', tabindex='3', class="primary") Go!
block scripts block scripts
script(src="/config.js") script(src="/config.js")
script(src="/js/login.js") script(src="/js/login.js")
script.
if ("#{config.wss}".length == 0)
$('.fieldContainerWSS').show();