Merge branch 'master' of github.com:diaspora/diaspora_rails

Conflicts:
	app/views/comments/_comment.html.haml
	app/views/layouts/application.html.haml
This commit is contained in:
danielvincent 2010-06-28 12:09:35 -07:00
commit 762cbcb0f2
8 changed files with 19 additions and 22 deletions

View file

@ -5,6 +5,7 @@ class Post
include ROXML
include Diaspora::Webhooks
xml_accessor :_id
key :person_id, ObjectId
belongs_to :person, :class_name => 'Person'

View file

@ -3,7 +3,7 @@ class StatusMessage < Post
xml_name :status_message
xml_accessor :message
key :message, String

View file

@ -1,4 +1,4 @@
%li.message{:class => ("mine" if mine?(post))}
%li.message{:id => post.id, :class => ("mine" if mine?(post))}
%span.from
= link_to_person post.person
%b wrote a new blog post

View file

@ -1,4 +1,4 @@
%li.message{:class => ("mine" if mine?(post))}
%li.message{:id => post.id, :class => ("mine" if mine?(post))}
%span.from
= link_to_person post.person
%b shared a link

View file

@ -1,4 +1,4 @@
%li.comment
%li.comment{:id => comment.id}
%span.from
= link_to_person comment.person
= comment.text

View file

@ -33,18 +33,12 @@
if((location.href.indexOf(obj['class']) != -1 ) || (location.pathname == '/')) {
$("#stream").prepend($(obj['html']).fadeIn("fast"));
};
}
ws.onclose = function() { debug("socket closed"); };
ws.onopen = function() {
debug("connected...");
};
$('#show_filters').hover( function() {
$("#stream_filters").fadeIn(80);
},
function() {
$("#stream_filters").fadeOut(100);
}
ws.onclose = function() { debug("socket closed"); };
ws.onopen = function() {
ws.send(location.pathname);
debug("connected...");
};
});
});
%body

View file

@ -1,4 +1,4 @@
%li.message{:class => ("mine" if mine?(post))}
%li.message{:id => post.id, :class => ("mine" if mine?(post))}
%span.from
= link_to_person post.person
= post.message

View file

@ -13,11 +13,11 @@ module WebSocket
end
end
EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8080, :debug => true) do |ws|
EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8080, :debug =>false) do |ws|
ws.onopen {
sid = @channel.subscribe { |msg| ws.send msg }
ws.onmessage { |msg| @channel.push msg}
ws.onmessage { |msg|}#@channel.push msg; puts msg}
ws.onclose { @channel.unsubscribe(sid) }
}
@ -29,10 +29,12 @@ module WebSocket
end
def self.view_hash(object)
{:class =>object.class.to_s.underscore.pluralize, :html => WebSocket.view_for(object)}
v = WebSocket.view_for(object)
puts v
{:class =>object.class.to_s.underscore.pluralize, :html => v}
end
def self.view_for(object)
@view.render(:partial => @view.type_partial(object), :locals => {:post => object})
@view.render @view.type_partial(object), :post => object
end
end
end