Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update

  • Loading branch information...
commit 27fd255470fb70ecf87be4e2e71bc1eb185a9655 1 parent 506fbc4
@Cosmo authored
View
BIN  app/assets/images/ui/video.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2  app/controllers/logs_controller.rb
@@ -29,7 +29,7 @@ def create
end
if @log.save
logger.info "awesome, #{current_user.email} tagged a video at #{@log.at}"
- Pusher['presence-chat'].trigger('comment', { :body => @log.body, :user_id => @log.user_id, :short_time => @log.at.strftime("%H:%M"), :name => @log.user.name })
+ Pusher['comments'].trigger('comment', { :body => @log.body, :user_id => @log.user_id, :short_time => @log.at.strftime("%H:%M"), :name => @log.user.name })
end
redirect_to logs_path
else
View
37 app/views/chat/index.html.erb
@@ -1,35 +1,32 @@
<script type="text/javascript">
- Pusher.log = function(message) {
- if (window.console && window.console.log) window.console.log(message);
- };
-
$(function() {
// Set focus on message field
$("#log_body").focus();
- var socket = new Pusher('9b398a15a5cdeb082e7d');
- var channel = socket.subscribe('presence-chat');
+ var socket = new Pusher('9b398a15a5cdeb082e7d');
+ var presence_channel = socket.subscribe('presence-channel');
+ var channel = socket.subscribe('comments');
- channel.bind('pusher:subscription_succeeded', function(members) {
- console.log("subscribed!")
- update_member_count(members.count);
+ presence_channel.bind('pusher:subscription_succeeded', function(members) {
+ update_member_count(presence_channel.members.count);
members.each(function(member) {
add_member(member.id, member.info);
});
});
- channel.bind('pusher:member_added', function(member) {
- console.log("added!")
+ presence_channel.bind('pusher:member_added', function(member) {
+ add_member(member.id, member.info);
+ update_member_count(presence_channel.members.count);
});
- channel.bind('pusher:member_removed', function(member) {
- console.log("removed!")
+ presence_channel.bind('pusher:member_removed', function(member) {
remove_member(member.id);
+ update_member_count(presence_channel.members.count);
});
channel.bind('comment', function(data) {
- console.log(data.user_name);
- $("<p>["+data.short_time+"] "+data.name+": "+data.body+"</p>").appendTo("#chat");
+ console.log("hi!");
+ $("<p>["+data.short_time+"] "+data.name+": "+data.body+"</p>").appendTo("#debug_window");
$("#new_log").reset();
$("#log_body").focus();
});
@@ -45,15 +42,19 @@
}
function remove_member(member_id) {
- console.log("removing: " + member_id)
- console.log("removing!!." + $("member_id_" + member_id))
$("#member_id_" + member_id).remove();
}
+
+ function push_comment() {
+
+ }
</script>
<div style="background-color: white">
- <div id="chat">
+
+ <h2>Realtime debug:</h2>
+ <div id="debug_window">
</div>
<%= form_for Log.new, :remote => true do |f| %>
View
21 app/views/home/index.html.erb
@@ -2,11 +2,9 @@
<div id="prev" class="sidebar">
<a href="#" class="sidebar-video">
<div class="sidebar-title">Sendung verpasst?</div>
- <%= image_tag @schedule_previous["VDO"] ? @schedule_previous["VDO"]["VTU"]["IUR"] : "", :size => "176x117" %>
+ <%= image_tag @schedule_previous["VDO"] ? @schedule_previous["VDO"]["VTU"]["IUR"] : "ui/default.png", :size => "176x117" %>
<h3><%= @schedule_previous["TIT"] %></h3>
- <% if @schedule_previous["AP7"] %>
- <%= link_to "Arte+7", @schedule_previous["VDO"]["VTR"] %>
- <% end %>
+ Ende: <%= @schedule_now["BAT"] ? "#{@schedule_now["BAT"]} Uhr" : "" %>
</a>
</div>
@@ -19,27 +17,30 @@
</div>
<div id="current-video">
<div id="teaser-button">
- <%= image_tag @schedule_now["VDO"] ? @schedule_now["VDO"]["VTU"]["IUR"] : "", :size => "260x160" %>
+ <%= image_tag @schedule_now["VDO"] ? @schedule_now["VDO"]["VTU"]["IUR"] : "ui/default.png", :size => "260x160" %>
</div>
<div id="description">
<div id="nowon">Jetzt läuft:</div>
- <h1><%= @schedule_now["DSS"] ? @schedule_now["DSS"] : @schedule_now["DTE"] %></h1>
+ <h1><%= @schedule_now["TIT"] %></h1>
<h2>
- 20:15 - 22:15 Uhr
+ <%= @schedule_now["BAT"] ? @schedule_now["BAT"] : "" %> - <%= @schedule_next["BAT"] ? "#{@schedule_next["BAT"]} Uhr" : "" %>
</h2>
<p>
- Die Produkte der Firma Apple, seien es Computer oder Telefone, vermitteln den Käufern beziehungsweise Nutzern eine bestimmte Lebensart und die Zugehörigkeit zu einer besonderen - oft auch als elitär bezeichneten - Gruppe der Gesellschaft, die äußerst anziehend wirkt.
+ <%= @schedule_now["DSS"] ? @schedule_now["DSS"] : @schedule_now["DTE"] %>
</p>
</div>
</div>
+ <div id="comment-timeline">
+ <%= image_tag("ui/comment-stamps.png") %>
+ </div>
</div>
<div id="next" class="sidebar">
<a href="#" class="sidebar-video">
<div class="sidebar-title">Nächste Sendung:</div>
- <%= image_tag(@schedule_next["VDO"] ? @schedule_next["VDO"]["VTU"]["IUR"] : "", :size => "176x117") %>
+ <%= image_tag @schedule_next["VDO"] ? @schedule_next["VDO"]["VTU"]["IUR"] : "ui/default.png", :size => "176x117" %>
<h3><%= @schedule_next["TIT"] %></h3>
- <%= @schedule_next["BAT"] ? "#{@schedule_next["BAT"]} Uhr" : "" %>
+ Beginn: <%= @schedule_next["BAT"] ? "#{@schedule_next["BAT"]} Uhr" : "" %>
</a>
</div>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.