1
0
Fork 0

Version near the logo

This commit is contained in:
magnolia-fan 2011-06-29 03:40:23 +04:00
parent 86863e4323
commit 67888f5fe6
4 changed files with 26 additions and 9 deletions

View File

@ -62,7 +62,7 @@
<div class="settings"></div>
</div>
<ul class="navigation">
<li class="logo search">BeatHaven</li>
<li class="logo search">BeatHaven<div class="version">0.4</div></li>
<li class="search">Search</li>
<li><a href="https://twitter.com/#!/beat_haven" target="_blank">News</a></li>
<li class="vk_auth" id="vk_login">Login</li>

View File

@ -81,10 +81,11 @@ Player = (function() {
handle: '.dragbox'
});
if (autoplay) {
return _player.setTrack($('.playlist-tracks li').last().attr('id').split('i')[1]);
_player.setTrack($('.playlist-tracks li').last().attr('id').split('i')[1]);
} else if (initial_count === 0 && !_player.hasTrack()) {
return _player.setTrack($('.playlist-tracks li').first().attr('id').split('i')[1]);
_player.setTrack($('.playlist-tracks li').first().attr('id').split('i')[1]);
}
return false;
};
Player.prototype.getDataFromLi = function(obj) {
var id, length, track_name;
@ -110,7 +111,8 @@ Player = (function() {
_vkontakte.loadTracksData($obj.attr('data-artist'), $obj.attr('data-track'), $obj.attr('data-length'), function(url) {
return _player.playSource(url);
});
return this.updateNowListening($obj.attr('data-artist'), $obj.attr('data-album'), $obj.attr('data-track'));
this.updateNowListening($obj.attr('data-artist'), $obj.attr('data-album'), $obj.attr('data-track'));
return false;
};
Player.prototype.hasTrack = function() {
if ($('#jplayer audio').length > 0) {
@ -122,11 +124,12 @@ Player = (function() {
return false;
};
Player.prototype.playSource = function(url) {
this.scrobbled = false;
$('#jplayer').jPlayer('setMedia', {
mp3: url
});
$('#jplayer').jPlayer('play');
return this.scrobbled = false;
return false;
};
Player.prototype.nextTrack = function(manual) {
var $li, cnt, rnd;
@ -185,21 +188,23 @@ Player = (function() {
};
Player.prototype.updateNowListening = function(artist, album, track) {
if (_session.getUser().lastfm_username) {
return _session.query('/lastfm/listening?r=' + Math.random(), {
_session.query('/lastfm/listening?r=' + Math.random(), {
artist: artist,
album: album,
track: track
});
}
return false;
};
Player.prototype.scrobble = function(artist, album, track) {
if (_session.getUser().lastfm_username) {
return _session.query('/lastfm/scrobble?r=' + Math.random(), {
_session.query('/lastfm/scrobble?r=' + Math.random(), {
artist: artist,
album: album,
track: track
});
}
return false;
};
return Player;
})();

View File

@ -44,7 +44,14 @@
font-size: 20px;
line-height: 32px;
font-weight: bold;
margin-right: 12px;
margin: -3px 1px 0 10px;
.version {
float: right;
font-size: 9px;
font-weight: normal;
margin: 10px 0 0 4px;
}
}
.vk_auth {

View File

@ -33,7 +33,12 @@
font-size: 20px;
line-height: 32px;
font-weight: bold;
margin-right: 12px; }
margin: -3px 1px 0 10px; }
.header-container .navigation li.logo .version {
float: right;
font-size: 9px;
font-weight: normal;
margin: 10px 0 0 4px; }
.header-container .navigation li .vk_auth {
display: none; }
.header-container .navigation li a {