Bad local time fix, social buttons
This commit is contained in:
@@ -13,4 +13,6 @@
|
||||
//= require page
|
||||
//= require settings
|
||||
|
||||
//= require beathaven
|
||||
//= require beathaven
|
||||
|
||||
//= require_tree ./social
|
||||
|
||||
@@ -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'));
|
||||
@@ -1,6 +1,7 @@
|
||||
class window.Vkontakte
|
||||
|
||||
api_id: null
|
||||
session_length: 3600 # seconds
|
||||
|
||||
constructor: (@api_id) ->
|
||||
|
||||
@@ -12,6 +13,7 @@ class window.Vkontakte
|
||||
window.vkAsyncInit = ->
|
||||
VK.init apiId: _vkontakte.getApiId()
|
||||
_vkontakte.auth()
|
||||
|
||||
|
||||
setTimeout ->
|
||||
$('#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();
|
||||
|
||||
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"
|
||||
setTimeout ->
|
||||
log "Session expired"
|
||||
@@ -78,6 +82,7 @@ $('#login').live 'click', ->
|
||||
false
|
||||
, 8
|
||||
false
|
||||
|
||||
$('#logout').live 'click', ->
|
||||
VK.Auth.logout (response) ->
|
||||
_vkontakte.authInfo(response)
|
||||
|
||||
Reference in New Issue
Block a user