Search fixes
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
var Search = {
|
||||
|
||||
pics: [],
|
||||
|
||||
showSpinner: function() {
|
||||
$('#search-container input').attr('disabled', 'disabled').blur();
|
||||
$('#search-container img').show();
|
||||
@@ -31,13 +33,15 @@ var Search = {
|
||||
|
||||
showArtistPics: function(pics) {
|
||||
$('.artist_loading, .artist_pics').show();
|
||||
$('.artist_pics').html('');
|
||||
for (var i = 0; i < pics.length; i++) {
|
||||
$('.artist_pics').append('\
|
||||
<div class="pic">\
|
||||
<img src="'+ pics[i] +'" alt=""/>\
|
||||
</div>\
|
||||
');
|
||||
for (var i = 0; i < pics.length; i++) {console.log(Search.pics.indexOf(pics[i]));
|
||||
if (Search.pics.indexOf(pics[i]) === -1) {
|
||||
Search.pics.push(pics[i]);
|
||||
$('.artist_pics').append('\
|
||||
<div class="pic">\
|
||||
<img src="'+ pics[i] +'" alt=""/>\
|
||||
</div>\
|
||||
');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ function authInfo(response) {
|
||||
$(function(){
|
||||
VK.init({
|
||||
apiId: (document.location.host == 'beathaven.org' ? 2335068 : 2383163),
|
||||
nameTransportPath: "/demo/xd_receiver.html"
|
||||
nameTransportPath: "/xd_receiver.html"
|
||||
});
|
||||
VK.Auth.getLoginStatus(authInfo);
|
||||
$('#vk_login').click(function(){
|
||||
@@ -38,7 +38,8 @@ $(function(){
|
||||
})
|
||||
|
||||
function loadTracksData(artist, track, duration, callback) {
|
||||
VK.Api.call('audio.search', {q: artist +' '+ track}, function(r){
|
||||
track_prepared = track.replace(/\(.*\)/i, '');
|
||||
VK.Api.call('audio.search', {q: artist +' '+ track_prepared}, function(r){
|
||||
callback(matchPerfectResult(r.response, artist, track, duration));
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user