Skip to content
Browse files

bit more feedback on remote listeners

  • Loading branch information...
1 parent 26028cf commit 82f0a2accdc90f59c341b3c4d8619ae0b737d6b1 @remy remy committed Aug 28, 2011
Showing with 8 additions and 4 deletions.
  1. +1 −1 VERSION
  2. +3 −2 js/chrome/beta.js
  3. +2 −0 js/render/remote.js
  4. +2 −1 live.php
View
2 VERSION
@@ -1 +1 @@
-2.9.2
+2.9.3
View
5 js/chrome/beta.js
@@ -52,7 +52,8 @@
var last = {};
forbindPromise.done(function () {
- var key = (Math.abs(~~(Math.random()*+new Date))).toString(32);
+ var key = sessionStorage.remotekey || (Math.abs(~~(Math.random()*+new Date))).toString(32);
+ sessionStorage.remotekey = key;
function changes(lang, code) {
var msg = {},
@@ -123,7 +124,7 @@
console.log('forbind ready');
capture();
} else {
- console.log('user agent connected');
+ console.log('New remote view: ', event.user);
}
$document.bind('codeChange', throttle(capture, 250));
View
2 js/render/remote.js
@@ -152,6 +152,7 @@ function initForbind() {
forbind.on({
join: function (event) {
+ document.body.removeChild(document.getElementById('debug'));
if (event.isme) notice('Successfully joined');
},
leave: function (event) {
@@ -167,6 +168,7 @@ function initForbind() {
// now attempt to join
forbind.debug = debug;
+ forbind.user(navigator.userAgent);
forbind.join(key);
}
View
3 live.php
@@ -11,6 +11,7 @@
</style>
</head>
<body>
+<p style="margin: 0; padding: 20px; background: #c00; color: #fff; font-weight: bold; font: 18px monospace; sans-serif;" id="debug">Waiting for connection to remote host...</p>
<script src="<?php echo ROOT ?>js/render/remote.js"></script>
</body>
-</html>
+</html>

0 comments on commit 82f0a2a

Please sign in to comment.
Something went wrong with that request. Please try again.