mirror of
https://github.com/KevinMidboe/zoff.git
synced 2026-01-04 08:35:34 +00:00
merge
This commit is contained in:
2368
static/css/materialize.css
vendored
Executable file → Normal file
2368
static/css/materialize.css
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
16
static/css/materialize.min.css
vendored
Executable file → Normal file
16
static/css/materialize.min.css
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
@@ -10,6 +10,10 @@
|
||||
|
||||
/* GLOBAL STYLES */
|
||||
|
||||
#toast-container{
|
||||
left:2% !important;
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track
|
||||
{
|
||||
@@ -29,7 +33,18 @@
|
||||
border-radius:0px;
|
||||
}
|
||||
|
||||
.noselect {
|
||||
-webkit-touch-callout: none;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.rounded{
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
@@ -178,6 +193,7 @@ display: inline;
|
||||
|
||||
.card .card-content {
|
||||
padding: 10px 20px;
|
||||
color: rgba(0, 0, 0, 0.870588);
|
||||
}
|
||||
|
||||
.card .card-action {
|
||||
@@ -331,8 +347,13 @@ hide mdi-action-visibility mdi-action-visibility-off
|
||||
|
||||
/*------------------- Channel page ---------------------------------------------------------------------------- */
|
||||
|
||||
#description, #desc-title{
|
||||
color:#444;
|
||||
}
|
||||
|
||||
#main-row{
|
||||
margin-bottom:-64px;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 993px){
|
||||
@@ -352,6 +373,16 @@ hide mdi-action-visibility mdi-action-visibility-off
|
||||
display:none;
|
||||
}
|
||||
|
||||
#empty-results {
|
||||
text-align:center;
|
||||
height:100px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#empty-results span {
|
||||
margin:auto;
|
||||
}
|
||||
|
||||
#donate_form a {
|
||||
padding-right:10px;
|
||||
}
|
||||
@@ -372,6 +403,7 @@ hide mdi-action-visibility mdi-action-visibility-off
|
||||
|
||||
#channelchat, #all_chat{
|
||||
height: calc(100vh - 193px);
|
||||
margin: 0px 5px;
|
||||
}
|
||||
|
||||
#chatchannel, #chatall {
|
||||
@@ -467,8 +499,9 @@ ul #chat-log{
|
||||
margin: 0px;
|
||||
padding:0px;
|
||||
}
|
||||
#nav{
|
||||
background-color:rgba(255,255,255, 0.1);
|
||||
|
||||
#nav {
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.control-list{
|
||||
@@ -517,6 +550,7 @@ ul #chat-log{
|
||||
}
|
||||
#playlist{
|
||||
/*padding:0px 15px;*/
|
||||
flex:1;
|
||||
}
|
||||
|
||||
#player{
|
||||
@@ -536,10 +570,14 @@ ul #chat-log{
|
||||
min-width: 64px;
|
||||
float:right;
|
||||
}
|
||||
.nav-btn:hover{background-color:rgb(0,0,0);}
|
||||
.nav-btn:hover{background-color:rgba(0,0,0,0.6);}
|
||||
.hover-text{display:none;}
|
||||
.nav-btn:hover > .hover-text {display:inline;}
|
||||
|
||||
nav ul li:hover, nav ul li.active {
|
||||
background-color: rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
.list-image{
|
||||
width: 34%;
|
||||
height: 66px;
|
||||
@@ -555,7 +593,7 @@ ul #chat-log{
|
||||
text-transform: none;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
content: "\e684";/*"\e800";*/
|
||||
content: "\e686";/*"\e800";*/
|
||||
color:white;
|
||||
font-size:65px;
|
||||
position:absolute;
|
||||
@@ -572,6 +610,7 @@ ul #chat-log{
|
||||
.vote-span{
|
||||
opacity: 0.7;
|
||||
padding: 0 0 0 10px;
|
||||
color:white !important;
|
||||
}
|
||||
|
||||
.list-song{
|
||||
@@ -593,7 +632,12 @@ ul #chat-log{
|
||||
line-height: 2.6rem;
|
||||
}
|
||||
.card-image{cursor:pointer}
|
||||
.card{margin:5px 0 5px 0 !important;}
|
||||
.card{
|
||||
margin:5px 0 5px 0 !important;
|
||||
}
|
||||
.card:hover{
|
||||
box-shadow: 0 5px 5px 0 rgba(0,0,0,0.16), 0 5px 10px 0 rgba(0,0,0,0.12);
|
||||
}
|
||||
.result img{
|
||||
float:left;
|
||||
height: 70px;
|
||||
@@ -615,9 +659,10 @@ ul #chat-log{
|
||||
max-height: 600px;
|
||||
overflow: overlay;
|
||||
}
|
||||
.result:hover {
|
||||
.result:hover, .hoverResults {
|
||||
background-color: rgba(0,0,0,0.4);
|
||||
}
|
||||
|
||||
.search-title{
|
||||
height: 40px;
|
||||
}
|
||||
@@ -772,7 +817,8 @@ ul #chat-log{
|
||||
margin: 13px auto;
|
||||
height:5px;
|
||||
width: 75px;
|
||||
background-color:rgba(0, 0, 0, 0.5);
|
||||
/*background-color:rgba(0, 0, 0, 0.5);*/
|
||||
background:rgba(0, 0, 0, 0.5) 50% 50% repeat-x;
|
||||
border: none;
|
||||
outline: none;
|
||||
/*border-radius: 2px;*/
|
||||
@@ -791,13 +837,14 @@ ul #chat-log{
|
||||
#volume .ui-slider-handle {
|
||||
height:15px;
|
||||
width:5px;
|
||||
background-color:white;
|
||||
background:#fff 50% 50% repeat-x;
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
border: none;
|
||||
/*display: none;*/
|
||||
margin-left:-2.5px;
|
||||
margin-top:0px;
|
||||
}
|
||||
|
||||
.ui-slider-handle
|
||||
@@ -985,7 +1032,7 @@ ul #chat-log{
|
||||
margin: 13px auto;
|
||||
height:5px;
|
||||
width: 97%;
|
||||
background-color:rgba(0, 0, 0, 0.5);
|
||||
background:rgba(0, 0, 0, 0.5);
|
||||
border: none;
|
||||
outline: none;
|
||||
border-radius: 2px;
|
||||
@@ -995,7 +1042,7 @@ ul #chat-log{
|
||||
height:5px;
|
||||
width: 75px;
|
||||
position: absolute;
|
||||
background-color:rgba(47, 47, 47, 1);
|
||||
background:rgba(47, 47, 47, 1);
|
||||
border: none;
|
||||
outline: none;
|
||||
border-radius: 2px;
|
||||
@@ -1004,13 +1051,14 @@ ul #chat-log{
|
||||
#volume-control .ui-slider-handle {
|
||||
height: 15px;
|
||||
width: 36px;
|
||||
background-color: rgb(255, 44, 44);
|
||||
background: rgb(255, 44, 44);
|
||||
position: absolute;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
border: none;
|
||||
border-radius: 17px;
|
||||
margin-left: -17px;
|
||||
margin-top:0px;
|
||||
}
|
||||
|
||||
.slider-vol{
|
||||
|
||||
2
static/dist/frontpage.min.js
vendored
2
static/dist/frontpage.min.js
vendored
@@ -1 +1 @@
|
||||
!function(){var e,t,o={populate_channels:function(t){var n="",a=0;t.sort(o.sortFunction),pre_card=$(e);for(x in t){var i=t[x][3];if(20>a){var s=t[x][1],l=t[x][0],r="background-image:url('https://img.youtube.com/vi/"+s+"/hqdefault.jpg');",c=t[x][4],d=pre_card;d.find(".chan-name").text(i),d.find(".chan-name").attr("title",i),d.find(".chan-views").text(l),d.find(".chan-songs").text(c),d.find(".chan-bg").attr("style",r),d.find(".chan-link").attr("href",i),$("#channels").append(d.html())}n+="<option value='"+i+"'> ",a++}document.getElementById("preloader").style.display="none",document.getElementById("searches").innerHTML=n,$("#channels").fadeIn(800),$("#search").focus()},sortFunction:function(e,t){var o=e[0],n=t[0],a=e[4],i=t[4];return n>o?1:o>n?-1:i>a?1:a>i?-1:0},getCookie:function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var a=o[n];" "==a.charAt(0);)a=a.substring(1);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return""}};String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},$(document).ready(function(){e=$("#channel-list-container").html(),window.list_html=e,$("#channels").empty();var n=io.connect("//"+window.location.hostname+":3000");n.emit("frontpage_lists"),n.on("playlists",function(e){o.populate_channels(e)});var a=0;if(document.getElementById("zicon").addEventListener("click",function(){a+=10,document.getElementById("zicon").style.paddingLeft=a+"%",a>=100&&(window.location.href="https://www.youtube.com/v/0IGsNdVoEh0?autoplay=1&showinfo=0&autohide=1")}),navigator.userAgent.toLowerCase().indexOf("android")>-1&&""==o.getCookie("show_prompt")){var i=confirm("Do you want to download the native app for this webpage?");if(i)window.location.href="https://play.google.com/store/apps/details?id=no.lqasse.zoff";else{var s=new Date;s.setTime(s.getTime()+864e6);var l="expires="+s.toUTCString();document.cookie="show_prompt=false;"+l}}t=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,t=$.parseJSON(t),$("#latest-commit").html("Latest Commit: <br>"+t[0].commit.author.date.substring(0,10)+": "+t[0].committer.login+"<br><a href='"+t[0].html_url+"'>"+t[0].sha.substring(0,10)+"</a>: "+t[0].commit.message+"<br")})}();
|
||||
!function(){var e,t,o={populate_channels:function(t){var n="",a=0;t.sort(o.sortFunction),pre_card=$(e);for(x in t){var i=t[x][3];if(20>a){var s=t[x][1],l=t[x][0],r="background-image:url('https://img.youtube.com/vi/"+s+"/hqdefault.jpg');",c=t[x][4],d=pre_card;d.find(".chan-name").text(i),d.find(".chan-name").attr("title",i),d.find(".chan-views").text(l),d.find(".chan-songs").text(c),d.find(".chan-bg").attr("style",r),d.find(".chan-link").attr("href",i),$("#channels").append(d.html())}n+="<option value='"+i+"'> ",a++}document.getElementById("preloader").style.display="none",document.getElementById("searches").innerHTML=n,$("#channels").fadeIn(800),$("#search").focus()},sortFunction:function(e,t){var o=e[0],n=t[0],a=e[4],i=t[4];return n>o?1:o>n?-1:i>a?1:a>i?-1:0},getCookie:function(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var a=o[n];" "==a.charAt(0);)a=a.substring(1);if(0==a.indexOf(t))return a.substring(t.length,a.length)}return""}};String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},$(document).ready(function(){"#donation"==window.location.hash&&$("#donation").openModal(),e=$("#channel-list-container").html(),window.list_html=e,$("#channels").empty();var n=io.connect("//"+window.location.hostname+":8880");n.emit("frontpage_lists"),n.on("playlists",function(e){o.populate_channels(e)});var a=0;if(document.getElementById("zicon").addEventListener("click",function(){a+=10,document.getElementById("zicon").style.paddingLeft=a+"%",a>=100&&(window.location.href="https://www.youtube.com/v/0IGsNdVoEh0?autoplay=1&showinfo=0&autohide=1")}),navigator.userAgent.toLowerCase().indexOf("android")>-1&&""==o.getCookie("show_prompt")){var i=confirm("Do you want to download the native app for this webpage?");if(i)window.location.href="https://play.google.com/store/apps/details?id=no.lqasse.zoff";else{var s=new Date;s.setTime(s.getTime()+864e6);var l="expires="+s.toUTCString();document.cookie="show_prompt=false;"+l}}t=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,t=$.parseJSON(t),$("#latest-commit").html("Latest Commit: <br>"+t[0].commit.author.date.substring(0,10)+": "+t[0].committer.login+"<br><a href='"+t[0].html_url+"'>"+t[0].sha.substring(0,10)+"</a>: "+t[0].commit.message+"<br")})}();
|
||||
997
static/dist/lib/materialize.js
vendored
Executable file → Normal file
997
static/dist/lib/materialize.js
vendored
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
8
static/dist/lib/materialize.min.js
vendored
Executable file → Normal file
8
static/dist/lib/materialize.min.js
vendored
Executable file → Normal file
File diff suppressed because one or more lines are too long
3
static/dist/main.min.js
vendored
3
static/dist/main.min.js
vendored
File diff suppressed because one or more lines are too long
2
static/dist/remote.min.js
vendored
2
static/dist/remote.min.js
vendored
@@ -1 +1 @@
|
||||
!function(){var e,t=!0;$(document).ready(function(){document.title="Zöff Remote",setTimeout(function(){$("#search").focus()},500),socket=io.connect("//"+window.location.hostname+":3000"),e=window.location.pathname.split("/")[2],e&&(e=e.toLowerCase(),o.control())}),$("#playbutton").on("click",function(){socket.emit("id",[e,"play","mock"])}),$("#pausebutton").on("click",function(){socket.emit("id",[e,"pause","mock"])}),$("#skipbutton").on("click",function(){socket.emit("id",[e,"skip","mock"])}),$("#remoteform").on("submit",function(){t?window.location.href="/remote/"+document.getElementById("remoteform").chan.value:o.control()});var o={control:function(){t?(e||(e=$("#code-input").val().toLowerCase()),$("#code-input").val(""),t=!1,$(".rc").css("display","block"),$("#remote-text").text("Controlling "+e.toUpperCase()),document.getElementById("search").setAttribute("length","18"),document.getElementById("search").setAttribute("maxlength","18"),$("#forsearch").html("Type new channel name to change to"),$("#volume-control").slider({min:0,max:100,value:100,range:"min",animate:!0,stop:function(t,o){socket.emit("id",[e,"volume",o.value]),console.log("volume")}})):(socket.emit("id",[e,"channel",$("#search").val().toLowerCase()]),$("#search").val(""))}}}();
|
||||
!function(){function e(){chrome.webstore.install("",o,t)}function t(e){console.log(e)}function o(){console.log("Successfully installed")}var i=!0;window.mobilecheck=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},$(document).ready(function(){document.title="Zöff Remote",setTimeout(function(){$("#search").focus()},500),socket=io.connect("//"+window.location.hostname+":8880"),id=window.location.pathname.split("/")[2],id&&(id=id.toLowerCase(),n.control()),git_info=$.ajax({type:"GET",url:"https://api.github.com/repos/zoff-music/zoff/commits",async:!1}).responseText,git_info=$.parseJSON(git_info),$("#latest-commit").html("Latest Commit: <br>"+git_info[0].commit.author.date.substring(0,10)+": "+git_info[0].committer.login+"<br><a href='"+git_info[0].html_url+"'>"+git_info[0].sha.substring(0,10)+"</a>: "+git_info[0].commit.message+"<br");var i=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;setTimeout(function(){!i||document.getElementById("extension-is-installed")||window.mobilecheck()||Materialize.toast("<a href='#' onclick='installRemote();' style='pointer-events:all;color:white;'>Install the extension!</a>",1e5)},5),window.installRemote=e,window.failed=t,window.success=o}),$("#playbutton").on("click",function(){socket.emit("id",[id,"play","mock"])}),$("#pausebutton").on("click",function(){socket.emit("id",[id,"pause","mock"])}),$("#skipbutton").on("click",function(){socket.emit("id",[id,"skip","mock"])}),$("#remoteform").on("submit",function(){n.control()});var n={control:function(){i?(id||(id=document.getElementById("remoteform").chan.value,window.history.pushState("object or string","Title","/remote/"+id)),document.getElementById("remoteform").chan.value="",i=!1,$(".rc").css("display","block"),$("#remote-text").text("Controlling "+id.toUpperCase()),document.getElementById("search").setAttribute("length","18"),document.getElementById("search").setAttribute("maxlength","18"),$("#forsearch").html("Type new channel name to change to"),$("#volume-control").slider({min:0,max:100,value:100,range:"min",animate:!0,stop:function(e,t){socket.emit("id",[id,"volume",t.value]),console.log("volume")}})):(socket.emit("id",[id,"channel",$("#search").val().toLowerCase()]),$("#search").val(""))}}}();
|
||||
0
static/font/material-design-icons/LICENSE.txt
Executable file → Normal file
0
static/font/material-design-icons/LICENSE.txt
Executable file → Normal file
BIN
static/font/material-design-icons/Material-Design-Icons.eot
Executable file → Normal file
BIN
static/font/material-design-icons/Material-Design-Icons.eot
Executable file → Normal file
Binary file not shown.
1502
static/font/material-design-icons/Material-Design-Icons.svg
Executable file → Normal file
1502
static/font/material-design-icons/Material-Design-Icons.svg
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
|
Before Width: | Height: | Size: 322 KiB After Width: | Height: | Size: 322 KiB |
BIN
static/font/material-design-icons/Material-Design-Icons.ttf
Executable file → Normal file
BIN
static/font/material-design-icons/Material-Design-Icons.ttf
Executable file → Normal file
Binary file not shown.
BIN
static/font/material-design-icons/Material-Design-Icons.woff
Executable file → Normal file
BIN
static/font/material-design-icons/Material-Design-Icons.woff
Executable file → Normal file
Binary file not shown.
BIN
static/font/material-design-icons/Material-Design-Icons.woff2
Executable file → Normal file
BIN
static/font/material-design-icons/Material-Design-Icons.woff2
Executable file → Normal file
Binary file not shown.
0
static/font/roboto/Roboto-Bold.ttf
Executable file → Normal file
0
static/font/roboto/Roboto-Bold.ttf
Executable file → Normal file
0
static/font/roboto/Roboto-Bold.woff
Executable file → Normal file
0
static/font/roboto/Roboto-Bold.woff
Executable file → Normal file
0
static/font/roboto/Roboto-Bold.woff2
Executable file → Normal file
0
static/font/roboto/Roboto-Bold.woff2
Executable file → Normal file
0
static/font/roboto/Roboto-Light.ttf
Executable file → Normal file
0
static/font/roboto/Roboto-Light.ttf
Executable file → Normal file
0
static/font/roboto/Roboto-Light.woff
Executable file → Normal file
0
static/font/roboto/Roboto-Light.woff
Executable file → Normal file
0
static/font/roboto/Roboto-Light.woff2
Executable file → Normal file
0
static/font/roboto/Roboto-Light.woff2
Executable file → Normal file
0
static/font/roboto/Roboto-Medium.ttf
Executable file → Normal file
0
static/font/roboto/Roboto-Medium.ttf
Executable file → Normal file
0
static/font/roboto/Roboto-Medium.woff
Executable file → Normal file
0
static/font/roboto/Roboto-Medium.woff
Executable file → Normal file
0
static/font/roboto/Roboto-Medium.woff2
Executable file → Normal file
0
static/font/roboto/Roboto-Medium.woff2
Executable file → Normal file
0
static/font/roboto/Roboto-Regular.ttf
Executable file → Normal file
0
static/font/roboto/Roboto-Regular.ttf
Executable file → Normal file
0
static/font/roboto/Roboto-Regular.woff
Executable file → Normal file
0
static/font/roboto/Roboto-Regular.woff
Executable file → Normal file
0
static/font/roboto/Roboto-Regular.woff2
Executable file → Normal file
0
static/font/roboto/Roboto-Regular.woff2
Executable file → Normal file
0
static/font/roboto/Roboto-Thin.ttf
Executable file → Normal file
0
static/font/roboto/Roboto-Thin.ttf
Executable file → Normal file
0
static/font/roboto/Roboto-Thin.woff
Executable file → Normal file
0
static/font/roboto/Roboto-Thin.woff
Executable file → Normal file
0
static/font/roboto/Roboto-Thin.woff2
Executable file → Normal file
0
static/font/roboto/Roboto-Thin.woff2
Executable file → Normal file
@@ -59,23 +59,25 @@ var Admin = {
|
||||
|
||||
socket.on("pw", function(msg)
|
||||
{
|
||||
console.log("fuck");
|
||||
w_p = false;
|
||||
w_p = false;
|
||||
adminpass = msg;
|
||||
names=["vote","addsongs","longsongs","frontpage", "allvideos", "removeplay", "skip", "shuffle"];
|
||||
names = ["vote","addsongs","longsongs","frontpage", "allvideos",
|
||||
"removeplay", "skip", "shuffle"];
|
||||
|
||||
localStorage.setItem(chan.toLowerCase(), msg);
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
$("input[name="+names[i]+"]").attr("disabled", false);
|
||||
}
|
||||
$(".card-action").removeClass("hide");
|
||||
|
||||
$(".card-action").removeClass("hide");
|
||||
$("#admin-lock").removeClass("mdi-action-lock");
|
||||
if(!Helper.contains($("#admin-lock").attr("class").split(" "), "mdi-action-lock-open"))
|
||||
$("#admin-lock").addClass("mdi-action-lock-open clickable");
|
||||
localStorage.setItem(chan.toLowerCase(), msg);
|
||||
$("#password").val("");
|
||||
$("#password").attr("placeholder", "Change channel password")
|
||||
//Materialize.toast("Correct password. You now have access to the sacred realm of The Admin.", 4000);
|
||||
});
|
||||
|
||||
if(!Helper.contains($("#admin-lock").attr("class").split(" "), "mdi-action-lock-open"))
|
||||
$("#admin-lock").addClass("mdi-action-lock-open clickable");
|
||||
});
|
||||
|
||||
socket.on("conf", function(msg)
|
||||
{
|
||||
@@ -103,18 +105,27 @@ var Admin = {
|
||||
|
||||
display_logged_out: function()
|
||||
{
|
||||
w_p = true;
|
||||
names=["vote","addsongs","longsongs","frontpage", "allvideos", "removeplay", "skip", "shuffle"];
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
$("input[name="+names[i]+"]").attr("disabled", true);
|
||||
w_p = true;
|
||||
adminpass = "";
|
||||
names = ["vote","addsongs","longsongs","frontpage", "allvideos",
|
||||
"removeplay", "skip", "shuffle"];
|
||||
|
||||
document.getElementById("password").value = "";
|
||||
|
||||
for (i = 0; i < names.length; i++) {
|
||||
$("input[name="+names[i]+"]").attr("disabled", true);
|
||||
}
|
||||
if(!Helper.contains($("#admin-lock").attr("class").split(" "), "mdi-action-lock"))
|
||||
|
||||
if(!Helper.contains($("#admin-lock").attr("class").split(" "), "mdi-action-lock")){
|
||||
$("#admin-lock").addClass("mdi-action-lock");
|
||||
$("#admin-lock").removeClass("mdi-action-lock-open clickable");
|
||||
if($(".card-action").length != 0 && !Helper.contains($(".card-action").attr("class").split(" "), "hide"))
|
||||
}
|
||||
|
||||
if($(".card-action").length != 0 &&
|
||||
!Helper.contains($(".card-action").attr("class").split(" "), "hide")){
|
||||
$(".card-action").addClass("hide");
|
||||
adminpass = "";
|
||||
document.getElementById("password").value = "";
|
||||
}
|
||||
|
||||
$("#admin-lock").removeClass("mdi-action-lock-open clickable");
|
||||
$("#password").attr("placeholder", "Enter channel password")
|
||||
},
|
||||
|
||||
@@ -125,45 +136,46 @@ var Admin = {
|
||||
|
||||
set_conf: function(conf_array)
|
||||
{
|
||||
if(conf_array['adminpass'] == "" || !w_p) hasadmin = false;
|
||||
else hasadmin = true;
|
||||
music = conf_array["allvideos"];
|
||||
music = conf_array["allvideos"];
|
||||
longsongs = conf_array["longsongs"];
|
||||
names=["vote","addsongs","longsongs","frontpage", "allvideos", "removeplay", "skip", "shuffle"];
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
names = ["vote","addsongs","longsongs","frontpage", "allvideos",
|
||||
"removeplay", "skip", "shuffle"];
|
||||
|
||||
if(conf_array['adminpass'] == "" || !w_p)
|
||||
hasadmin = false;
|
||||
else hasadmin = true;
|
||||
|
||||
for (var i = 0; i < names.length; i++)
|
||||
{
|
||||
document.getElementsByName(names[i])[0].checked = (conf_array[names[i]] === true);
|
||||
$("input[name="+names[i]+"]").attr("disabled", hasadmin);
|
||||
}
|
||||
if(hasadmin && !localStorage[chan.toLowerCase()])
|
||||
{
|
||||
$("#password").attr("placeholder", "Enter channel password");
|
||||
Admin.display_logged_out();
|
||||
if(!Helper.contains($("#admin-lock").attr("class").split(" "), "mdi-action-lock"))
|
||||
$("#admin-lock").addClass("mdi-action-lock");
|
||||
$("#admin-lock").removeClass("mdi-action-lock-open clickable");
|
||||
}else if(!hasadmin && !localStorage[chan.toLowerCase()])
|
||||
{
|
||||
$("#password").attr("placeholder", "Enter channel password");
|
||||
|
||||
if(!Helper.contains($("#admin-lock").attr("class").split(" "), "mdi-action-lock"))
|
||||
$("#admin-lock").addClass("mdi-action-lock");
|
||||
$("#admin-lock").removeClass("mdi-action-lock-open clickable");
|
||||
if((hasadmin && !localStorage[chan.toLowerCase()])){
|
||||
Admin.display_logged_out();
|
||||
}else if(!hasadmin && !localStorage[chan.toLowerCase()]){
|
||||
$("#password").attr("placeholder", "Create channel password");
|
||||
}
|
||||
|
||||
/*if(conf_array.desc !== undefined)
|
||||
{
|
||||
document.getElementById("description").innerHTML = conf_array.desc;
|
||||
}*/
|
||||
},
|
||||
|
||||
submitAdmin: function(form)
|
||||
{
|
||||
voting = form.vote.checked;
|
||||
addsongs = form.addsongs.checked;
|
||||
longsongs = form.longsongs.checked;
|
||||
frontpage = form.frontpage.checked;
|
||||
allvideos = form.allvideos.checked;
|
||||
voting = form.vote.checked;
|
||||
addsongs = form.addsongs.checked;
|
||||
longsongs = form.longsongs.checked;
|
||||
frontpage = form.frontpage.checked;
|
||||
allvideos = form.allvideos.checked;
|
||||
removeplay = form.removeplay.checked;
|
||||
//adminpass = document.getElementById("password").value;
|
||||
skipping = form.skip.checked;
|
||||
shuffling = form.shuffle.checked;
|
||||
skipping = form.skip.checked;
|
||||
shuffling = form.shuffle.checked;
|
||||
configs = [voting, addsongs, longsongs, frontpage, allvideos,
|
||||
removeplay, adminpass, skipping, shuffling];
|
||||
|
||||
configs = [voting, addsongs, longsongs, frontpage, allvideos, removeplay, adminpass, skipping, shuffling];
|
||||
socket.emit("conf", configs);
|
||||
},
|
||||
|
||||
@@ -171,24 +183,9 @@ var Admin = {
|
||||
$('#settings').sideNav('hide');
|
||||
},
|
||||
|
||||
remove_bar: function()
|
||||
{
|
||||
setTimeout(function(){
|
||||
$("#adminPanel").removeClass("success");
|
||||
$("#adminPanel").removeClass("fadeerror");
|
||||
$("#eBar").removeClass("opacityFull");
|
||||
$("#sBar").removeClass("opacityFull");
|
||||
},1500);
|
||||
},
|
||||
|
||||
shuffle: function()
|
||||
{
|
||||
socket.emit('shuffle', adminpass !== undefined ? adminpass : "");
|
||||
},
|
||||
|
||||
get_wp: function()
|
||||
{
|
||||
return w_p;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -157,6 +157,15 @@ var Helper = {
|
||||
if(l>0.5)l=0.5; //make sure it isnt too light
|
||||
|
||||
return "hsl("+Math.floor(h*360)+", "+Math.floor(s*100)+"%, "+Math.floor(l*100)+"%)";
|
||||
},
|
||||
|
||||
componentToHex: function(c) {
|
||||
var hex = c.toString(16);
|
||||
return hex.length == 1 ? "0" + hex : hex;
|
||||
},
|
||||
|
||||
rgbToHex: function(r, g, b) {
|
||||
return "#" + Helper.componentToHex(r) + Helper.componentToHex(g) + Helper.componentToHex(b);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ var Hostcontroller = {
|
||||
began = false;
|
||||
old_id = id;
|
||||
}
|
||||
var codeURL = "//"+window.location.hostname+"/remote/"+id;
|
||||
var codeURL = "http://"+window.location.hostname+"/remote/"+id;
|
||||
$("#code-text").text(id)
|
||||
$("#code-qr").attr("src", "https://chart.googleapis.com/chart?chs=221x221&cht=qr&choe=UTF-8&chld=L|1&chl="+codeURL);
|
||||
$("#code-link").attr("href", codeURL);
|
||||
|
||||
@@ -9,75 +9,24 @@ var List = {
|
||||
|
||||
channel_function: function(msg)
|
||||
{
|
||||
if(msg[0] == "list")
|
||||
{
|
||||
full_playlist = msg[1];
|
||||
full_playlist.sort(Helper.predicate({
|
||||
name: 'votes',
|
||||
reverse: true
|
||||
}, 'added'));
|
||||
List.populate_list(full_playlist);
|
||||
}else if(msg[0] == "added")
|
||||
{
|
||||
full_playlist.push(msg[1]);
|
||||
full_playlist.sort(Helper.predicate({
|
||||
name: 'votes',
|
||||
reverse: true
|
||||
}, 'added'));
|
||||
|
||||
var index = List.getIndexOfSong(msg[1].id);
|
||||
|
||||
List.insertAtIndex(index, msg[1], true);
|
||||
var test = $("#wrapper").children()[index];
|
||||
setTimeout(function(){
|
||||
$(test).css("height", 66);
|
||||
},5);
|
||||
|
||||
}else if(msg[0] == "deleted")
|
||||
{
|
||||
var to_delete = $("#wrapper").children()[List.getIndexOfSong(msg[1])];
|
||||
to_delete.style.height = 0;
|
||||
setTimeout(function()
|
||||
{
|
||||
$("#"+msg[1]).remove();
|
||||
full_playlist.splice(List.getIndexOfSong(msg[1]), 1);
|
||||
}, 305);
|
||||
document.getElementById('wrapper').scrollTop += 1;
|
||||
document.getElementById('wrapper').scrollTop += -1;
|
||||
}else if(msg[0] == "vote")
|
||||
{
|
||||
var index_of_song = List.getIndexOfSong(msg[1]);
|
||||
var song_voted_on = full_playlist[index_of_song];
|
||||
full_playlist[index_of_song].votes += 1;
|
||||
full_playlist[index_of_song].added = msg[2];
|
||||
full_playlist.sort(Helper.predicate({
|
||||
name: 'votes',
|
||||
reverse: true
|
||||
}, 'added'));
|
||||
$("#"+msg[1]).remove();
|
||||
List.insertAtIndex(List.getIndexOfSong(msg[1]), song_voted_on, false);
|
||||
|
||||
//List.populate_list(full_playlist, false);
|
||||
}else if(msg[0] == "song_change")
|
||||
{
|
||||
|
||||
full_playlist[0].now_playing = true;
|
||||
full_playlist[0].votes = 0;
|
||||
full_playlist[0].guids = [];
|
||||
full_playlist[0].added = msg[1];
|
||||
full_playlist[full_playlist.length-1].now_playing = false;
|
||||
/*full_playlist.sort(predicate({
|
||||
name: 'votes',
|
||||
reverse: true
|
||||
}, 'added'));
|
||||
*/
|
||||
full_playlist.push(full_playlist.shift());
|
||||
$("#wrapper").children()[0].remove();
|
||||
List.insertAtIndex($("#wrapper").children().length, full_playlist[full_playlist.length-2], false);
|
||||
document.getElementById('wrapper').scrollTop += 1;
|
||||
document.getElementById('wrapper').scrollTop += -1;
|
||||
//populate_list(full_playlist);
|
||||
}
|
||||
switch(msg[0])
|
||||
{
|
||||
case "list":
|
||||
List.populate_list(msg[1]);
|
||||
break;
|
||||
case "added":
|
||||
List.added_song(msg[1]);
|
||||
break;
|
||||
case "deleted":
|
||||
List.deleted_song(msg[1]);
|
||||
break;
|
||||
case "vote":
|
||||
List.voted_song(msg[1], msg[2]);
|
||||
break;
|
||||
case "song_change":
|
||||
List.song_change(msg[1]);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
skipping_listener: function(){
|
||||
@@ -93,27 +42,14 @@ var List = {
|
||||
|
||||
populate_list: function(msg)
|
||||
{
|
||||
full_playlist = msg;
|
||||
|
||||
List.sortList();
|
||||
$("#wrapper").empty();
|
||||
|
||||
$.each(msg, function(j, listeID){
|
||||
if(!listeID.now_playing){ //check that the song isnt playing
|
||||
|
||||
var video_title=decodeURIComponent(listeID.title);
|
||||
var video_id = listeID.id;
|
||||
var video_thumb = "//img.youtube.com/vi/"+video_id+"/mqdefault.jpg";
|
||||
//var delsong = ""; if(pass_corr=="correct");
|
||||
var video_votes = listeID.votes;
|
||||
$("#wrapper").append(list_html);
|
||||
var song = $("#list-song");
|
||||
song.find(".list-title").text(video_title);
|
||||
song.find(".list-title").attr("title", video_title);
|
||||
song.find(".list-votes").text(video_votes);
|
||||
song.find(".vote-container").attr("onclick", "vote('"+video_id+"','pos')");
|
||||
song.find(".list-image").attr("data-original",video_thumb);
|
||||
song.attr("id",video_id);
|
||||
song.find("#del").attr("onclick", "vote('"+video_id+"', 'del')");
|
||||
if(!w_p) $(".card-action").removeClass("hide");
|
||||
if(video_votes==1)song.find(".vote-text").text("vote");
|
||||
$.each(full_playlist, function(j, current_song){
|
||||
if(!current_song.now_playing){ //check that the song isnt playing
|
||||
$("#wrapper").append(List.generateSong(current_song, false, true));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -125,6 +61,56 @@ var List = {
|
||||
|
||||
},
|
||||
|
||||
added_song: function(added){
|
||||
full_playlist.push(added);
|
||||
List.sortList();
|
||||
List.insertAtIndex(added, true);
|
||||
},
|
||||
|
||||
deleted_song: function(deleted){
|
||||
var index = List.getIndexOfSong(deleted);
|
||||
var to_delete = $("#wrapper").children()[index];
|
||||
to_delete.style.height = 0;
|
||||
|
||||
setTimeout(function()
|
||||
{
|
||||
$("#"+deleted).remove();
|
||||
full_playlist.splice(List.getIndexOfSong(deleted), 1);
|
||||
}, 305);
|
||||
|
||||
document.getElementById('wrapper').scrollTop += 1;
|
||||
document.getElementById('wrapper').scrollTop += -1;
|
||||
},
|
||||
|
||||
voted_song: function(voted, time){
|
||||
var index_of_song = List.getIndexOfSong(voted);
|
||||
var song_voted_on = full_playlist[index_of_song];
|
||||
|
||||
full_playlist[index_of_song].votes += 1;
|
||||
full_playlist[index_of_song].added = time;
|
||||
|
||||
List.sortList();
|
||||
$("#"+voted).remove();
|
||||
List.insertAtIndex(song_voted_on, false);
|
||||
},
|
||||
|
||||
song_change: function(time){
|
||||
var length = full_playlist.length-1;
|
||||
|
||||
full_playlist[0].now_playing = true;
|
||||
full_playlist[0].votes = 0;
|
||||
full_playlist[0].guids = [];
|
||||
full_playlist[0].added = time;
|
||||
full_playlist[length].now_playing = false;
|
||||
|
||||
full_playlist.push(full_playlist.shift());
|
||||
$("#wrapper").children()[0].remove();
|
||||
|
||||
List.insertAtIndex(full_playlist[length-1], false);
|
||||
document.getElementById('wrapper').scrollTop += 1;
|
||||
document.getElementById('wrapper').scrollTop += -1;
|
||||
},
|
||||
|
||||
vote: function(id, vote){
|
||||
socket.emit('vote', [chan, id, vote, adminpass]);
|
||||
return true;
|
||||
@@ -136,23 +122,26 @@ var List = {
|
||||
},
|
||||
|
||||
importOldList: function(chan){
|
||||
var ids="";
|
||||
var num=0;
|
||||
|
||||
playlist_url = "lists/"+chan+".json";
|
||||
|
||||
list = $.ajax({
|
||||
type: "GET",
|
||||
url: playlist_url,
|
||||
async: false
|
||||
}).responseText;
|
||||
list = $.parseJSON(list);
|
||||
var ids="";
|
||||
var num=0;
|
||||
list = $.parseJSON($.ajax({
|
||||
type: "GET",
|
||||
url: playlist_url,
|
||||
async: false
|
||||
}).responseText);
|
||||
|
||||
$.each(list.songs, function(i,data)
|
||||
{
|
||||
ids+=data.id+",";
|
||||
|
||||
if(num>45){
|
||||
Search.addVideos(ids);
|
||||
ids="";
|
||||
num=0;
|
||||
|
||||
ids = "";
|
||||
num = 0;
|
||||
}
|
||||
num++;
|
||||
});
|
||||
@@ -161,6 +150,14 @@ var List = {
|
||||
document.getElementById("search").value = "";
|
||||
},
|
||||
|
||||
sortList: function()
|
||||
{
|
||||
full_playlist.sort(Helper.predicate({
|
||||
name: 'votes',
|
||||
reverse: true
|
||||
}, 'added'));
|
||||
},
|
||||
|
||||
show: function(){
|
||||
if(!window.mobilecheck())
|
||||
{
|
||||
@@ -179,38 +176,47 @@ var List = {
|
||||
}
|
||||
},
|
||||
|
||||
insertAtIndex: function(i, song_info, transition) {
|
||||
if(i === 0) {
|
||||
insertAtIndex: function(song_info, transition) {
|
||||
i = List.getIndexOfSong(song_info.id);
|
||||
|
||||
if(i === 0)
|
||||
$("#wrapper").prepend(List.generateSong(song_info, transition));
|
||||
return;
|
||||
else
|
||||
$("#wrapper > div:nth-child(" + (i) + ")").after(List.generateSong(song_info, transition));
|
||||
|
||||
if(transition)
|
||||
{
|
||||
setTimeout(function(){
|
||||
var added = $("#wrapper").children()[i];
|
||||
$(added).css("height", 66);
|
||||
},5);
|
||||
}
|
||||
$("#wrapper > div:nth-child(" + (i) + ")").after(List.generateSong(song_info, transition));
|
||||
},
|
||||
|
||||
generateSong: function(song_info, transition)
|
||||
generateSong: function(song_info, transition, lazy)
|
||||
{
|
||||
var video_id = song_info.id;
|
||||
var video_id = song_info.id;
|
||||
var video_title = song_info.title;
|
||||
var video_votes = song_info.votes;
|
||||
var video_thumb = "background-image:url('//img.youtube.com/vi/"+video_id+"/mqdefault.jpg');";
|
||||
var song = $("<div>"+list_html+"</div>");
|
||||
var image_attr = "style";
|
||||
|
||||
if(transition) song.find("#list-song").css("height", 0);
|
||||
if(!w_p) song.find(".card-action").removeClass("hide");
|
||||
if(video_votes == 1)song.find(".vote-text").text("vote");
|
||||
if(lazy){
|
||||
video_thumb = "//img.youtube.com/vi/"+video_id+"/mqdefault.jpg";
|
||||
image_attr = "data-original";
|
||||
}
|
||||
|
||||
var song = $("<div>"+list_html+"</div>");
|
||||
if(transition) song.find("#list-song").css("height", 0);
|
||||
song.find(".list-title").text(video_title);
|
||||
song.find(".list-title").attr("title", video_title);
|
||||
song.find(".list-votes").text(video_votes);
|
||||
song.find(".vote-container").attr("onclick", "vote('"+video_id+"','pos')");
|
||||
song.find(".list-image").attr("style",video_thumb);
|
||||
song.find(".list-image").attr(image_attr,video_thumb);
|
||||
song.find("#list-song").attr("id", video_id);
|
||||
song.find("#del").attr("onclick", "vote('"+video_id+"', 'del')");
|
||||
if(!w_p) song.find(".card-action").removeClass("hide");
|
||||
if(video_votes == 1)song.find(".vote-text").text("vote");
|
||||
|
||||
/*
|
||||
$(".lazy").lazyload({
|
||||
container: $("#wrapper")
|
||||
}).removeClass("lazy");
|
||||
*/
|
||||
|
||||
return song.html();
|
||||
},
|
||||
|
||||
@@ -1,54 +1,57 @@
|
||||
var chan = $("#chan").html();
|
||||
var w_p = true;
|
||||
var hasadmin=0;
|
||||
var list;
|
||||
var showToggle =true;
|
||||
var list_html = $("#list-song-html").html();
|
||||
var chan = $("#chan").html();
|
||||
var w_p = true;
|
||||
var hasadmin = 0;
|
||||
var showToggle = true;
|
||||
var list_html = $("#list-song-html").html();
|
||||
var blink_interval_exists = false;
|
||||
var unseen = false;
|
||||
var timer = 0;
|
||||
var api_key = "***REMOVED***";
|
||||
var result_html = $("#temp-results-container");
|
||||
var empty_results_html = $("#empty-results-container").html();
|
||||
var searching = false
|
||||
var time_regex = /P((([0-9]*\.?[0-9]*)Y)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)W)?(([0-9]*\.?[0-9]*)D)?)?(T(([0-9]*\.?[0-9]*)H)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)S)?)?/
|
||||
var conf = [];
|
||||
var music = 0;
|
||||
var frontpage = 1;
|
||||
var adminpass = "";
|
||||
var filesadded = "";
|
||||
var player_ready = false;
|
||||
var viewers = 1;
|
||||
var paused = false;
|
||||
var playing = false;
|
||||
var SAMPLE_RATE = 6000; // 6 seconds
|
||||
var lastSample = Date.now();
|
||||
var began = false;
|
||||
var i = -1;
|
||||
|
||||
var id;
|
||||
var full_playlist;
|
||||
var conf;
|
||||
var blink_interval;
|
||||
var blink_interval_exists = false;
|
||||
var unseen = false;
|
||||
var timer = 0;
|
||||
var api_key = "***REMOVED***";
|
||||
var result_html = $("#temp-results-container");
|
||||
var searching = false
|
||||
var time_regex = /P((([0-9]*\.?[0-9]*)Y)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)W)?(([0-9]*\.?[0-9]*)D)?)?(T(([0-9]*\.?[0-9]*)H)?(([0-9]*\.?[0-9]*)M)?(([0-9]*\.?[0-9]*)S)?)?/
|
||||
var tag;
|
||||
var firstScriptTag;
|
||||
var ytplayer;
|
||||
var title;
|
||||
var viewers;
|
||||
var video_id;
|
||||
var conf = [];
|
||||
var music = 0;
|
||||
var frontpage = 1;
|
||||
var adminpass = "";
|
||||
var filesadded="";
|
||||
var player_ready = false;
|
||||
var list;
|
||||
var seekTo;
|
||||
var song_title;
|
||||
var viewers = 1;
|
||||
var paused = false;
|
||||
var playing = false;
|
||||
var SAMPLE_RATE = 6000; // 6 seconds
|
||||
var lastSample = Date.now();
|
||||
var began = false;
|
||||
var id;
|
||||
|
||||
var connection_options = {
|
||||
'sync disconnect on unload':true
|
||||
};
|
||||
|
||||
var socket = io.connect('//'+window.location.hostname+':3000', connection_options);
|
||||
var socket = io.connect('http://'+window.location.hostname+':8880', connection_options);
|
||||
socket.on("get_list", function(){
|
||||
socket.emit('list', chan.toLowerCase());
|
||||
});
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
window.vote = List.vote;
|
||||
window.submit = Search.submit;
|
||||
window.vote = List.vote;
|
||||
window.submit = Search.submit;
|
||||
window.submitAndClose = Search.submitAndClose;
|
||||
|
||||
if(!localStorage["list_update"] || localStorage["list_update"] != "13.06.15")
|
||||
@@ -66,33 +69,14 @@ $(document).ready(function()
|
||||
edge: 'right', // Choose the horizontal origin
|
||||
closeOnClick: false // Closes side-nav on <a> clicks, useful for Angular/Meteor
|
||||
});
|
||||
|
||||
if(!window.mobilecheck())
|
||||
{
|
||||
Chat.setup_chat_listener(chan);
|
||||
Chat.allchat_listener();
|
||||
Hostcontroller.host_listener();
|
||||
$("#chat-btn").sideNav({
|
||||
menuWidth: 272, // Default is 240
|
||||
edge: 'left', // Choose the horizontal origin
|
||||
closeOnClick: false // Closes side-nav on <a> clicks, useful for Angular/Meteor
|
||||
});
|
||||
|
||||
$(".drag-target")[1].remove();
|
||||
}
|
||||
|
||||
//Materialize.toast("Passwords have been reset. If anything is not right, please send us a mail @ contact@zoff.no", 10000);
|
||||
|
||||
//$('#settings-close').sideNav('hide');
|
||||
|
||||
if(!window.mobilecheck() && !Helper.msieversion())
|
||||
{
|
||||
Notification.requestPermission();
|
||||
}
|
||||
//awdwad
|
||||
$(".video-container").resizable({
|
||||
handles: "e",
|
||||
minWidth: 350
|
||||
});
|
||||
|
||||
if(localStorage[chan.toLowerCase()])
|
||||
{
|
||||
//localStorage.removeItem(chan.toLowerCase());
|
||||
if(localStorage[chan.toLowerCase()].length != 64)
|
||||
localStorage.removeItem(chan.toLowerCase());
|
||||
else
|
||||
@@ -103,9 +87,22 @@ $(document).ready(function()
|
||||
document.getElementById("search").blur();
|
||||
Youtube.readyLooks();
|
||||
}else{
|
||||
|
||||
Chat.setup_chat_listener(chan);
|
||||
Chat.allchat_listener();
|
||||
Hostcontroller.host_listener();
|
||||
Youtube.loadPlayer();
|
||||
window.onYouTubeIframeAPIReady = Youtube.onYouTubeIframeAPIReady;
|
||||
|
||||
$("#chat-btn").sideNav({
|
||||
menuWidth: 272, // Default is 240
|
||||
edge: 'left', // Choose the horizontal origin
|
||||
closeOnClick: false // Closes side-nav on <a> clicks, useful for Angular/Meteor
|
||||
});
|
||||
|
||||
$(".drag-target")[1].remove();
|
||||
|
||||
if(!Helper.msieversion()) Notification.requestPermission();
|
||||
if(navigator.userAgent.toLowerCase().indexOf("firefox") > -1) //quickdickfix for firefoxs weird percent handling
|
||||
$(".main").height(window.innerHeight-64);
|
||||
|
||||
@@ -162,50 +159,42 @@ $(document).ready(function()
|
||||
});
|
||||
|
||||
$(document).keyup(function(e) {
|
||||
if(event.keyCode == 27){
|
||||
$("#results").html("");
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
if(!Helper.contains($("#search-wrapper").attr("class").split(" "), "hide"))
|
||||
$("#search-wrapper").toggleClass("hide");
|
||||
if(Helper.contains($("#song-title").attr("class").split(" "), "hide"))
|
||||
$("#song-title").toggleClass("hide");
|
||||
if(event.keyCode == 27){
|
||||
$("#results").html("");
|
||||
if(!Helper.contains($("#search-wrapper").attr("class").split(" "), "hide"))
|
||||
$("#search-wrapper").toggleClass("hide");
|
||||
if(Helper.contains($("#song-title").attr("class").split(" "), "hide"))
|
||||
$("#song-title").toggleClass("hide");
|
||||
|
||||
if($("#search-btn i").attr('class') == "mdi-navigation-close")
|
||||
{
|
||||
$("#search-btn i").toggleClass("mdi-navigation-close");
|
||||
$("#search-btn i").toggleClass("mdi-action-search");
|
||||
}
|
||||
$("#results").toggleClass("hide");
|
||||
}
|
||||
|
||||
else if ($("div.result").length > 2){
|
||||
|
||||
if (e.keyCode == 40) {
|
||||
if(i < $("div.result").length -2)
|
||||
i++;
|
||||
$("div.result:nth-child("+(i-1)+")").removeClass("hoverResults");
|
||||
$("div.result:nth-child("+i+")").addClass("hoverResults");
|
||||
} else if (e.keyCode == 38) {
|
||||
$("div.result:nth-child("+i+")").removeClass("hoverResults");
|
||||
$("div.result:nth-child("+(i-1)+")").addClass("hoverResults");
|
||||
if(i > 1)
|
||||
i--;
|
||||
} else if(e.keyCode == 13) {
|
||||
i = 0;
|
||||
var elem = document.getElementsByClassName("hoverResults")[0];
|
||||
if (typeof elem.onclick == "function") {
|
||||
elem.onclick.apply(elem);
|
||||
}
|
||||
$("div.hoverResults").removeClass("hoverResults");
|
||||
$("#results").html('');
|
||||
document.getElementById("search").value = "";
|
||||
$(".main").removeClass("blurT");
|
||||
$("#controls").removeClass("blurT");
|
||||
$(".main").removeClass("clickthrough");
|
||||
}
|
||||
}
|
||||
if($("#search-btn i").attr('class') == "mdi-navigation-close")
|
||||
{
|
||||
$("#search-btn i").toggleClass("mdi-navigation-close");
|
||||
$("#search-btn i").toggleClass("mdi-action-search");
|
||||
}
|
||||
$("#results").toggleClass("hide");
|
||||
}else if ($("div.result").length > 2){
|
||||
children = $("#mock-div").children();
|
||||
if (e.keyCode == 40) {
|
||||
$(children[i-1]).removeClass("hoverResults");
|
||||
$(children[i]).addClass("hoverResults");
|
||||
if(i < children.length -2)
|
||||
i++;
|
||||
} else if (e.keyCode == 38) {
|
||||
if(i > 1)
|
||||
i--;
|
||||
$(children[i]).removeClass("hoverResults");
|
||||
$(children[i-1]).addClass("hoverResults");
|
||||
} else if(e.keyCode == 13) {
|
||||
i = 0;
|
||||
var elem = document.getElementsByClassName("hoverResults")[0];
|
||||
if (typeof elem.onclick == "function") {
|
||||
elem.onclick.apply(elem);
|
||||
}
|
||||
$("div.hoverResults").removeClass("hoverResults");
|
||||
$("#results").html('');
|
||||
document.getElementById("search").value = "";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('input[class=conf]').change(function()
|
||||
|
||||
@@ -99,19 +99,19 @@ String.prototype.capitalizeFirstLetter = function() {
|
||||
$(document).ready(function (){
|
||||
|
||||
//Materialize.toast("<a href='/remote' style='color:white;'>Try out our new feature, remote!</a>", 8000)
|
||||
if(window.location.hash == "#donation")
|
||||
$('#donation').openModal()
|
||||
|
||||
list_html = $("#channel-list-container").html();
|
||||
window.list_html = list_html;
|
||||
$("#channels").empty();
|
||||
|
||||
var socket = io.connect('//'+window.location.hostname+':3000');
|
||||
var socket = io.connect('//'+window.location.hostname+':8880');
|
||||
socket.emit('frontpage_lists');
|
||||
socket.on('playlists', function(msg){
|
||||
Nochan.populate_channels(msg);
|
||||
})
|
||||
|
||||
|
||||
|
||||
var pad = 0;
|
||||
document.getElementById("zicon").addEventListener("click", function(){
|
||||
pad+=10;
|
||||
|
||||
@@ -1,18 +1,60 @@
|
||||
var start = true;
|
||||
var id;
|
||||
|
||||
window.mobilecheck = function() {
|
||||
var check = false;
|
||||
(function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true;})(navigator.userAgent||navigator.vendor||window.opera);
|
||||
return check;
|
||||
};
|
||||
|
||||
$(document).ready(function (){
|
||||
document.title = "Zöff Remote";
|
||||
setTimeout(function(){$("#search").focus();},500);
|
||||
socket = io.connect('//'+window.location.hostname+':3000');
|
||||
socket = io.connect('//'+window.location.hostname+':8880');
|
||||
id = window.location.pathname.split("/")[2];
|
||||
if(id)
|
||||
{
|
||||
id = id.toLowerCase();
|
||||
Remotecontroller.control();
|
||||
}
|
||||
|
||||
git_info = $.ajax({ type: "GET",
|
||||
url: "https://api.github.com/repos/zoff-music/zoff/commits",
|
||||
async: false
|
||||
}).responseText;
|
||||
|
||||
git_info = $.parseJSON(git_info);
|
||||
$("#latest-commit").html("Latest Commit: <br>"
|
||||
+ git_info[0].commit.author.date.substring(0,10)
|
||||
+ ": " + git_info[0].committer.login
|
||||
+ "<br><a href='"+git_info[0].html_url+"'>"
|
||||
+ git_info[0].sha.substring(0,10) + "</a>: "
|
||||
+ git_info[0].commit.message+"<br");
|
||||
|
||||
var _isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
|
||||
setTimeout(function(){
|
||||
if (_isChrome && !document.getElementById('extension-is-installed') && !window.mobilecheck())
|
||||
Materialize.toast("<a href='#' onclick='installRemote();' style='pointer-events:all;color:white;'>Install the extension!</a>", 100000);
|
||||
}, 5);
|
||||
window.installRemote = installRemote;
|
||||
window.failed = failed;
|
||||
window.success = success;
|
||||
});
|
||||
|
||||
function installRemote()
|
||||
{
|
||||
chrome.webstore.install("", success, failed);
|
||||
}
|
||||
|
||||
function failed(e)
|
||||
{
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
function success()
|
||||
{
|
||||
console.log("Successfully installed");
|
||||
}
|
||||
|
||||
$("#playbutton").on("click", function()
|
||||
{
|
||||
socket.emit("id", [id, "play", "mock"]);
|
||||
@@ -30,10 +72,13 @@ $("#skipbutton").on("click", function()
|
||||
|
||||
$("#remoteform").on("submit", function()
|
||||
{
|
||||
/*
|
||||
if(start)
|
||||
window.location.href = '/remote/'+document.getElementById("remoteform").chan.value;
|
||||
else
|
||||
Remotecontroller.control();
|
||||
*/
|
||||
Remotecontroller.control();
|
||||
});
|
||||
|
||||
var Remotecontroller = {
|
||||
@@ -42,8 +87,12 @@ var Remotecontroller = {
|
||||
{
|
||||
if(start)
|
||||
{
|
||||
if(!id)id = $("#code-input").val().toLowerCase();
|
||||
$("#code-input").val("");
|
||||
if(!id)
|
||||
{
|
||||
id = document.getElementById("remoteform").chan.value;
|
||||
window.history.pushState("object or string", "Title", "/remote/"+id);
|
||||
}
|
||||
document.getElementById("remoteform").chan.value = "";
|
||||
start = false;
|
||||
|
||||
$(".rc").css("display", "block");
|
||||
|
||||
@@ -39,7 +39,14 @@ var Search = {
|
||||
url: yt_url,
|
||||
dataType:"jsonp",
|
||||
success: function(response){
|
||||
if(response.items){
|
||||
if(response.items.length == 0)
|
||||
{
|
||||
|
||||
$("<div style='display:none;' id='mock-div'>"+empty_results_html+"</div>").appendTo($("#results")).show("blind", 83.33);
|
||||
if(!Helper.contains($("#search_loader").attr("class").split(" "), "hide"))
|
||||
$("#search_loader").addClass("hide");
|
||||
|
||||
}else if(response.items){
|
||||
//get list of IDs and make new request for video info
|
||||
$.each(response.items, function(i,data)
|
||||
{
|
||||
@@ -73,10 +80,10 @@ var Search = {
|
||||
|
||||
songs.find(".search-title").text(title);
|
||||
songs.find(".result_info").text(duration);
|
||||
songs.find(".thumb").attr("src", thumb);
|
||||
songs.find(".thumb").attr("data-original", 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)
|
||||
//$($(songs).find("div")[0]).attr("id", id)
|
||||
output += songs.html();
|
||||
|
||||
}
|
||||
@@ -84,6 +91,8 @@ var Search = {
|
||||
|
||||
$("<div style='display:none;' id='mock-div'>"+output+"</div>").appendTo($("#results")).show("blind", (response.items.length-1) * 83.33);
|
||||
|
||||
setTimeout(function(){$(".thumb").lazyload({container: $("#results")})}, 250);
|
||||
|
||||
if(!Helper.contains($("#search_loader").attr("class").split(" "), "hide"))
|
||||
$("#search_loader").addClass("hide");
|
||||
|
||||
@@ -116,8 +125,11 @@ var Search = {
|
||||
$(".main").removeClass("clickthrough");
|
||||
},
|
||||
|
||||
importPlaylist: function(pId){
|
||||
playlist_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&maxResults=49&key="+api_key+"&playlistId="+pId;
|
||||
importPlaylist: function(pId,pageToken){
|
||||
token = "";
|
||||
if(pageToken !== undefined)
|
||||
token = "&pageToken="+pageToken;
|
||||
playlist_url = "https://www.googleapis.com/youtube/v3/playlistItems?part=contentDetails&maxResults=49&key="+api_key+"&playlistId="+pId+token;
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: playlist_url,
|
||||
@@ -125,11 +137,13 @@ var Search = {
|
||||
success: function(response)
|
||||
{
|
||||
var ids="";
|
||||
Search.addVideos(response.items[0].contentDetails.videoId);
|
||||
$.each(response.items, function(i,data)
|
||||
{
|
||||
ids+=data.contentDetails.videoId+",";
|
||||
});
|
||||
Search.addVideos(ids);
|
||||
if(response.nextPageToken) Search.importPlaylist(pId, response.nextPageToken);
|
||||
document.getElementById("import").value = "";
|
||||
}
|
||||
});
|
||||
@@ -148,7 +162,7 @@ var Search = {
|
||||
{
|
||||
var duration=Search.durationToSeconds(song.contentDetails.duration);
|
||||
if(!longsongs || duration<720){
|
||||
enc_title=encodeURIComponent(song.snippet.title).replace(/'/g, "\\\'");
|
||||
enc_title=encodeURIComponent(song.snippet.title);
|
||||
Search.submit(song.id, enc_title, duration);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -8,6 +8,7 @@ var Youtube = {
|
||||
|
||||
document.getElementById('song-title').innerHTML = "Empty channel. Add some songs!";
|
||||
$("#player_overlay").height($("#player").height());
|
||||
|
||||
if(!window.mobilecheck()) $("#player_overlay").toggleClass("hide");
|
||||
try{
|
||||
ytplayer.stopVideo();
|
||||
@@ -16,12 +17,13 @@ var Youtube = {
|
||||
}
|
||||
else{
|
||||
//console.log("gotten new song");
|
||||
video_id = obj[0][0]["id"];
|
||||
conf = obj[1][0];
|
||||
time = obj[2];
|
||||
seekTo = time - conf["startTime"];
|
||||
song_title = obj[0][0]["title"];
|
||||
|
||||
$("#player_overlay").addClass("hide");
|
||||
video_id = obj[0][0]["id"];
|
||||
conf = obj[1][0];
|
||||
time = obj[2];
|
||||
seekTo = time - conf["startTime"];
|
||||
song_title = obj[0][0]["title"];
|
||||
|
||||
Youtube.getTitle(song_title, viewers);
|
||||
Youtube.setBGimage(video_id);
|
||||
@@ -48,6 +50,7 @@ var Youtube = {
|
||||
socket.on("viewers", function(view)
|
||||
{
|
||||
viewers = view;
|
||||
|
||||
if(song_title !== undefined)
|
||||
Youtube.getTitle(song_title, viewers);
|
||||
});
|
||||
@@ -59,12 +62,14 @@ var Youtube = {
|
||||
case -1:
|
||||
break;
|
||||
case 0:
|
||||
playing = false;
|
||||
paused = false;
|
||||
|
||||
socket.emit("end", video_id);
|
||||
playing = false;
|
||||
paused = false;
|
||||
break;
|
||||
case 1:
|
||||
playing = true;
|
||||
|
||||
if(document.getElementById("play").className.split(" ").length == 1)
|
||||
$("#play").toggleClass("hide");
|
||||
if(document.getElementById("pause").className.split(" ").length == 2)
|
||||
@@ -77,6 +82,7 @@ var Youtube = {
|
||||
break;
|
||||
case 2:
|
||||
paused = true;
|
||||
|
||||
if(document.getElementById("pause").className.split(" ").length == 1)
|
||||
$("#pause").toggleClass("hide");
|
||||
if(document.getElementById("play").className.split(" ").length == 2)
|
||||
@@ -89,23 +95,25 @@ var Youtube = {
|
||||
|
||||
getTitle: function(titt, v)
|
||||
{
|
||||
var outPutWord = v > 1 ? "viewers" : "viewer";
|
||||
var title= decodeURIComponent(titt);
|
||||
var elem = document.getElementById('song-title');
|
||||
var outPutWord = v > 1 ? "viewers" : "viewer";
|
||||
var title = decodeURIComponent(titt);
|
||||
var elem = document.getElementById('song-title');
|
||||
var viewers = document.getElementById('viewers');
|
||||
|
||||
document.title = title + " • Zöff / "+chan;
|
||||
elem.innerHTML = title;
|
||||
document.getElementById('viewers').innerHTML = v + " " + outPutWord;
|
||||
elem.title = title + " • " + v + " " + outPutWord;
|
||||
document.title = title + " • Zöff / "+chan;
|
||||
elem.innerHTML = title;
|
||||
viewers.innerHTML = v + " " + outPutWord;
|
||||
elem.title = title + " • " + v + " " + outPutWord;
|
||||
|
||||
},
|
||||
|
||||
errorHandler: function(newState)
|
||||
{
|
||||
if(newState.data == 5 || newState.data == 100 || newState.data == 101 || newState.data == 150)
|
||||
socket.emit("skip", newState.data);
|
||||
if(newState.data == 5 || newState.data == 100
|
||||
|| newState.data == 101 || newState.data == 150)
|
||||
socket.emit("skip", newState.data);
|
||||
else if(video_id !== undefined)
|
||||
ytplayer.loadVideoById(video_id);
|
||||
ytplayer.loadVideoById(video_id);
|
||||
},
|
||||
|
||||
onPlayerReady: function(event) {
|
||||
@@ -133,21 +141,24 @@ var Youtube = {
|
||||
setBGimage: function(id){
|
||||
if(id !== undefined)
|
||||
{
|
||||
var img = new Image();
|
||||
img.onload = function () {
|
||||
var colorThief = new ColorThief();
|
||||
//console.log(rgbToHsl(colorThief.getColor(img)));
|
||||
document.getElementsByTagName("body")[0].style.backgroundColor = Helper.rgbToHsl(colorThief.getColor(img))
|
||||
//$("body").css("background-color", rgbToHsl(colorThief.getColor(img)));
|
||||
//$("body").css("background-color", colorThief.getColor(img));
|
||||
var img = new Image();
|
||||
img.onload = function ()
|
||||
{
|
||||
|
||||
var colorThief = new ColorThief();
|
||||
var color = colorThief.getColor(img);
|
||||
|
||||
document.getElementsByTagName("body")[0].style.backgroundColor = Helper.rgbToHsl(color);
|
||||
$("meta[name=theme-color]").attr("content", Helper.rgbToHex(color[0], color[1], color[2]));
|
||||
};
|
||||
|
||||
img.crossOrigin = 'Anonymous';
|
||||
img.src = 'https://cors-anywhere.herokuapp.com/http://img.youtube.com/vi/'+id+'/mqdefault.jpg';
|
||||
img.src = '//zoff.no:8080/http://img.youtube.com/vi/'+id+'/mqdefault.jpg';
|
||||
}
|
||||
},
|
||||
|
||||
notifyUser: function(id, title) {
|
||||
title= title.replace(/\\\'/g, "'").replace(/"/g,"'").replace(/&/g,"&");
|
||||
title = title.replace(/\\\'/g, "'").replace(/"/g,"'").replace(/&/g,"&");
|
||||
if (Notification.permission === "granted" && document.hidden && id != "30H2Z8Lr-4c" && !window.mobilecheck()) {
|
||||
var notification = new Notification("Now Playing", {body: title, icon: "http://i.ytimg.com/vi/"+id+"/mqdefault.jpg", iconUrl: "http://i.ytimg.com/vi/"+id+"/mqdefault.jpg"});
|
||||
notification.onclick = function(x) { window.focus(); this.cancel(); };
|
||||
@@ -183,8 +194,8 @@ var Youtube = {
|
||||
},
|
||||
|
||||
loadPlayer: function() {
|
||||
tag = document.createElement('script');
|
||||
tag.src = "https://www.youtube.com/iframe_api";
|
||||
tag = document.createElement('script');
|
||||
tag.src = "https://www.youtube.com/iframe_api";
|
||||
firstScriptTag = document.getElementsByTagName('script')[0];
|
||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user