1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-17 23:05:08 -05:00
kaiwa/public/js/login.js
2014-02-18 20:44:15 -08:00

29 lines
617 B
JavaScript

$('#loginbox form').on('submit', function (e) {
var jid = $('#jid').val();
var password = $('#password').val();
var connURL = $('#connURL').val();
var wsURL = '';
var boshURL = '';
if (connURL.indexOf('http') == 0) {
boshURL = connURL;
} else {
wsURL = wsURL;
}
localStorage.config = JSON.stringify({
jid: jid,
server: jid.slice(jid.indexOf('@') + 1),
wsURL: wsURL,
boshURL: boshURL,
credentials: {
password: password
}
});
window.location = '/';
e.preventDefault();
return false;
});