Permalink
Browse files

fix connection issues

  • Loading branch information...
mick committed Apr 4, 2012
1 parent 4d7c1a2 commit bf7a7025eeb27ae097c4aa72ae6dbb2a9956328e
Showing with 29 additions and 19 deletions.
  1. +4 −0 web/app.js
  2. +16 −18 web/static/client.js
  3. +8 −0 web/static/style.css
  4. +1 −1 web/views/index.ejs
View
@@ -25,6 +25,10 @@ var proxy = new httpProxy.HttpProxy({
});
app.post('/http-bind', function(req, res){
console.log("proxying request to ejabberd");
+
+// res.headers = { 'Pragma': 'no-cache', "Cache-Control": "no-cache" }
+
+
proxy.proxyRequest(req, res);
});
View
@@ -24,17 +24,15 @@ if(console.log === undefined){
function onConnect(status)
{
if (status == Strophe.Status.CONNECTING) {
- log('Strophe is connecting.');
+ $("#status").text('Connecting...');
} else if (status == Strophe.Status.CONNFAIL) {
- log('Strophe failed to connect.');
- $('#connect').get(0).value = 'connect';
+ $("#status").text('Failed to connect.');
} else if (status == Strophe.Status.DISCONNECTING) {
- log('Strophe is disconnecting.');
+ $('#status').text('Disconnecting.');
} else if (status == Strophe.Status.DISCONNECTED) {
- log('Strophe is disconnected.');
- $('#connect').get(0).value = 'connect';
+ $('#status').text('Disconnected.');
} else if (status == Strophe.Status.CONNECTED) {
- log('Strophe is connected.');
+ $('#status').text('Connected.');
if(window.location.pathname.substr(0,6) == "/room/"){
talkback.roomname = window.location.pathname.replace("/room/", "");
talkback.joinRoom(talkback.roomname+"@chat.talkback.im");
@@ -45,6 +43,17 @@ function onConnect(status)
$("#mapname").text(talkback.roomname);
talkback.pubsubSubscribe();
+
+ if(navigator.geolocation) {
+ // $('a#findme').click(function(){
+ navigator.geolocation.getCurrentPosition(function(position) {
+ var browserLoc = new L.LatLng(position.coords.latitude,position.coords.longitude);
+ map.panTo(browserLoc);
+ });
+ // });
+ }
+
+
//connection.disconnect();
}
}
@@ -353,17 +362,6 @@ $(document).ready(function(){
});
- if(navigator.geolocation) {
-// $('a#findme').click(function(){
- navigator.geolocation.getCurrentPosition(function(position) {
- var browserLoc = new L.LatLng(position.coords.latitude,position.coords.longitude);
- map.panTo(browserLoc);
- });
-// });
- }else{
- $("a#findme").parent("li").hide();
- }
-
map.on("click", function(e){
if(maptalk.mode=="edit"){
View
@@ -13,6 +13,14 @@ div#map{
left:0px;
}
+div#status{
+ position:absolute;
+ top:0px;
+ right:0px;
+ width:200px;
+ z-index:1002;
+ text-align:right;
+}
div#topnav{
position:absolute;
top:0px;
View
@@ -68,7 +68,7 @@
<div id="chatcontent">
</div>
-
+ <div id="status"></div>
<!--<div id="navigation">
<div id="square"></div>

0 comments on commit bf7a702

Please sign in to comment.