Working handlebars

This commit is contained in:
Kasper Rynning-Tønnesen
2017-05-02 17:25:21 +02:00
parent 9f3e2fddb9
commit d40e0d0080
12 changed files with 135 additions and 40 deletions

View File

@@ -25,9 +25,7 @@ var Crypt = {
Crypt.conf_pass = Crypt.decrypt(Crypt.create_cookie(chan.toLowerCase()), chan.toLowerCase());
}
console.log("test");
Hostcontroller.change_enabled(conf_arr.remote);
console.log("test 2");
if(conf_arr.width != 100) Player.set_width(conf_arr.width);
if(conf_arr.name !== undefined && conf_arr.name !== "") Chat.namechange(conf_arr.name);
}

View File

@@ -11,6 +11,7 @@ var adminpass = "";
var mobile_beginning = false;
var durationBegun = false;
var chromecastAvailable = false;
var private_channel = false;
var offline = false;
var from_frontpage = false;
var seekTo;

View File

@@ -269,6 +269,7 @@ var Frontpage = {
Frontpage.times_rotated = 0;
i = 0;
socket.emit("frontpage_lists");
socket.emit('get_userlists', Crypt.getCookie('_uI'));
}else if(frontpage){
Frontpage.times_rotated += 1;
Frontpage.add_backdrop(list, i+1);
@@ -452,6 +453,7 @@ function initfp(){
});
}
socket.emit('frontpage_lists');
socket.emit('get_userlists', Crypt.getCookie('_uI'));
$("#channel-load").css("display", "none");
//Materialize.toast("<a href='/remote' style='color:white;'>Try out our new feature, remote!</a>", 8000)

View File

@@ -40,7 +40,9 @@ var Hostcontroller = {
$("#chan").html(Helper.upperFirst(chan));
w_p = true;
socket.emit("list", chan.toLowerCase());
var add = "";
if(private_channel) add = Crypt.getCookie("_uI") + "_";
socket.emit("list", add + chan.toLowerCase());
/*if(Crypt.get_pass(chan.toLowerCase()) !== undefined && Crypt.get_pass(chan.toLowerCase()) != ""){
socket.emit("password", {password: Crypt.crypt_pass(Crypt.get_pass(chan.toLowerCase())), channel: chan.toLowerCase()});

View File

@@ -8,6 +8,7 @@ var api_key = "***REMOVED***";
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 private_channel = false;
var music = 0;
var frontpage = 1;
var adminpass = "";
@@ -148,9 +149,11 @@ $().ready(function(){
function init(){
number_suggested = 0;
var no_socket = true;
var pathname = window.location.pathname.split("/");
if(pathname.length == 3) {
private_channel = true;
}
chan = $("#chan").html();
console.log(chan);
mobile_beginning = Helper.mobilecheck();
var side = Helper.mobilecheck() ? "left" : "right";
@@ -236,7 +239,11 @@ function init(){
$("#code-link").attr("href", codeURL);
}
if(no_socket) socket.emit('list', chan.toLowerCase());
if(no_socket){
var add = "";
if(private_channel) add = Crypt.getCookie("_uI") + "_";
socket.emit("list", add + chan.toLowerCase());
}
$("#viewers").tooltip({
delay: 5,
position: "top",
@@ -494,7 +501,9 @@ function setup_youtube_listener(){
function get_list_listener(){
socket.on("get_list", function(){
socket.emit('list', chan.toLowerCase());
var add = "";
if(private_channel) add = Crypt.getCookie("_uI") + "_";
socket.emit("list", add + chan.toLowerCase());
});
}
@@ -687,8 +696,10 @@ function change_offline(enabled, already_offline){
$("#seekToDuration").remove();
if(window.location.pathname != "/"){
socket.emit("pos");
socket.emit('list', chan.toLowerCase());
if($("#controls").hasClass("ewresize")) $("#controls").removeClass("ewresize");
var add = "";
if(private_channel) add = Crypt.getCookie("_uI") + "_";
socket.emit("list", add + chan.toLowerCase());
if($("#controls").hasClass("ewresize")) $("#controls").removeClass("ewresize");
}
}
}
@@ -1576,9 +1587,10 @@ function onepage_load(){
chan = url_split[3].replace("#", "");
$("#chan").html(Helper.upperFirst(chan));
var add = "";
w_p = true;
socket.emit("list", chan.toLowerCase());
if(private_channel) add = Crypt.getCookie("_uI") + "_";
socket.emit("list", add + chan.toLowerCase());
}else if(url_split[3] === ""){
clearTimeout(width_timeout);
if(fireplace_initiated){

View File

@@ -19,7 +19,7 @@ $(document).ready(function (){
if(window.location.hostname == "remote.zoff.me") add = "https://zoff.me";
else add = "localhost";
socket = io.connect(add + ':8080', connection_options);
socket = io.connect(add+':8080', connection_options);
id = window.location.pathname.split("/")[1];
if(id)
{