Implement YouTube search, minor fixes, remove "Play Next" button

This commit is contained in:
calzoneman 2013-04-04 11:39:43 -05:00
parent f7bc601fed
commit 362fd0ab23
7 changed files with 102 additions and 16 deletions

View file

@ -323,10 +323,17 @@ function searchLibrary() {
}
$("#library_search").click(searchLibrary);
$("#library_query").keydown(function(ev) {
if(ev.key == 13)
if(ev.keyCode == 13)
searchLibrary();
});
$("#youtube_search").click(function() {
socket.emit("searchLibrary", {
query: $("#library_query").val(),
yt: true
});
});
$("#largelayout").click(largeLayout);
$("#hugelayout").click(hugeLayout);
$("#narrowlayout").click(narrowLayout);

View file

@ -156,11 +156,17 @@ function formatChatMessage(data) {
function makeQueueEntry(video) {
var li = $("<li />");
li.attr("class", "well");
var title = $("<span />").attr("class", "qe_title").appendTo(li);
if(video.thumb) {
$("<img/>").attr("src", video.thumb.url)
.css("float", "left")
.css("clear", "both")
.appendTo(li);
}
var title = $("<span />").addClass("qe_title").appendTo(li);
title.text(video.title);
var time = $("<span />").attr("class", "qe_time").appendTo(li);
var time = $("<span />").addClass("qe_time").appendTo(li);
time.text(video.duration);
var clear = $("<div />").attr("class", "qe_clear").appendTo(li);
var clear = $("<div />").addClass("qe_clear").appendTo(li);
return li;
}
@ -258,7 +264,7 @@ function addLibraryButtons(li, id) {
var btnNext = $("<button />").attr("class", "btn qe_btn").appendTo(btnstrip);
//$("<i />").attr("class", "icon-play").appendTo(btnNext);
btnNext.text("Next");
if(!CHANNELOPTS.qopen_allow_qnext)
if(!CHANNELOPTS.qopen_allow_qnext && RANK < Rank.Moderator && !LEADER)
btnNext.attr("disabled", true);
var btnEnd = $("<button />").attr("class", "btn qe_btn").appendTo(btnstrip);