mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
tempfixes until I get my computer back
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -17,3 +17,4 @@ scripts/
|
||||
.DS_Store
|
||||
npm-debug.log
|
||||
server/npm-debug.log
|
||||
server/public/assets/dist/
|
||||
|
||||
@@ -5,6 +5,7 @@ path = require('path'),
|
||||
http = require('http'),
|
||||
port = 8080,
|
||||
//farmhash = require('farmhash'),
|
||||
uniqid = require('uniqid'),
|
||||
num_processes = require('os').cpus().length;
|
||||
|
||||
publicPath = path.join(__dirname, 'public');
|
||||
@@ -49,6 +50,7 @@ function startClustered(redis_enabled) {
|
||||
var worker_index = function(ip, len) {
|
||||
//console.log(ip);
|
||||
var s = '';
|
||||
if(ip == undefined) ip = uniqid.time();
|
||||
for (var i = 0, _len = ip.length; i < _len; i++) {
|
||||
if(!isNaN(ip[i])) {
|
||||
s += ip[i];
|
||||
|
||||
@@ -191,7 +191,8 @@ margin: auto;
|
||||
}
|
||||
|
||||
#channel-share-modal {
|
||||
background: transparent !important;
|
||||
overflow:hidden;
|
||||
background: transparent !important;
|
||||
text-align: center !important;
|
||||
margin: auto;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -23,7 +23,10 @@ var Channel = {
|
||||
if(cast_ready_connect || chromecastAvailable || chromecastReady) {
|
||||
Helper.addClass(".volume-container", "volume-container-cast");
|
||||
}
|
||||
|
||||
if(!embed) {
|
||||
document.querySelector("#main-container").insertAdjacentHTML("beforeend", "<a id='hide-playlist' class='hide-on-small-only' href='#!' style=' position: absolute;top: 128px;background: inherit;display:flex;align:items:center;justify-content:center;z-index: 99;font-size: 1rem;padding: 10px;color: white;'><i class='material-icons'>keyboard_arrow_right</i></div>");
|
||||
document.querySelector("#hide-playlist").style.left = (document.querySelector("#video-container").offsetWidth - document.querySelector("#hide-playlist").offsetWidth) + "px";
|
||||
}
|
||||
//Player.soundcloud_player = document.querySelector("#soundcloud_player");
|
||||
}
|
||||
Admin.logged_in = false;
|
||||
@@ -628,6 +631,9 @@ var Channel = {
|
||||
success: function(e){
|
||||
|
||||
if(!client) {
|
||||
document.querySelector("#hide-playlist").remove();
|
||||
if(hiddenPlaylist) document.querySelector("main").style.maxWidth = "";
|
||||
hiddenPlaylist = false;
|
||||
document.getElementById("volume-button").removeEventListener("click", Playercontrols.mute_video);
|
||||
document.getElementById("playpause").removeEventListener("click", Playercontrols.play_pause);
|
||||
document.getElementById("fullscreen").removeEventListener("click", Playercontrols.fullscreen);
|
||||
|
||||
@@ -21,6 +21,81 @@ function removeAllListeners() {
|
||||
socket.removeEventListener(id);
|
||||
}
|
||||
|
||||
function resizeFunction() {
|
||||
if(chan && !Helper.mobilecheck()){
|
||||
if(!client && !embed) document.querySelector("#hide-playlist").style.left = (document.querySelector("#video-container").offsetWidth - document.querySelector("#hide-playlist").offsetWidth) + "px";
|
||||
if(document.querySelector("#wrapper") == null) return;
|
||||
if(window.innerWidth > 600 && document.querySelector("#wrapper").style.height != "") {
|
||||
document.querySelector("#wrapper").style.height = "";
|
||||
document.querySelector("#chat-bar").style.height = "";
|
||||
document.querySelector("#channelchat").style.height = "";
|
||||
document.querySelector("#all_chat").style.height = "";
|
||||
document.querySelector("#chat-container").style.height = "";
|
||||
} else if(window.innerWidth < 601) {
|
||||
if(!client && !embed) {
|
||||
var scPlaying = false;
|
||||
var ytPlaying = false;
|
||||
try {
|
||||
ytPlaying = Player.player.getPlayerState() == YT.PlayerState.PLAYING || Player.player.getPlayerState() == YT.PlayerState.BUFFERING;
|
||||
} catch(e) {}
|
||||
try {
|
||||
scPlaying = Player.soundcloud_player.isPlaying();
|
||||
} catch(e){}
|
||||
resizePlaylistPlaying(ytPlaying || scPlaying);
|
||||
return;
|
||||
}
|
||||
}
|
||||
var temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71)+1;
|
||||
if(temp_fit > List.can_fit || temp_fit < List.can_fit){
|
||||
List.dynamicContentPage(-10);
|
||||
}
|
||||
if(List.can_fit < temp_fit){
|
||||
for(var i = 0; i < List.page + temp_fit; i++) {
|
||||
Helper.css(document.querySelector("#wrapper").children[i], "display", "inline-flex");
|
||||
}
|
||||
} else if(List.can_fit > temp_fit){
|
||||
Helper.css(document.querySelector("#wrapper").children[List.page + temp_fit], "display", "none");
|
||||
var elements = document.querySelector("#wrapper").children;
|
||||
for(var i = List.page + temp_fit; i < elements.length; i++) {
|
||||
Helper.css(document.querySelector("#wrapper").children[i], "display", "none");
|
||||
}
|
||||
}
|
||||
List.can_fit = temp_fit;
|
||||
List.element_height = (Helper.computedStyle("#wrapper", "height") / List.can_fit)-5.3;
|
||||
|
||||
Helper.css(".list-song", "height", List.element_height + "px");
|
||||
Channel.set_title_width();
|
||||
if(!client) {
|
||||
var controlsPosition = document.querySelector("#controls").offsetHeight - Helper.computedStyle("#controls", "height");
|
||||
if(document.querySelectorAll("#controls").length > 0 && !Helper.mobilecheck()) {
|
||||
Helper.css(document.querySelector("#seekToDuration"), "top", controlsPosition - 55);
|
||||
} else if(document.querySelectorAll("#controls").length > 0) {
|
||||
Helper.css(document.querySelector("#seekToDuration"), "top", controlsPosition - 20);
|
||||
}
|
||||
Channel.window_width_volume_slider();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function fullVideo(hide) {
|
||||
if(hide) {
|
||||
document.querySelector("#playlist").className += " show-only-mobile";
|
||||
document.querySelector("#video-container").classList.remove("m9");
|
||||
document.querySelector("#video-container").className += " m12";
|
||||
document.querySelector("main").style.maxWidth = "100%";
|
||||
document.querySelector("#hide-playlist").style.left = (document.querySelector("#video-container").offsetWidth - document.querySelector("#hide-playlist").offsetWidth) + "px";
|
||||
document.querySelector("#hide-playlist .material-icons").innerText = "keyboard_arrow_left";
|
||||
} else {
|
||||
document.querySelector("#playlist").classList.remove("show-only-mobile");
|
||||
document.querySelector("#video-container").classList.remove("m12");
|
||||
document.querySelector("#video-container").className += " m9";
|
||||
document.querySelector("main").style.maxWidth = "99%";
|
||||
document.querySelector("#hide-playlist").style.left = (document.querySelector("#video-container").offsetWidth - document.querySelector("#hide-playlist").offsetWidth) + "px";
|
||||
document.querySelector("#hide-playlist .material-icons").innerText = "keyboard_arrow_right";
|
||||
}
|
||||
hiddenPlaylist = hide;
|
||||
}
|
||||
|
||||
function getColor(id) {
|
||||
Helper.ajax({
|
||||
method: "POST",
|
||||
@@ -556,8 +631,9 @@ function enable_host_mode(enabled) {
|
||||
document.removeEventListener('mozfullscreenchange', exitHandler, false);
|
||||
document.removeEventListener('fullscreenchange', exitHandler, false);
|
||||
document.removeEventListener('MSFullscreenChange', exitHandler, false);
|
||||
resizeFunction();
|
||||
}
|
||||
List.dynamicContentPageJumpTo(-10);
|
||||
List.dynamicContentPage(-10);
|
||||
}
|
||||
|
||||
function get_list_listener(){
|
||||
|
||||
@@ -5,6 +5,7 @@ var client = false;
|
||||
if(domain.length > 0 && domain[0] == "client") {
|
||||
client = true;
|
||||
}
|
||||
var hiddenPlaylist = false;
|
||||
var videoSource;
|
||||
var dynamicListeners = {};
|
||||
var socket_connected = false;
|
||||
@@ -392,6 +393,10 @@ addListener("click", "#player_overlay", function(event) {
|
||||
}
|
||||
});
|
||||
|
||||
addListener("click", "#hide-playlist", function(event) {
|
||||
this.preventDefault();
|
||||
fullVideo(!hiddenPlaylist);
|
||||
});
|
||||
|
||||
|
||||
addListener("click", "#bitcoin-address", function(event) {
|
||||
@@ -919,11 +924,11 @@ addListener("click", ".donate-button", function(event) {
|
||||
M.Modal.getInstance(document.getElementById("donate")).open();
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
addListener("click", '#toast-container', function(){
|
||||
before_toast();
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
addListener("click", "#aprilfools", function(){
|
||||
Helper.css(".mega", "-webkit-transform", "rotate(0deg)");
|
||||
@@ -1297,58 +1302,7 @@ window.addEventListener("focus", function(event) {
|
||||
});
|
||||
|
||||
window.addEventListener("resize", function(){
|
||||
if(chan && !Helper.mobilecheck()){
|
||||
if(document.querySelector("#wrapper") == null) return;
|
||||
if(window.innerWidth > 600 && document.querySelector("#wrapper").style.height != "") {
|
||||
document.querySelector("#wrapper").style.height = "";
|
||||
document.querySelector("#chat-bar").style.height = "";
|
||||
document.querySelector("#channelchat").style.height = "";
|
||||
document.querySelector("#all_chat").style.height = "";
|
||||
document.querySelector("#chat-container").style.height = "";
|
||||
} else if(window.innerWidth < 601) {
|
||||
if(!client && !embed) {
|
||||
var scPlaying = false;
|
||||
var ytPlaying = false;
|
||||
try {
|
||||
ytPlaying = Player.player.getPlayerState() == YT.PlayerState.PLAYING || Player.player.getPlayerState() == YT.PlayerState.BUFFERING;
|
||||
} catch(e) {}
|
||||
try {
|
||||
scPlaying = Player.soundcloud_player.isPlaying();
|
||||
} catch(e){}
|
||||
resizePlaylistPlaying(ytPlaying || scPlaying);
|
||||
return;
|
||||
}
|
||||
}
|
||||
var temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71)+1;
|
||||
if(temp_fit > List.can_fit || temp_fit < List.can_fit){
|
||||
List.dynamicContentPage(-10);
|
||||
}
|
||||
if(List.can_fit < temp_fit){
|
||||
for(var i = 0; i < List.page + temp_fit; i++) {
|
||||
Helper.css(document.querySelector("#wrapper").children[i], "display", "inline-flex");
|
||||
}
|
||||
} else if(List.can_fit > temp_fit){
|
||||
Helper.css(document.querySelector("#wrapper").children[List.page + temp_fit], "display", "none");
|
||||
var elements = document.querySelector("#wrapper").children;
|
||||
for(var i = List.page + temp_fit; i < elements.length; i++) {
|
||||
Helper.css(document.querySelector("#wrapper").children[i], "display", "none");
|
||||
}
|
||||
}
|
||||
List.can_fit = temp_fit;
|
||||
List.element_height = (Helper.computedStyle("#wrapper", "height") / List.can_fit)-5.3;
|
||||
|
||||
Helper.css(".list-song", "height", List.element_height + "px");
|
||||
Channel.set_title_width();
|
||||
if(!client) {
|
||||
var controlsPosition = document.querySelector("#controls").offsetHeight - Helper.computedStyle("#controls", "height");
|
||||
if(document.querySelectorAll("#controls").length > 0 && !Helper.mobilecheck()) {
|
||||
Helper.css(document.querySelector("#seekToDuration"), "top", controlsPosition - 55);
|
||||
} else if(document.querySelectorAll("#controls").length > 0) {
|
||||
Helper.css(document.querySelector("#seekToDuration"), "top", controlsPosition - 20);
|
||||
}
|
||||
Channel.window_width_volume_slider();
|
||||
}
|
||||
}
|
||||
resizeFunction();
|
||||
});
|
||||
|
||||
addListener("click", ".result-object", function(e){
|
||||
|
||||
Reference in New Issue
Block a user