mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-12-29 13:31:00 +00:00
Fixed a lot of indentations
This commit is contained in:
@@ -8,7 +8,7 @@ var Suggestions = {
|
||||
}
|
||||
var to_display = number_suggested > 9 ? "9+" : number_suggested;
|
||||
if($(".suggested-link span.badge.new.white").hasClass("hide") && number_suggested > 0){
|
||||
$(".suggested-link span.badge.new.white").removeClass("hide");
|
||||
$(".suggested-link span.badge.new.white").removeClass("hide");
|
||||
}
|
||||
$(".suggested-link span.badge.new.white").text(to_display);
|
||||
if(single){
|
||||
@@ -25,11 +25,6 @@ var Suggestions = {
|
||||
var duration = Helper.secondsToOther(params.duration);
|
||||
var video_id = params.id;
|
||||
var video_title = params.title;
|
||||
/*var minutes = Math.floor(secs / 60);
|
||||
var seconds = secs - minutes * 60;
|
||||
|
||||
duration = Helper.pad(minutes) + ":" + Helper.pad(seconds);*/
|
||||
|
||||
var song = List.generateSong({id: video_id, title: video_title, length: params.duration, duration: duration}, false, false, false, true);
|
||||
$("#user-suggest-html").append(song);
|
||||
},
|
||||
@@ -40,48 +35,46 @@ var Suggestions = {
|
||||
var video_urls = "https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key="+api_key+"&id=";
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: get_url,
|
||||
dataType:"jsonp",
|
||||
success: function(response)
|
||||
{
|
||||
$.each(response.items.slice(0,5), function(i,data){
|
||||
video_urls += data.id.videoId+",";
|
||||
});
|
||||
type: "GET",
|
||||
url: get_url,
|
||||
dataType:"jsonp",
|
||||
success: function(response)
|
||||
{
|
||||
$.each(response.items.slice(0,5), function(i,data){
|
||||
video_urls += data.id.videoId+",";
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: video_urls,
|
||||
dataType: "jsonp",
|
||||
success: function(response)
|
||||
{
|
||||
$("#suggest-song-html").empty();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: video_urls,
|
||||
dataType: "jsonp",
|
||||
success: function(response)
|
||||
{
|
||||
$("#suggest-song-html").empty();
|
||||
|
||||
$.each(response.items, function(i,song)
|
||||
{
|
||||
var duration = song.contentDetails.duration;
|
||||
var length = Search.durationToSeconds(duration);
|
||||
duration = Helper.secondsToOther(Search.durationToSeconds(duration));
|
||||
var video_id = song.id;
|
||||
var video_title = song.snippet.title;
|
||||
$.each(response.items, function(i,song)
|
||||
{
|
||||
var duration = song.contentDetails.duration;
|
||||
var length = Search.durationToSeconds(duration);
|
||||
duration = Helper.secondsToOther(Search.durationToSeconds(duration));
|
||||
var video_id = song.id;
|
||||
var video_title = song.snippet.title;
|
||||
|
||||
//duration = duration.replace("PT","").replace("H","h ").replace("M","m ").replace("S","s");
|
||||
$("#suggest-song-html").append(List.generateSong({id: video_id, title: video_title, length: length, duration: duration}, false, false, false));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$("#suggest-song-html").append(List.generateSong({id: video_id, title: video_title, length: length, duration: duration}, false, false, false));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
checkUserEmpty: function(){
|
||||
var length = $("#user-suggest-html").children().length;
|
||||
if(length === 0){
|
||||
if(!Helper.contains($("#user_suggests").attr("class").split(" "), "hide"))
|
||||
$("#user_suggests").addClass("hide");
|
||||
$("#user_suggests").addClass("hide");
|
||||
}else{
|
||||
$("#user_suggests").removeClass("hide");
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user