Enable BOSH!

This commit is contained in:
Lance Stout 2014-02-18 20:44:15 -08:00
parent ac6e6a28cd
commit 7c9b30831d
3 changed files with 55 additions and 43 deletions

View File

@ -1,41 +1,44 @@
{ {
"name": "otalk.im", "name": "otalk.im",
"version": "0.0.25", "description": "Otalk: WebRTC Enabled XMPP Client, in the Browser",
"description": "Otalk: WebRTC Enabled XMPP Client, in the Browser", "version": "0.0.30",
"repository": { "dependencies": {
"type": "git", "andlog": "0.0.4",
"url": "git@github.com:andyet/otalk.git" "async": "0.2.9",
}, "attachmediastream": "1.0.1",
"dependencies": { "backbone": "1.0.0",
"async": "0.2.9", "bluebird": "1.0.0",
"andlog": "0.0.4", "bows": "0.3.0",
"attachmediastream": "1.0.1", "browserify": "2.25.1",
"backbone": "1.0.0", "crypto-browserify": "1.0.3",
"bows": "0.3.0", "express": "3.3.7",
"browserify": "2.25.1", "getconfig": "0.0.5",
"crypto-browserify": "1.0.3", "getusermedia": "0.2.1",
"express": "3.3.7", "helmet": "0.1.0",
"getconfig": "0.0.5", "human-model": "2.6.0",
"getusermedia": "0.2.1", "human-view": "1.5.0",
"helmet": "0.1.0", "jade": "0.35.0",
"human-model": "2.6.0", "jxt": "0.6.0",
"human-view": "1.5.0", "moonboots": "1.0.0",
"jade": "0.35.0", "node-uuid": "1.4.1",
"jxt": "0.5.1", "notify.js": "0.0.3",
"moonboots": "1.0.0", "oembed": "0.1.0",
"node-uuid": "1.4.1", "semi-static": "0.0.4",
"notify.js": "0.0.3", "sound-effect-manager": "0.0.5",
"oembed": "0.1.0", "stanza.io": "3.2.2",
"semi-static": "0.0.4", "staydown": "1.0.3",
"sound-effect-manager": "0.0.5", "templatizer": "0.1.2",
"stanza.io": "3.1.1", "underscore": "1.5.1",
"staydown": "1.0.3", "wildemitter": "1.0.1"
"templatizer": "0.1.2", },
"underscore": "1.5.1", "devDependencies": {
"wildemitter": "0.0.5" "precommit-hook": "0.3.6"
}, },
"devDependencies": { "license": "MIT",
"precommit-hook": "0.3.6" "main": "server.js",
}, "private": true,
"main": "server.js" "repository": {
"type": "git",
"url": "git@github.com:andyet/otalk.git"
}
} }

View File

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

View File

@ -35,8 +35,8 @@ block content
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 .fieldContainer
label(for='wsURL') WebSocket URL label(for='wsURL') WebSocket or BOSH URL
input(type='text', id='wsURL', name='wsURL', placeholder='wss://aweso.me:5281/xmpp-websocket', tabindex='3') 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!