Skip to content

Commit

Permalink
Merge pull request rauchg#61 from Graham42/bug/relative_paths
Browse files Browse the repository at this point in the history
Allow hosting at a subfolder
  • Loading branch information
rauchg committed Sep 21, 2015
2 parents 91ef979 + c16013a commit 0b7da63
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion lib/assets/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ function invite(channel, email, fn){
});
}

// use dom element for better cross browser compatibility
var url = document.createElement('a');
url.href = window.location;
// realtime updates
var socket = io();
var socket = io({path: (url.pathname + '/socket.io').replace('//','/')});
socket.on('data', function(users){
for (var i in users) update(i, users[i]);
});
Expand Down
6 changes: 5 additions & 1 deletion lib/assets/iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@
var script = document.createElement('script');
script.src = 'https://cdn.socket.io/socket.io-1.3.2.js';
script.onload = function(){
var socket = io();

// use dom element for better cross browser compatibility
var url = document.createElement('a');
url.href = window.location;
var socket = io({path: (url.pathname + '/socket.io').replace('//','/')});
var count = document.getElementsByClassName('slack-count')[0];

socket.on('data', function(users){
Expand Down
6 changes: 3 additions & 3 deletions lib/splash.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export default function splash({ name, org, logo, active, total, channels, ifram
style({ logo, active, iframe }),
// xxx: single build
dom('script src=https://cdn.socket.io/socket.io-1.3.2.js'),
dom('script src=/assets/superagent.js'),
dom('script src=/assets/client.js')
dom('script src=assets/superagent.js'),
dom('script src=assets/client.js')
);
return div;
}
Expand Down Expand Up @@ -102,7 +102,7 @@ function style({ logo, active, iframe } = {}){
});

css.add('.logo.slack', {
'background-image': 'url(/assets/slack.svg)'
'background-image': 'url(assets/slack.svg)'
});

if (logo) {
Expand Down

0 comments on commit 0b7da63

Please sign in to comment.