Permalink
Browse files

jo

  • Loading branch information...
1 parent 8b6d968 commit cb75fe072c428cc9e8dc083c3539c92a4b385849 @Cosmo committed Oct 21, 2012
View
BIN .DS_Store
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -25,11 +25,15 @@ jQuery.fn.reset = function () {
$(this).each (function() { this.reset(); });
}
+var gobal_time_channel;
+
$(function() {
var socket = new Pusher('9b398a15a5cdeb082e7d');
var presence_channel = socket.subscribe('presence-channel');
var channel = socket.subscribe('comments');
+ var time = socket.subscribe('client-time');
+ gobal_time_channel = time;
presence_channel.bind('pusher:subscription_succeeded', function(members) {
update_member_count(presence_channel.members.count);
@@ -53,12 +57,17 @@ $(function() {
pushComment({ id: data.id, uid: data.uid, name: data.name, body: data.body, timestamp: data.timestamp, user_id: data.user_id });
});
+ channel.bind('client-time', function(data) {
+ $("#member_id_1" + " .time").text(data.timestamp);
+ });
+
function update_member_count(count) {
$("#count").text(count + " users");
}
function add_member(member_id, member_info) {
- $("<li id='member_id_"+member_id+"'>"+member_info.name+"</li>").appendTo("#members");
+ console.log(member_info);
+ $("<li id='member_id_"+member_id+"'></span><span class='time'>22:31</span><span class='name'>"+member_info.name+"</span><span class='profile'><img src='https://graph.facebook.com/" + member_info.uid + "/picture/' /></li>").appendTo("#members");
}
function remove_member(member_id) {
@@ -160,6 +160,12 @@
if(settings.progressBar){
interval = window.setInterval(function(){
elements.elapsed.width(((elements.player.getCurrentTime()/data.duration)*100)+'%');
+ timestamp = elements.player.getCurrentTime();
+ populateComments(timestamp);
+
+ var triggered = gobal_time_channel.trigger("client-time", { timestamp: timestamp });
+ console.log(triggered);
+
},1000);
}
@@ -60,7 +60,7 @@
var left = (584 / videoDuration) * timestamp;
$("<div id='marker_" + id + "' data-uid='"+uid+"' data-marker-id='"+id+"' data-name='" + name + "' data-text='" + body +
- "' data-timestamp='"+timestamp+"' class='comment" + user_type + "' style='position:absolute; left:" + left + "px;'></div>")
+ "' data-timestamp='"+timestamp+"' class='comment" + user_type + "' style='position:absolute; left:" + (left - 4) + "px;'></div>")
.mouseenter(function () {
$("<div id='c" + id + "' style='width:200px; background-color:#eee; padding:4px;'><img src='https://graph.facebook.com/" +
uid + "/picture/' style='float:left; margin-right:5px;' />" +
@@ -59,7 +59,7 @@ body.ui
#wrapper
width: 100%
- padding-bottom: 44px
+ // padding-bottom: 44px
overflow: hidden
float: left
@@ -79,9 +79,6 @@ body.ui
position: relative
z-index: 2
- #column_left
- width: 220px
-
#column_center
width: 584px
@@ -222,12 +219,29 @@ body.ui
margin: 0 0 0 12px
width: 486px
+ #column_left
+ width: 220px
+
+ .sidebar-video-minified
+ background: #444
+ position: relative
+
+ h3
+ color: #222
+
+ .sidebar-video-minified:hover
+ background: #222
+
+ h3
+ color: #fff
+
#column_right
width: 220px
.sidebar
position: relative
z-index: 0
+ overflow: hidden
.sidebar-video
width: 180px
@@ -260,6 +274,8 @@ body.ui
.sidebar-video-minified
background: #222
position: relative
+ width: 170px
+ padding: 10px 30px 10px 20px
h3
color: #ccc
@@ -270,7 +286,16 @@ body.ui
background: image-url("ui/bookmark-default-minified.png")
position: absolute
top: 0
- right: 6px
+ right: 10px
+ z-index: 40
+
+ .arte7
+ width: 12px
+ height: 12px
+ background: image-url("ui/arte7.png")
+ position: absolute
+ top: 16px
+ right: 10px
z-index: 40
.sidebar-video-minified:hover
@@ -287,6 +312,12 @@ body.ui
bottom: 0
z-index: 2
+ #footer-inside
+ width: 584px
+ height: 44px
+ float: left
+ position: relative
+
#comment_form
input
@@ -307,10 +338,10 @@ body.ui
width: 26px
@include border-radius(18px)
float: left
- background: #444
display: inline-block
border: none
margin: 9px
+ background: #444 image-url("ui/btn-stamp-default.png")
#send_comment
height: 26px
@@ -332,5 +363,5 @@ body.ui
line-height: 44px
color: #fff
background: $orange
- padding: 0 14px
- float: right
+ width: 80px
+ text-align: center
@@ -1,21 +1,30 @@
class HomeController < ApplicationController
def index
- schedule_now_and_next_url = "http://www.arte.tv/tvhack/tvguide/epg/live/D/L3/10.json"
+ schedule_now_and_next_url = "http://www.arte.tv/tvhack/tvguide/epg/live/D/L3/10.json?#{Time.now.to_i}"
schedule_now_and_next = parse_json(schedule_now_and_next_url)
@schedule_now = schedule_now_and_next["abstractBroadcastList"][0]
@schedule_next = schedule_now_and_next["abstractBroadcastList"]
date_today = Date.today.strftime("%Y-%m-%d")
date_yesterday = Date.yesterday.strftime("%Y-%m-%d")
- schedule_url = "http://www.arte.tv/tvhack/tvguide/epg/schedule/D/L3/#{date_yesterday}/#{date_today}.json"
+ schedule_url = "http://www.arte.tv/tvhack/tvguide/epg/schedule/D/L3/#{date_yesterday}/#{date_today}.json?#{Time.now.to_i}"
schedule_day = parse_json(schedule_url)
+ schedule_previous = []
+ previous_found = false
schedule_day["abstractBroadcastList"].each_with_index {|program, index|
- if program["BID"] == @schedule_now["BID"]
- @schedule_previous = schedule_day["abstractBroadcastList"][index-1]
+ if index < 11
+ unless previous_found
+ schedule_previous << schedule_day["abstractBroadcastList"][index-1]
+ end
+
+ if program["BID"] == @schedule_now["BID"]
+ previous_found = true
+ end
end
}
+ @schedule_previous = schedule_previous.reverse
end
def parse_json(url)
@@ -7,7 +7,8 @@ def auth
:user_id => current_user.id,
:user_info => { # => optional - for example
:name => current_user.name,
- :email => current_user.email
+ :email => current_user.email,
+ :uid => current_user.uid
}
})
render :json => response
@@ -4,10 +4,20 @@
<div id="column_left" class="column sidebar">
<a href="#" class="sidebar-video">
<div class="sidebar-title">Sendung verpasst?</div>
- <% previous_image_path = (@schedule_previous["IMG"] ? @schedule_previous["IMG"]["IUR"] : "ui/default.png") %>
+ <% previous_image_path = (@schedule_previous[0]["IMG"] ? @schedule_previous[0]["IMG"]["IUR"] : "ui/default.png") %>
<div class="sidebar-image" style="background-image: url(<%= image_path(previous_image_path) %>); background-size: cover; width: 176px; height: 117px"></div>
- <h3><%= @schedule_previous["TIT"] %></h3>
+ <%= @schedule_previous[0]["BAT"] ? "#{@schedule_previous[0]["BAT"]} Uhr" : "" %>
+ <h3><%= @schedule_previous[0]["TIT"] %></h3>
</a>
+
+ <% @schedule_previous.drop(1).each do |schedule_after_previous| %>
+ <a href="#" class="sidebar-video sidebar-video-minified">
+ <div class="bookmark"></div>
+ <div class="arte7"></div>
+ <%= schedule_after_previous["BAT"] ? "#{schedule_after_previous["BAT"]} Uhr" : "" %>
+ <h3><%= schedule_after_previous["TIT"] %></h3>
+ </a>
+ <% end %>
</div>
<div id="column_center" class="column">
<div id="video-minified">
@@ -41,6 +51,14 @@
<div id="video">
<div id="player"></div>
</div>
+ <div id="footer-inside">
+ <%= link_to "Login", login_path, id: "login" %>
+ <div id="comment_form">
+ <input type="text" name="log_body" value="" id="log_body" autocomplete="off" />
+ <button id="stamp_comment"></button>
+ <button id="send_comment">Senden</button>
+ </div>
+ </div>
<div id="info-bar">
<div id="count">Loading members count …</div>
@@ -64,18 +82,14 @@
<% @schedule_next.drop(2).each do |schedule_after_next| %>
<a href="#" class="sidebar-video sidebar-video-minified">
<div class="bookmark"></div>
+ <div class="arte7"></div>
<%= schedule_after_next["BAT"] ? "#{schedule_after_next["BAT"]} Uhr" : "" %>
<h3><%= schedule_after_next["TIT"] %></h3>
</a>
<% end %>
</div>
</div>
- <div id="footer">
- <%= link_to "Login", login_path, id: "login" %>
- <div id="comment_form">
- <input type="text" name="log_body" value="" id="log_body" autocomplete="off" />
- <button id="stamp_comment"></button>
- <button id="send_comment">Senden</button>
- </div>
- </div>
+ <!--
+ Footer div goes here
+ -->
</div>
@@ -11,32 +11,14 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, target-densitydpi=device-dpi, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="assets/ui/apple-touch-icon-72x72.png" />
- <%= yield(:head) %>
- <div id="fb-root"></div>
- <script>
- window.fbAsyncInit = function() {
- // init the FB JS SDK
- FB.init({
- appId : '415557498509876', // App ID from the App Dashboard
- channelUrl : 'http://tvhackday.de/channel.html', // Channel File for x-domain communication
- status : true, // check the login status upon init?
- cookie : true, // set sessions cookies to allow your server to access the session?
- xfbml : true // parse XFBML tags on this page?
- });
-
- };
-
- // Load the SDK's source Asynchronously
- (function(d){
- var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
- if (d.getElementById(id)) {return;}
- js = d.createElement('script'); js.id = id; js.async = true;
- js.src = "//connect.facebook.net/en_US/all.js";
- ref.parentNode.insertBefore(js, ref);
- }(document));
- </script>
+ <meta property="og:title" content="TV Hackday 2012" />
+ <meta property="og:description" content="ROFL! Die Hasen-Stelle ist …" />
+ <meta property="og:image" content="https://tivipeek.blob.core.windows.net/public/share_preview.png" />
+ <meta property="og:url" content="http://www.tivipeek.com/hackday2012/" />
+ <link rel="image_src" type="image/png" href="https://tivipeek.blob.core.windows.net/public/share_preview.png" />
+ <%= yield(:head) %>
</head>
<%
if logged_in?

0 comments on commit cb75fe0

Please sign in to comment.