var Pages;
Pages = (function() {
function Pages() {}
Pages.prototype.renderArtist = function(data) {
var albums_info, artist_info;
artist_info = $('\
\
\
\
\
' + data.artist.name + '
\
\
' + data.artist.desc + '\
\
');
albums_info = $('');
$.each(data.albums, function(i, album) {
var album_info;
if (album.year != null) {
album_info = $('\
\
' + album.name + ' (' + album.year + ')
\
\
\
\
\
\
\
');
$.each(album.tracks.album, function(i, track) {
var track_info;
track_info = $('\
\
+
\
\
\
' + (i + 1) + '\
' + track.name + '
\
' + track.duration + '
\
\
');
return $(album_info).find('.tracklist ul').append(track_info);
});
return $(albums_info).append(album_info);
}
});
$('.data-container').css({
backgroundImage: 'none'
});
$('.data-container .inner').html('').append(artist_info).append(albums_info);
yaCounter7596904.hit(_ajax.getAnchor(), data.artist.name, _ajax.referer);
_ajax.setTitle(data.artist.name);
_beathaven.redrawScrollbar();
return false;
};
Pages.prototype.renderSearch = function(data) {
$('.data-container').css({
background: 'url(/images/concrete_wall_2.png) 0 -30px repeat'
});
$('.data-container .inner').html(data);
$('.search-container').css('marginLeft', ($('.data-container').width() - 425) / 2 + 'px').css('marginTop', ($('.data-container').height() / 2 - 230) + 'px').height(($('.data-container').height() - $('#search_form').height()) / 2);
setTimeout(function() {
$('#search_field').bh_autocomplete({
serviceUrl: '/artist/autocomplete',
minChars: 2,
delimiter: /(,|;)\s*/,
maxHeight: 400,
width: 415,
zIndex: 9999,
deferRequestBy: 500,
onSelect: function() {
return _ajax.loadArtistData($('#search_field').val());
}
});
return $('#search_field').focus();
}, 501);
yaCounter7596904.hit(_ajax.getAnchor(), 'Artist Search', _ajax.referer);
_ajax.setTitle('Artist Search');
return false;
};
Pages.prototype.renderSettings = function(data) {
if (_session.getUser().id == null) {
_ajax.go('/search/');
return false;
}
$('.data-container').css({
background: 'none'
});
$('.data-container .inner').html(data);
yaCounter7596904.hit(_ajax.getAnchor(), 'Settings', _ajax.referer);
_ajax.setTitle('Settings');
$('.settings-container .tabs .tab').first().trigger('click');
return false;
};
Pages.prototype.renderTextpage = function(data) {
$('.data-container').css({
background: 'url(/images/concrete_wall_2.png) 0 -30px repeat'
});
$('.data-container .inner').html(data);
_beathaven.redrawScrollbar();
return false;
};
return Pages;
})();
$('.about').live('click', function() {
_ajax.go('/about/');
return false;
});