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:
commit
762cbcb0f2
8 changed files with 19 additions and 22 deletions
|
|
@ -5,6 +5,7 @@ class Post
|
|||
include ROXML
|
||||
include Diaspora::Webhooks
|
||||
|
||||
xml_accessor :_id
|
||||
|
||||
key :person_id, ObjectId
|
||||
belongs_to :person, :class_name => 'Person'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ class StatusMessage < Post
|
|||
|
||||
xml_name :status_message
|
||||
xml_accessor :message
|
||||
|
||||
|
||||
key :message, String
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%li.comment
|
||||
%li.comment{:id => comment.id}
|
||||
%span.from
|
||||
= link_to_person comment.person
|
||||
= comment.text
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue