From 7c9b30831d720c6b4c6e51f7d3725be3c9820f99 Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Tue, 18 Feb 2014 20:44:15 -0800 Subject: [PATCH] Enable BOSH! --- package.json | 81 ++++++++++++++++++++++++---------------------- public/js/login.js | 13 ++++++-- views/login.jade | 4 +-- 3 files changed, 55 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 0996902..5bcea53 100644 --- a/package.json +++ b/package.json @@ -1,41 +1,44 @@ { - "name": "otalk.im", - "version": "0.0.25", - "description": "Otalk: WebRTC Enabled XMPP Client, in the Browser", - "repository": { - "type": "git", - "url": "git@github.com:andyet/otalk.git" - }, - "dependencies": { - "async": "0.2.9", - "andlog": "0.0.4", - "attachmediastream": "1.0.1", - "backbone": "1.0.0", - "bows": "0.3.0", - "browserify": "2.25.1", - "crypto-browserify": "1.0.3", - "express": "3.3.7", - "getconfig": "0.0.5", - "getusermedia": "0.2.1", - "helmet": "0.1.0", - "human-model": "2.6.0", - "human-view": "1.5.0", - "jade": "0.35.0", - "jxt": "0.5.1", - "moonboots": "1.0.0", - "node-uuid": "1.4.1", - "notify.js": "0.0.3", - "oembed": "0.1.0", - "semi-static": "0.0.4", - "sound-effect-manager": "0.0.5", - "stanza.io": "3.1.1", - "staydown": "1.0.3", - "templatizer": "0.1.2", - "underscore": "1.5.1", - "wildemitter": "0.0.5" - }, - "devDependencies": { - "precommit-hook": "0.3.6" - }, - "main": "server.js" + "name": "otalk.im", + "description": "Otalk: WebRTC Enabled XMPP Client, in the Browser", + "version": "0.0.30", + "dependencies": { + "andlog": "0.0.4", + "async": "0.2.9", + "attachmediastream": "1.0.1", + "backbone": "1.0.0", + "bluebird": "1.0.0", + "bows": "0.3.0", + "browserify": "2.25.1", + "crypto-browserify": "1.0.3", + "express": "3.3.7", + "getconfig": "0.0.5", + "getusermedia": "0.2.1", + "helmet": "0.1.0", + "human-model": "2.6.0", + "human-view": "1.5.0", + "jade": "0.35.0", + "jxt": "0.6.0", + "moonboots": "1.0.0", + "node-uuid": "1.4.1", + "notify.js": "0.0.3", + "oembed": "0.1.0", + "semi-static": "0.0.4", + "sound-effect-manager": "0.0.5", + "stanza.io": "3.2.2", + "staydown": "1.0.3", + "templatizer": "0.1.2", + "underscore": "1.5.1", + "wildemitter": "1.0.1" + }, + "devDependencies": { + "precommit-hook": "0.3.6" + }, + "license": "MIT", + "main": "server.js", + "private": true, + "repository": { + "type": "git", + "url": "git@github.com:andyet/otalk.git" + } } diff --git a/public/js/login.js b/public/js/login.js index c3dff39..9a05a20 100644 --- a/public/js/login.js +++ b/public/js/login.js @@ -1,19 +1,28 @@ $('#loginbox form').on('submit', function (e) { var jid = $('#jid').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({ jid: jid, server: jid.slice(jid.indexOf('@') + 1), wsURL: wsURL, + boshURL: boshURL, credentials: { password: password } }); window.location = '/'; - + e.preventDefault(); return false; }); diff --git a/views/login.jade b/views/login.jade index f7ea423..cc32a72 100644 --- a/views/login.jade +++ b/views/login.jade @@ -35,8 +35,8 @@ block content label(for='password') Password input(type='password', id='password', name='password', placeholder='•••••••••••••', tabindex='2') .fieldContainer - label(for='wsURL') WebSocket URL - input(type='text', id='wsURL', name='wsURL', placeholder='wss://aweso.me:5281/xmpp-websocket', tabindex='3') + 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!