mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
v3 search, some admin fixes, footer fix
This commit is contained in:
@@ -23,12 +23,12 @@
|
|||||||
</a>
|
</a>
|
||||||
<p>
|
<p>
|
||||||
<a class="waves-effect waves-light btn light-blue share shareface" href="https://www.facebook.com/sharer/sharer.php?u=http://zoff.no/<?php echo $list; ?>" target="popup" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=http://zoff.no/<?php echo $list; ?>','Share Playlist','width=600,height=300')">
|
<a class="waves-effect waves-light btn light-blue share shareface" href="https://www.facebook.com/sharer/sharer.php?u=http://zoff.no/<?php echo $list; ?>" target="popup" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=http://zoff.no/<?php echo $list; ?>','Share Playlist','width=600,height=300')">
|
||||||
<img class="left" src="static/images/facebook.png">Share on Facebook
|
<img class="left" src="static/images/facebook.png">Share on Facebook
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a class="waves-effect waves-light btn light-blue share" href="http://twitter.com/intent/tweet?url=http://zoff.no/<?php echo $list; ?>&text=Check out this playlist <?php echo ucfirst($list); ?> on Zöff!&via=zoffmusic" target="popup" onclick="window.open('http://twitter.com/intent/tweet?url=http://zoff.no/<?php echo $list; ?>&text=Check out this playlist <?php echo ucfirst($list); ?> on Zöff!&via=zoffmusic','Share Playlist','width=600,height=300')">
|
<a class="waves-effect waves-light btn light-blue share" href="http://twitter.com/intent/tweet?url=http://zoff.no/<?php echo $list; ?>&text=Check out this playlist <?php echo ucfirst($list); ?> on Zöff!&via=zoffmusic" target="popup" onclick="window.open('http://twitter.com/intent/tweet?url=http://zoff.no/<?php echo $list; ?>&text=Check out this playlist <?php echo ucfirst($list); ?> on Zöff!&via=zoffmusic','Share Playlist','width=600,height=300')">
|
||||||
<img class="left" src="static/images/twitter.png">Share on Twitter
|
<img class="left" src="static/images/twitter.png">Share on Twitter</span>
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ socket.on("pw", function(msg)
|
|||||||
refresh_scroll();
|
refresh_scroll();
|
||||||
|
|
||||||
localStorage.setItem(chan.toLowerCase(), msg);
|
localStorage.setItem(chan.toLowerCase(), msg);
|
||||||
Materialize.toast("Correct password. You now have access to the sacred relam of The Admin.", 4000);
|
Materialize.toast("Correct password. You now have access to the sacred realm of The Admin.", 4000);
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on(chan.toLowerCase()+",conf", function(msg)
|
socket.on(chan.toLowerCase()+",conf", function(msg)
|
||||||
|
|||||||
@@ -125,59 +125,44 @@ function search(search_input){
|
|||||||
if(search_input !== ""){
|
if(search_input !== ""){
|
||||||
var keyword= encodeURIComponent(search_input);
|
var keyword= encodeURIComponent(search_input);
|
||||||
|
|
||||||
//response= http://nixo.no/txt/?4574f9b9dd286e0d#X+kzTvyFv5IrdkGQtqmoquhekDRCPJX9N24PSn86CFE=
|
//response= x
|
||||||
//var yt_url = "https://www.googleapis.com/youtube/v3/search?videoEmbeddable=true&part=snippet&q=thefatrat&fields=items(id%2Csnippet)&type=video&videoDuration=medium&videoCategoryId=15&key=AIzaSyC3hq93zqwdwcjO8HyD9oToLLFotoAjyWo";
|
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";
|
||||||
var yt_url='http://gdata.youtube.com/feeds/api/videos?q='+keyword+'&format=5&orderby=relevance&max-results=30&v=2&alt=jsonc';
|
yt_url+="&q="+keyword;
|
||||||
|
if(music)yt_url+="&videoCategoryId=25";
|
||||||
|
|
||||||
|
var vid_url = "https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key=***REMOVED***&id=";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: yt_url,
|
url: yt_url,
|
||||||
dataType:"jsonp",
|
dataType:"jsonp",
|
||||||
success: function(response)
|
success: function(response){
|
||||||
|
if(response.items){
|
||||||
|
//get list of IDs and make new request for video info
|
||||||
|
$.each(response.items, function(i,data)
|
||||||
{
|
{
|
||||||
if(response.data.items)
|
vid_url += data.id.videoId+",";
|
||||||
{
|
|
||||||
var wrapper = "";
|
|
||||||
z = 0;
|
|
||||||
$.each(response.data.items, function(i,data)
|
|
||||||
{
|
|
||||||
if(data.duration > 720 && longsongs == true){return;}
|
|
||||||
if(data.category == "Music" || music == false){
|
|
||||||
var video_title=encodeURIComponent(data.title).replace(/'/g, "\\\'");
|
|
||||||
var views=data.viewCount;
|
|
||||||
var video_thumb = "http://i.ytimg.com/vi/"+data.id+"/default.jpg";
|
|
||||||
var length = Math.floor(data.duration/60)+":"+(data.duration-Math.floor(data.duration / 60)*60);
|
|
||||||
var finalhtml="\
|
|
||||||
<div id='result' class='result' onclick=\"submitAndClose('"+data.id+"','"+video_title+"', "+data.duration+");\">\
|
|
||||||
<img src='"+video_thumb+"' class='thumb'>\
|
|
||||||
<div id='title'>"+data.title+"\
|
|
||||||
<div class='result_info'>"+views+" views • "+length+"</div>\
|
|
||||||
</div>\
|
|
||||||
</div>";
|
|
||||||
//<input id='add' title='Add several songs' type='button' class='button' value='+' onclick=\"submit('"+data.id+"','"+video_title+"', false);\">\
|
|
||||||
//+data.uploader+" • "+
|
|
||||||
//$("#results").append(finalhtml);
|
|
||||||
wrapper += finalhtml;
|
|
||||||
z++;
|
|
||||||
}
|
|
||||||
return (z !== 6);
|
|
||||||
});
|
});
|
||||||
//console.log(wrapper);
|
console.log(vid_url)
|
||||||
//$("#results").append(wrapper).show("slow");
|
|
||||||
if(wrapper.length > 0)
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: vid_url,
|
||||||
|
dataType:"jsonp",
|
||||||
|
success: function(response){
|
||||||
|
$.each(response.items, function(i,song)
|
||||||
{
|
{
|
||||||
$(".main").addClass("blurT");
|
var title=song.snippet.title;
|
||||||
$("#controls").addClass("blurT");
|
id=song.id;
|
||||||
$(".main").addClass("clickthrough");
|
duration=song.contentDetails.duration;
|
||||||
}
|
viewers=
|
||||||
|
|
||||||
$("<div id='r' style='display:none;'>"+wrapper+"</div>").appendTo('#results').slideDown('slow');
|
|
||||||
|
|
||||||
}
|
|
||||||
else{ $("#video").html("<div id='no'>No Video</div>");}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$(".main").removeClass("blurT");
|
$(".main").removeClass("blurT");
|
||||||
$("#controls").removeClass("blurT");
|
$("#controls").removeClass("blurT");
|
||||||
|
|||||||
Reference in New Issue
Block a user