Permalink
Browse files

streaming visual tweaks - not finished yet

  • Loading branch information...
1 parent 98d2e30 commit 9379b892b528fc8bcd0354571d1c0020ec7225d8 @remy remy committed Sep 22, 2010
Showing with 22 additions and 7 deletions.
  1. +8 −0 css/style.css
  2. +14 −7 js/chrome/stream.js
View
@@ -630,6 +630,14 @@ body.pausestream #streaming .resume {
display: inline;
}
+#streaming .listen {
+ display: none;
+}
+
+#streaming.listen .listen {
+ display: inline;
+}
+
body.pausestream #streaming {
background: #c00;
text-shadow: #a00 0px 1px 0px;
View
@@ -1,6 +1,6 @@
(function () {
-var $stream = $('<div id="streaming"><span class="msg"></span><span class="n"></span> (click here to <span class="resume">resume</span><span class="pause">pause</span>)</div>').prependTo('body'),
+var $stream = $('<div id="streaming"><span class="msg"></span><span class="n"></span><span class="listen"> (click here to <span class="resume">resume</span><span class="pause">pause</span>)</span></div>').prependTo('body'),
streaming = false,
$body = $('body'),
key = null,
@@ -58,6 +58,7 @@ forbind.bind('join', function () {
if (msg.data.html) {
editors.html.setCode(msg.data.html);
+ $(document).trigger('codeChange');
}
// update preview if required
@@ -83,12 +84,14 @@ window.stream = {
var join = function () {
for (type in editors) {
(function (type) {
- $(editors[type].win.document).bind('keyup', function () {
- if (streaming) {
- clearTimeout(editorTimer[type]);
- setTimeout(capture, 250);
- }
- });
+ try {
+ $(editors[type].win.document).bind('keyup', function () {
+ if (streaming) {
+ clearTimeout(editorTimer[type]);
+ editorTimer[type] = setTimeout(capture, 250);
+ }
+ });
+ } catch (e) {}
})(type);
}
};
@@ -106,13 +109,17 @@ window.stream = {
});
forbind.create(key);
+
+ $stream.removeClass('listen');
return key;
},
join: function (key) {
forbind.unbind('create');
forbind.join(key);
+ $stream.addClass('listen');
+
$(document).one('keyup', function (event) {
if (streaming && event.which == 27) {
window.stream.leave();

0 comments on commit 9379b89

Please sign in to comment.