Added gui for importing youtube playlists

This commit is contained in:
Kasper Rynning-Tønnesen
2015-07-06 19:20:56 +02:00
parent 4215a3b8d9
commit a48c6160ab
5 changed files with 58 additions and 24 deletions

View File

@@ -149,28 +149,6 @@ $(document).ready(function()
i = 0;
timer=100;
}
}else if(event.keyCode == 13)
{
pId = search_input.split("list=");
if(pId.length > 1)
{
playlist_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&maxResults=40&key="+api_key+"&playlistId="+pId[1];
$.ajax({
type: "GET",
url: playlist_url,
dataType:"jsonp",
success: function(response)
{
var ids="";
$.each(response.items, function(i,data)
{
ids+=data.contentDetails.videoId+",";
});
addVideos(ids);
document.getElementById("search").value = "";
}
});
}
}
@@ -236,6 +214,10 @@ $('input[class=conf]').change(function()
Admin.save();
});
$('#listImport').on("submit", function(){
Search.importPlaylist(document.getElementById("import").value);
});
$(window).focus(function(){
if(unseen)
{