mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Add many songs, search category, stuff
This commit is contained in:
@@ -6,6 +6,9 @@ socket.on("toast", function(msg)
|
||||
{
|
||||
pass_corr = "correct";
|
||||
switch(msg) {
|
||||
case "addedsong":
|
||||
msg=rnd(["I added your song", "Your song has been added", "Yay, more songs!", "Thats a cool song!", "I added that song for you", "I see you like adding songs..."])
|
||||
break;
|
||||
case "savedsettings":
|
||||
msg=rnd(["I've saved your settings", "I stored all your settings", "Your settings have been stored in a safe place"])
|
||||
break;
|
||||
@@ -79,6 +82,7 @@ function log_out(){
|
||||
}
|
||||
$("#admin-lock").addClass("mdi-action-lock");
|
||||
$("#admin-lock").removeClass("mdi-action-lock-open clickable");
|
||||
document.getElementById("password").value = "";
|
||||
Materialize.toast("Logged out", 4000);
|
||||
}else{
|
||||
Materialize.toast("Not logged in", 4000);
|
||||
|
||||
4
static/js/lib/jquery-2.1.3.min.js
vendored
Normal file
4
static/js/lib/jquery-2.1.3.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
12
static/js/lib/jquery-ui-1.10.3.min.js
vendored
Normal file
12
static/js/lib/jquery-ui-1.10.3.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -70,8 +70,9 @@ $(document).ready(function()
|
||||
{
|
||||
$.each(response.data.items, function(i,data)
|
||||
{
|
||||
submit(data.video.id, data.video.title, true, data.video.duration);
|
||||
submit(data.video.id, data.video.title, data.video.duration);
|
||||
});
|
||||
document.getElementById("search").value = "";
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -136,7 +137,7 @@ function search(search_input){
|
||||
//response= x
|
||||
var yt_url = "https://www.googleapis.com/youtube/v3/search?key=***REMOVED***&videoEmbeddable=true&part=id&fields=items(id)&type=video&order=viewCount&safeSearch=none&maxResults=25";
|
||||
yt_url+="&q="+keyword;
|
||||
if(music)yt_url+="&videoCategoryId=25";
|
||||
if(music)yt_url+="&videoCategoryId=10";
|
||||
|
||||
var vid_url = "https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key=***REMOVED***&id=";
|
||||
|
||||
@@ -174,10 +175,17 @@ function search(search_input){
|
||||
song.find(".search-title").text(title);
|
||||
song.find(".result_info").text(duration);
|
||||
song.find(".thumb").attr("src", thumb);
|
||||
song.find(".add-many").attr("onclick", "submit('"+id+"','"+enc_title+"',"+secs+");");
|
||||
song.attr("onclick", "submitAndClose('"+id+"','"+enc_title+"',"+secs+");");
|
||||
song.attr("id",id);
|
||||
}
|
||||
});
|
||||
|
||||
$(".add-many").click(function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -193,23 +201,19 @@ function search(search_input){
|
||||
}
|
||||
|
||||
function submitAndClose(id,title,duration){
|
||||
submit(id,title, true, duration);
|
||||
submit(id,title, duration);
|
||||
$("#results").html('');
|
||||
showSearch();
|
||||
console.log("sub&closed");
|
||||
|
||||
document.getElementById("search").value = "";
|
||||
$("#results").html = "";
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
}
|
||||
|
||||
function submit(id,title,type, duration){
|
||||
|
||||
function submit(id,title,duration){
|
||||
socket.emit("add", [id, decodeURIComponent(title), adminpass, duration]);
|
||||
if(type){
|
||||
document.getElementById("search").value = "";
|
||||
$("#results").html = "";
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
}
|
||||
}
|
||||
|
||||
function durationToSeconds(duration) {
|
||||
|
||||
Reference in New Issue
Block a user