Init spinner
This commit is contained in:
@@ -35,8 +35,7 @@ BeatHaven = (function() {
|
||||
_player.initJplayer();
|
||||
_search = new Search();
|
||||
_pages = new Pages();
|
||||
_settings = new Settings();
|
||||
return _ajax.detectPage();
|
||||
return _settings = new Settings();
|
||||
};
|
||||
BeatHaven.prototype.adjustSizes = function() {
|
||||
$('.data-container').height($(window).height() - $('.header-container').height());
|
||||
|
||||
@@ -81,7 +81,7 @@ Pages = (function() {
|
||||
return false;
|
||||
};
|
||||
Pages.prototype.renderSettings = function(data) {
|
||||
if (_session.getUser().name == null) {
|
||||
if (_session.getUser().id == null) {
|
||||
_ajax.go('/search/');
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,17 +42,23 @@ Vkontakte = (function() {
|
||||
name: r.response
|
||||
}, function(ar2) {
|
||||
_session.setUser(ar2.user);
|
||||
return $('.header-container .hello .greating').html('Tēnā koe, <span class="settings">' + (_session.getUser().name ? _session.getUser().name : '%username%') + '</span>!');
|
||||
$('.header-container .hello .greating').html('Tēnā koe, <span class="settings">' + (_session.getUser().name ? _session.getUser().name : '%username%') + '</span>!');
|
||||
window._session = _session;
|
||||
_ajax.detectPage();
|
||||
return $('.fullscreen').hide();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
_session.setUser(ar.user);
|
||||
}
|
||||
$('.header-container .hello').show();
|
||||
return $('.header-container .hello .greating').html('Tēnā koe, <span class="settings">' + (_session.getUser().name ? _session.getUser().name : '%username%') + '</span>!');
|
||||
$('.header-container .hello .greating').html('Tēnā koe, <span class="settings">' + (_session.getUser().name ? _session.getUser().name : '%username%') + '</span>!');
|
||||
window._session = _session;
|
||||
_ajax.detectPage();
|
||||
return $('.fullscreen').hide();
|
||||
});
|
||||
if (response.session.expire != null) {
|
||||
setTimeout(function() {
|
||||
return setTimeout(function() {
|
||||
_vkontakte.auth();
|
||||
return false;
|
||||
}, response.session.expire * 1000 - new Date().getTime() + 1000);
|
||||
@@ -64,11 +70,13 @@ Vkontakte = (function() {
|
||||
display: 'block'
|
||||
});
|
||||
$('.header-container .hello').hide();
|
||||
window._session = _session;
|
||||
_ajax.detectPage();
|
||||
return $('.fullscreen').hide();
|
||||
}
|
||||
return window._session = _session;
|
||||
};
|
||||
Vkontakte.prototype.auth = function() {
|
||||
VK.Auth.login(function(response) {
|
||||
VK.Auth.getLoginStatus(function(response) {
|
||||
_vkontakte.authInfo(response);
|
||||
return false;
|
||||
}, 8);
|
||||
@@ -145,7 +153,10 @@ Vkontakte = (function() {
|
||||
return Vkontakte;
|
||||
})();
|
||||
$('#vk_login').live('click', function() {
|
||||
_vkontakte.auth();
|
||||
VK.Auth.login(function(response) {
|
||||
_vkontakte.authInfo(response);
|
||||
return false;
|
||||
}, 8);
|
||||
return false;
|
||||
});
|
||||
$('#vk_logout').live('click', function() {
|
||||
|
||||
Reference in New Issue
Block a user