Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a quickfix for the demos not working on Linux

  • Loading branch information...
commit dd112fa029a7fe717f20a4fff41b901b133a3819 1 parent 51245e0
@ysimonson ysimonson authored
View
1  apps/static/chat/index.html
@@ -28,6 +28,7 @@
</div>
<script src="/lib/jquery/jquery-1.4.2.js" type="text/javascript" charset="UTF-8"></script>
+ <script src="/lib/util.js" type="text/javascript" charset="UTF-8"></script>
<script src="/lib/node-bus/socket.io/dist/socket.io.js" type="text/javascript" charset="UTF-8"></script>
<script src="/lib/node-bus/bus.client.js" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript" src="./js/chat.js"></script>
View
2  apps/static/chat/js/chat.js
@@ -3,7 +3,7 @@
// summary:
// Creates a new instance of a Chat client. Assumes that
// bus.client.js is already in the dom.
- this.bus = new Bus('http://' + window.location.hostname + ':' + window.location.port);
+ this.bus = getBus();
this.$messages = $messages;
this.bus.subscribe("chat/login", this, this.handleLogin);
View
1  apps/static/draw/index.html
@@ -25,6 +25,7 @@
</div>
<script src="/lib/jquery/jquery-1.4.2.js" type="text/javascript" charset="UTF-8"></script>
+ <script src="/lib/util.js" type="text/javascript" charset="UTF-8"></script>
<script src="/lib/node-bus/socket.io/dist/socket.io.js" type="text/javascript" charset="UTF-8"></script>
<script src="/lib/node-bus/bus.client.js" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript" src="./js/draw.js"></script>
View
2  apps/static/draw/js/draw.js
@@ -4,7 +4,7 @@
// Creates a new instance of a Draw client. Assumes that
// bus.client.js is already in the dom.
- this.bus = new Bus('http://' + window.location.hostname + ':' + window.location.port);
+ this.bus = getBus();
this.$canvas = $canvas;
this.$userList = $userList;
View
6 apps/static/lib/util.js
@@ -0,0 +1,6 @@
+function getBus() {
+ var host = window.location.hostname || "localhost";
+ var port = window.location.port || 8080;
+ var url = "http://" + host + ":" + port;
+ return new Bus(url);
+}
View
3  apps/static/playground/index.html
@@ -42,10 +42,11 @@
</table>
<script src="/lib/jquery/jquery-1.4.2.js" type="text/javascript" charset="UTF-8"></script>
+ <script src="/lib/util.js" type="text/javascript" charset="UTF-8"></script>
<script src="/lib/node-bus/socket.io/dist/socket.io.js" type="text/javascript" charset="UTF-8"></script>
<script src="/lib/node-bus/bus.client.js" type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript">
- var bus = new Bus('http://' + window.location.hostname + ':' + window.location.port);
+ var bus = getBus();
var $eventTableBody = null;
var $subscriptions = null;
Please sign in to comment.
Something went wrong with that request. Please try again.