From 48f08b3b47b04ab8f90c3cf8e50d7f4c60af49af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuele=20=22=E2=88=9E=22=20Vulcano?= Date: Sat, 17 Sep 2011 20:05:23 +0200 Subject: [PATCH] Final fixes. --- app/assets/javascripts/player.js.coffee | 44 ++++++++++++++++++++++++- app/assets/stylesheets/player.css.scss | 3 ++ app/controllers/youtubes_controller.rb | 3 +- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/player.js.coffee b/app/assets/javascripts/player.js.coffee index 2569715..5183583 100644 --- a/app/assets/javascripts/player.js.coffee +++ b/app/assets/javascripts/player.js.coffee @@ -253,4 +253,46 @@ $(document).ready -> overlay.updateChannelPicker() overlay.hide() - \ No newline at end of file + remote = -> + $.ajax + url: '/poll' + method: 'GET' + dataType: 'json' + success: (x) -> + console.log 'tick', x.action + if x and x.action + switch x.action + when 'next' + index = player.currentChannelIndex + index++ + if index >= player.channels.length + index = 0 + + player.loadChannel player.channels[index] + + if inside + window.clearTimeout(mouseTimeout) + hide = -> overlay.hide() + mouseTimeout = window.setTimeout(hide, 5000) + + overlay.show() unless overlay.visible + + when 'prev' + index = player.currentChannelIndex + index-- + if index < 0 + index = player.channels.length - 1 + + player.loadChannel player.channels[index] + + if inside + window.clearTimeout(mouseTimeout) + hide = -> overlay.hide() + mouseTimeout = window.setTimeout(hide, 5000) + + overlay.show() unless overlay.visible + + + + window.setInterval remote, 2000 + \ No newline at end of file diff --git a/app/assets/stylesheets/player.css.scss b/app/assets/stylesheets/player.css.scss index 95162ee..d0406a6 100644 --- a/app/assets/stylesheets/player.css.scss +++ b/app/assets/stylesheets/player.css.scss @@ -91,7 +91,10 @@ #overlay #channel-picker .channel h1 { color: white; + line-height: 53px; + height: 53px; font: 3em "D-SC", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; + text-overflow: ellipsis-word; } #overlay #channel-picker .channel img { diff --git a/app/controllers/youtubes_controller.rb b/app/controllers/youtubes_controller.rb index 04150ed..231fbaf 100644 --- a/app/controllers/youtubes_controller.rb +++ b/app/controllers/youtubes_controller.rb @@ -119,8 +119,7 @@ def login @body_id = 'login' client = GData::Client::YouTube.new - next_url = 'http://localhost:3000/sign_up' - next_url = 'http://primetime-dev2.infinite-labs.net/sign_up' if request.user_agent =~ /Mobile|webOS/ + next_url = 'http://primetime-dev2.infinite-labs.net/sign_up' secure = false # set secure = true for signed AuthSub requests sess = true @authsub_link = client.authsub_url(next_url, secure, sess)