mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Trying out incapsulation
This commit is contained in:
10
index.php
10
index.php
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
|
||||
<ul class="title-container">
|
||||
<li class="song-title truncate" id="song-title" onclick="showSearch();">
|
||||
<li class="song-title truncate" id="song-title">
|
||||
Loading...
|
||||
</li>
|
||||
<li class="search-container hide" id="search-wrapper">
|
||||
@@ -81,19 +81,19 @@
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a class="nav-btn" href="#find" id="search-btn" onclick="showSearch();">
|
||||
<a class="nav-btn" href="#find" id="search-btn">
|
||||
<i class="mdi-action-search"></i>
|
||||
<span class="hover-text">Find</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="nav-btn" href="#skip" id="skip" onclick="skip();">
|
||||
<a class="nav-btn" href="#skip" id="skip">
|
||||
<i class="mdi-av-skip-next"></i>
|
||||
<span class="hover-text">Skip</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="nav-btn hide-on-small-only" href="#stir" id="shuffle" onclick="shuffle();">
|
||||
<a class="nav-btn hide-on-small-only" href="#stir" id="shuffle">
|
||||
<i class="mdi-av-shuffle"></i>
|
||||
<span class="hover-text">Stir</span>
|
||||
</a>
|
||||
@@ -161,7 +161,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li id="chat-input">
|
||||
<form action="#" onsubmit="chat(this.input);return false;">
|
||||
<form action="#" id="chatForm" onsubmit="return false;">
|
||||
<input id="text-chat-input" name="input" type="text" autocomplete="off" placeholder="Chat" maxlength="150" />
|
||||
</form>
|
||||
</li>
|
||||
|
||||
@@ -66,20 +66,13 @@
|
||||
<script type="text/javascript" src="https://cdn.socket.io/socket.io-1.3.5.js"></script>
|
||||
<!--<script type="text/javascript" src="/static/js/lib/iscroll-min.js"></script>-->
|
||||
<script type="text/javascript" src="https://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js"></script>
|
||||
<script>
|
||||
var socket = io.connect('//'+window.location.hostname+':3000');
|
||||
var guid = "<?php echo $guid; ?>";
|
||||
socket.on("get_list", function(){
|
||||
socket.emit('list', '<?php echo $list; ?>,'+guid);
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="/static/js/list.js"></script>
|
||||
<script type="text/javascript" src="/static/js/zoff.js"></script>
|
||||
<!--<script type="text/javascript" src="/static/js/list.js"></script>
|
||||
<script type="text/javascript" src="/static/js/searchlist.js"></script>
|
||||
<script type="text/javascript" src="/static/js/playercontrols.js"></script>
|
||||
<script type="text/javascript" src="/static/js/youtube.js"></script>
|
||||
<script type="text/javascript" src="/static/js/search.js"></script>
|
||||
<script type="text/javascript" src="/static/js/admin.js"></script>
|
||||
<script type="text/javascript" src="/static/js/chat.js"></script>
|
||||
<script type="text/javascript" src="/static/js/hostcontroller.js"></script>
|
||||
<script type="text/javascript" src="/static/js/hostcontroller.js"></script>-->
|
||||
<!--<script type="text/javascript" src="/static/js/remotecontroller.js"></script>-->
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
<a class="col s9 collapsible-header bold waves-effect admin-settings">
|
||||
Channel Settings
|
||||
<i class="mdi-image-tune"></i>
|
||||
<div class="nav-btn close-settings clickable" title="Close" onclick="hide_settings();">
|
||||
<div class="nav-btn close-settings clickable" title="Close" id="closeSettings">
|
||||
<i class="mdi-navigation-close auto-margin"></i>
|
||||
</div>
|
||||
</a>
|
||||
<div class="collapsible-body">
|
||||
<form action="#" id="adminForm" onsubmit="pass_save();return false;">
|
||||
<form action="#" id="adminForm" onsubmit="return false;">
|
||||
<ul>
|
||||
<li class="white-bg">
|
||||
<div class="input-field field-settings">
|
||||
<i id="admin-lock" class="mdi-action-lock" onclick="log_out()" title="Click to log out"></i>
|
||||
<i id="admin-lock" class="mdi-action-lock" title="Click to log out"></i>
|
||||
<input placeholder="Enter channel password" id="password" type="password" class="validate" />
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@@ -153,8 +153,7 @@ io.on('connection', function(socket){
|
||||
if(list !== undefined && list !== null && list != "")
|
||||
{
|
||||
in_list = true;
|
||||
list = list.split(',');
|
||||
coll = list[0].toLowerCase();
|
||||
coll = list.toLowerCase();
|
||||
socket.join(coll);
|
||||
socket.join(short_id);
|
||||
socket.emit("id", short_id);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
var began = false;
|
||||
var id
|
||||
var id;
|
||||
|
||||
socket.on("id", function(id)
|
||||
{
|
||||
|
||||
@@ -173,72 +173,71 @@ function search(search_input){
|
||||
success: function(response){
|
||||
if(response.items){
|
||||
//get list of IDs and make new request for video info
|
||||
$.each(response.items, function(i,data)
|
||||
{
|
||||
vid_url += data.id.videoId+",";
|
||||
});
|
||||
console.log("Search for: "+keyword)
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: vid_url,
|
||||
dataType:"jsonp",
|
||||
success: function(response){
|
||||
|
||||
var output = "";
|
||||
var pre_result = $(result_html);
|
||||
|
||||
//$("#results").append(result_html);
|
||||
|
||||
$.each(response.items, function(i,song)
|
||||
$.each(response.items, function(i,data)
|
||||
{
|
||||
var duration=song.contentDetails.duration;
|
||||
secs=durationToSeconds(duration)
|
||||
if(!longsongs || secs<720){
|
||||
title=song.snippet.title;
|
||||
enc_title=encodeURIComponent(title).replace(/'/g, "\\\'");
|
||||
id=song.id;
|
||||
duration = duration.replace("PT","").replace("H","h ").replace("M","m ").replace("S","s")
|
||||
thumb=song.snippet.thumbnails.medium.url;
|
||||
vid_url += data.id.videoId+",";
|
||||
});
|
||||
console.log("Search for: "+keyword)
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: vid_url,
|
||||
dataType:"jsonp",
|
||||
success: function(response){
|
||||
|
||||
var output = "";
|
||||
var pre_result = $(result_html);
|
||||
|
||||
//$("#results").append(result_html);
|
||||
var songs = pre_result;
|
||||
|
||||
songs.find(".search-title").text(title);
|
||||
songs.find(".result_info").text(duration);
|
||||
songs.find(".thumb").attr("src", thumb);
|
||||
songs.find(".add-many").attr("onclick", "submit('"+id+"','"+enc_title+"',"+secs+");");
|
||||
$($(songs).find("div")[0]).attr("onclick", "submitAndClose('"+id+"','"+enc_title+"',"+secs+");");
|
||||
$($(songs).find("div")[0]).attr("id", id)
|
||||
output += songs.html();
|
||||
$.each(response.items, function(i,song)
|
||||
{
|
||||
var duration=song.contentDetails.duration;
|
||||
secs=durationToSeconds(duration)
|
||||
if(!longsongs || secs<720){
|
||||
title=song.snippet.title;
|
||||
enc_title=encodeURIComponent(title).replace(/'/g, "\\\'");
|
||||
id=song.id;
|
||||
duration = duration.replace("PT","").replace("H","h ").replace("M","m ").replace("S","s")
|
||||
thumb=song.snippet.thumbnails.medium.url;
|
||||
|
||||
//$("#results").append(result_html);
|
||||
var songs = pre_result;
|
||||
|
||||
songs.find(".search-title").text(title);
|
||||
songs.find(".result_info").text(duration);
|
||||
songs.find(".thumb").attr("src", thumb);
|
||||
songs.find(".add-many").attr("onclick", "submit('"+id+"','"+enc_title+"',"+secs+");");
|
||||
$($(songs).find("div")[0]).attr("onclick", "submitAndClose('"+id+"','"+enc_title+"',"+secs+");");
|
||||
$($(songs).find("div")[0]).attr("id", id)
|
||||
output += songs.html();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
console.log(response.items.length);
|
||||
|
||||
$("<div style='display:none;' id='mock-div'>"+output+"</div>").appendTo($("#results")).show("blind", (response.items.length-1) * 83.33);
|
||||
|
||||
if(!contains($("#search_loader").attr("class").split(" "), "hide"))
|
||||
$("#search_loader").addClass("hide");
|
||||
|
||||
$(".add-many").click(function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
console.log(response.items.length);
|
||||
|
||||
$("<div style='display:none;' id='mock-div'>"+output+"</div>").appendTo($("#results")).show("blind", (response.items.length-1) * 83.33);
|
||||
|
||||
if(!contains($("#search_loader").attr("class").split(" "), "hide"))
|
||||
$("#search_loader").addClass("hide");
|
||||
|
||||
$(".add-many").click(function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
}
|
||||
}
|
||||
|
||||
function submitAndClose(id,title,duration){
|
||||
|
||||
Reference in New Issue
Block a user