1
0
Fork 0

Bad local time fix, social buttons

This commit is contained in:
magnolia-fan 2011-11-28 03:13:14 +04:00
parent b55da886db
commit 4c40a928ab
6 changed files with 35 additions and 11 deletions

View File

@ -13,4 +13,6 @@
//= require page //= require page
//= require settings //= require settings
//= require beathaven //= require beathaven
//= require_tree ./social

View File

@ -0,0 +1,7 @@
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

View File

@ -1,6 +1,7 @@
class window.Vkontakte class window.Vkontakte
api_id: null api_id: null
session_length: 3600 # seconds
constructor: (@api_id) -> constructor: (@api_id) ->
@ -12,6 +13,7 @@ class window.Vkontakte
window.vkAsyncInit = -> window.vkAsyncInit = ->
VK.init apiId: _vkontakte.getApiId() VK.init apiId: _vkontakte.getApiId()
_vkontakte.auth() _vkontakte.auth()
setTimeout -> setTimeout ->
$('#vk_api_transport').append($('<script async="async" type="text/javascript" src="http://vkontakte.ru/js/api/openapi.js">')) $('#vk_api_transport').append($('<script async="async" type="text/javascript" src="http://vkontakte.ru/js/api/openapi.js">'))
@ -49,7 +51,9 @@ class window.Vkontakte
$('.fullscreen').hide(); $('.fullscreen').hide();
if response.session.expire? if response.session.expire?
expire_in = response.session.expire * 1000 - new Date().getTime() # expire_in = response.session.expire * 1000 - new Date().getTime()
# the time is an illusion...
expire_in = @session_length * 1000
log "Session will expire in #{Math.round(expire_in / 1000)} seconds" log "Session will expire in #{Math.round(expire_in / 1000)} seconds"
setTimeout -> setTimeout ->
log "Session expired" log "Session expired"
@ -78,6 +82,7 @@ $('#login').live 'click', ->
false false
, 8 , 8
false false
$('#logout').live 'click', -> $('#logout').live 'click', ->
VK.Auth.logout (response) -> VK.Auth.logout (response) ->
_vkontakte.authInfo(response) _vkontakte.authInfo(response)

View File

@ -40,4 +40,13 @@ table.stats {
&:hover { &:hover {
color: inherit; color: inherit;
} }
}
.fb-like, .vk-like {
float: left;
}
.vk-like td {
padding: 0 !important;
line-height: 12px;
} }

View File

@ -0,0 +1,4 @@
.fb-like{ "data-href" => "http://facebook.com/BeatHavenHQ", "data-send" => "false", "data-layout" => "button_count", "data-width" => "100", "data-show-faces" => "false", "data-font" => "lucida grande" }
.vk-like
%script{ type: "text/javascript" }
document.write(VK.Share.button(false, {type: "round", text: "Нравится"}));

View File

@ -8,10 +8,11 @@
%link{ rel: "shortcut icon", href: "/favicon.ico" } %link{ rel: "shortcut icon", href: "/favicon.ico" }
%link{ rel: "apple-touch-icon", href: image_path("logo.png") } %link{ rel: "apple-touch-icon", href: image_path("logo.png") }
%link{ rel: "search", type: "application/opensearchdescription+xml", title: "BeatHaven", href: "/opensearch.xml"} %link{ rel: "search", type: "application/opensearchdescription+xml", title: "BeatHaven", href: "/opensearch.xml"}
= stylesheet_link_tag "application" = stylesheet_link_tag :application, cache: true
= javascript_include_tag "application" = javascript_include_tag :application, cache: true
= javascript_include_tag "http://vkontakte.ru/js/api/share.js", charset: "windows-1251"
%body %body
#fb-root
.topbar-wrapper .topbar-wrapper
.topbar .topbar
.topbar-inner .topbar-inner
@ -52,7 +53,6 @@
.row .row
.span11.columns#content .span11.columns#content
&nbsp; &nbsp;
.span5.columns .span5.columns
.ad_here= t('global.your_ad_here').html_safe .ad_here= t('global.your_ad_here').html_safe
.player .player
@ -73,14 +73,11 @@
.quality-buttons .quality-buttons
%a.q-good{ :title => t('player.thumbs_up') }= image_tag "icns/thumbs-up.png" %a.q-good{ :title => t('player.thumbs_up') }= image_tag "icns/thumbs-up.png"
%a.q-bad{ :title => t('player.thumbs_down') }= image_tag "icns/thumbs-down.png" %a.q-bad{ :title => t('player.thumbs_down') }= image_tag "icns/thumbs-down.png"
%ul.playlist %ul.playlist
.row
.span11= render "like"
.fullscreen .fullscreen
.inner .inner
= image_tag "loader.gif" = image_tag "loader.gif"
#vk_api_transport #vk_api_transport
#jplayer #jplayer