Permalink
Browse files

cymain conflict fix

  • Loading branch information...
2 parents a359b8c + 1cd07b2 commit a6cfb44c0022cf7d94c636f0f7fd495b373ac922 @andregoncalves andregoncalves committed Dec 5, 2009
Showing with 43 additions and 6 deletions.
  1. +23 −0 README
  2. +16 −4 assets/javascripts/cymain.js
  3. +2 −0 assets/javascripts/final.js
  4. +2 −2 nginx/nginx.conf
View
23 README
@@ -0,0 +1,23 @@
+Install
+-------
+
+1. Install nginx with the http push module.
+You can find instructions here:
+
+http://www.igvita.com/2009/10/21/nginx-comet-low-latency-server-push/
+
+2. Clone cyclops
+
+3. Link nginx.conf to cyclops/nginx/nginx.conf
+
+4. Gentlemen, start your nginx
+
+5. browse to http://localhost:8000/demo_final/start_master.html
+
+6. Generate URLs
+
+7. Distribute slave URL to person(s) operating the browser(s) that are to be controlled (by email or IM, for instance). This person will have to open this URL.
+
+8. Click on the master link
+
+9. Move your mouse and click on things
@@ -15,12 +15,14 @@ var Cyclops = function(type) {
}
Cyclops.prototype.startListening = function() {
+ $('#mouse').show();
$.getJSON("/activity?id="+$.cookie('cyclops_queue_id'), function(ev) {
//console.info(ev.when+': Playing event '+ev.type);
// TODO: detect network conditions (retry?)
slave['playEvent_'+ev.type](ev);
slave.startListening();
});
+
/*
var temp_cyclops_get_lastModified = null;
@@ -165,22 +167,31 @@ Cyclops.prototype.__find_object_in_location = function(x, y) {
}
Cyclops.prototype.__create_event = function(type, pageX, pageY) {
+<<<<<<< HEAD:assets/javascripts/cymain.js
ev = jQuery.Event(type);
ev.pageX=parseInt(pageX);
ev.clientX=ev.pageX - (document.body.scrollLeft + document.documentElement.scrollLeft) ;
ev.pageY=parseInt(pageY);
ev.clientY=ev.pageY - (document.body.scrollTop + document.documentElement.scrollTop);
return ev;
+=======
+ ev = jQuery.Event(type);
+ ev.pageX=parseInt(pageX);
+ ev.clientX=ev.pageX;
+ ev.pageY=parseInt(pageY);
+ ev.clientY=ev.pageY;
+ return ev;
+>>>>>>> 1cd07b23ef4607992c6d5d154165090d751d5c67:assets/javascripts/cymain.js
}
Cyclops.prototype.playEvent_mousemove = function(e) {
// TODO: move to dispatch event
$("#mouse").css('top', e.data.y).css('left', e.data.x);
var el;
- if(el = slave.__find_object_in_location(e.data.x, e.data.y)) {
- //el.dispatchEvent(evt);
- var jsEvent = this.__create_event('mousemove', e.data.x, e.data.y);
+ if(el = slave.__find_object_in_location(e.data.x- (document.body.scrollLeft + document.documentElement.scrollLeft),
+ e.data.y - (document.body.scrollTop + document.documentElement.scrollTop))) {
+ var jsEvent = this.__create_event('mousemove', e.data.x- (document.body.scrollLeft + document.documentElement.scrollLeft), e.data.y- (document.body.scrollTop + document.documentElement.scrollTop));
$(el).trigger(jsEvent);
}
}
@@ -249,7 +260,8 @@ Cyclops.prototype.playEvent_click = function(e) {
// TODO: move to dispatch event
//console.info('CLICK!');
var el, href;
- if(el = slave.__find_object_in_location(e.data.x, e.data.y)) {
+ if(el = slave.__find_object_in_location(e.data.x- (document.body.scrollLeft + document.documentElement.scrollLeft),
+ e.data.y - (document.body.scrollTop + document.documentElement.scrollTop))) {
//console.info(el);
if(href = $(el).attr('href')) {
document.location = href+'?cyclops_slave=true';
@@ -114,5 +114,7 @@ $(window).load(function() {
console.info("click on document");
});*/
+ $('#mouse').hide();
+
});
View
@@ -48,7 +48,7 @@ http {
push_store_messages off; # enable message queueing
push_message_timeout 2s; # expire buffered messages after 2 hours
push_max_message_buffer_length 100; # store 10 messages
- push_min_message_recipients 1; # minimum recipients before purge
+ push_min_message_recipients 2; # minimum recipients before purge
}
# public long-polling endpoint
@@ -59,7 +59,7 @@ http {
# - last: only the most recent listener request is kept, 409 for others.
# - first: only the oldest listener request is kept, 409 for others.
# - broadcast: any number of listener requests may be long-polling.
- push_subscriber_concurrency last;
+ push_subscriber_concurrency broadcast;
set $push_channel_id $arg_id;
default_type text/plain;
}

0 comments on commit a6cfb44

Please sign in to comment.