mirror of
				https://github.com/KevinMidboe/zoff.git
				synced 2025-10-29 18:00:23 +00:00 
			
		
		
		
	| @@ -2176,11 +2176,15 @@ nav ul li:hover, nav ul li.active { | |||||||
|     min-height: calc(100vh - 64px - 64px - 87px); |     min-height: calc(100vh - 64px - 64px - 87px); | ||||||
| } | } | ||||||
|  |  | ||||||
| #wrapper.tabs_height{ | #wrapper.tabs_height, #suggestions.tabs_height{ | ||||||
|     height:calc(100vh - 48px - 64px - 32px); |     height:calc(100vh - 48px - 64px - 32px); | ||||||
|     overflow:auto; |     overflow:auto; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | #wrapper.tabs_height{ | ||||||
|  |     overflow:hidden; | ||||||
|  | } | ||||||
|  |  | ||||||
| .client-wrapper { | .client-wrapper { | ||||||
|     height: calc(100vh - 48px - 64px) !important; |     height: calc(100vh - 48px - 64px) !important; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -797,16 +797,20 @@ function resizePlaylistPlaying(playing) { | |||||||
|             document.querySelector("#all_chat").style.height = ""; |             document.querySelector("#all_chat").style.height = ""; | ||||||
|             document.querySelector("#chat-container").style.height = ""; |             document.querySelector("#chat-container").style.height = ""; | ||||||
|         } |         } | ||||||
|  |         var page = List.page; | ||||||
|  |         var canFit = List.can_fit; | ||||||
|         Helper.css("#wrapper", "height", window.innerHeight - 246 - subtract + "px"); |         Helper.css("#wrapper", "height", window.innerHeight - 246 - subtract + "px"); | ||||||
|         var temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71)+1; |         var temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71)+1; | ||||||
|         if(temp_fit > List.can_fit || temp_fit < List.can_fit){ |         if(temp_fit > List.can_fit || temp_fit < List.can_fit){ | ||||||
|             List.dynamicContentPage(-10); |             List.dynamicContentPage(-10); | ||||||
|         } |         } | ||||||
|         if(List.can_fit < temp_fit){ |         if(List.can_fit < temp_fit){ | ||||||
|  |             Helper.css(document.querySelector("#wrapper").children, "display", "none"); | ||||||
|             for(var i = 0; i < List.page + temp_fit; i++) { |             for(var i = 0; i < List.page + temp_fit; i++) { | ||||||
|                 Helper.css(document.querySelector("#wrapper").children[i], "display", "inline-flex"); |                 Helper.css(document.querySelector("#wrapper").children[i], "display", "inline-flex"); | ||||||
|             } |             } | ||||||
|         } else if(List.can_fit > temp_fit){ |         } else if(List.can_fit > temp_fit){ | ||||||
|  |             //Helper.css(document.querySelector("#wrapper").children, "display", "none"); | ||||||
|             Helper.css(document.querySelector("#wrapper").children[List.page + temp_fit], "display", "none"); |             Helper.css(document.querySelector("#wrapper").children[List.page + temp_fit], "display", "none"); | ||||||
|             var elements = document.querySelector("#wrapper").children; |             var elements = document.querySelector("#wrapper").children; | ||||||
|             for(var i = List.page + temp_fit; i < elements.length; i++) { |             for(var i = List.page + temp_fit; i < elements.length; i++) { | ||||||
| @@ -817,6 +821,7 @@ function resizePlaylistPlaying(playing) { | |||||||
|         List.element_height = (Helper.computedStyle("#wrapper", "height") / List.can_fit)-5.3; |         List.element_height = (Helper.computedStyle("#wrapper", "height") / List.can_fit)-5.3; | ||||||
|         Helper.css(".list-song", "height", List.element_height + "px"); |         Helper.css(".list-song", "height", List.element_height + "px"); | ||||||
|         Channel.set_title_width(); |         Channel.set_title_width(); | ||||||
|  |         List.dynamicContentPageJumpTo(page / canFit); | ||||||
|         if(!client) { |         if(!client) { | ||||||
|             var controlsPosition = document.querySelector("#controls").offsetHeight - Helper.computedStyle("#controls", "height"); |             var controlsPosition = document.querySelector("#controls").offsetHeight - Helper.computedStyle("#controls", "height"); | ||||||
|             if(document.querySelectorAll("#controls").length > 0 && !Helper.mobilecheck()) { |             if(document.querySelectorAll("#controls").length > 0 && !Helper.mobilecheck()) { | ||||||
|   | |||||||
| @@ -157,6 +157,8 @@ if(!Helper.mobilecheck() && (window.location.host != "localhost" && window.locat | |||||||
|         if(e == "Script error." || e.toString().indexOf(" ReferenceError: pagespeed is not defined") > -1) return true; |         if(e == "Script error." || e.toString().indexOf(" ReferenceError: pagespeed is not defined") > -1) return true; | ||||||
|         Helper.logs.unshift({log: e.toString().replace(/(\r\n|\n|\r)/gm,""), date: new Date(), lineno: lineno, colno: colno, source:source}); |         Helper.logs.unshift({log: e.toString().replace(/(\r\n|\n|\r)/gm,""), date: new Date(), lineno: lineno, colno: colno, source:source}); | ||||||
|         Helper.logs.unshift({log: chan != "" && chan != undefined ? chan.toLowerCase() : "frontpage", date: new Date()}); |         Helper.logs.unshift({log: chan != "" && chan != undefined ? chan.toLowerCase() : "frontpage", date: new Date()}); | ||||||
|  |  | ||||||
|  |         try { | ||||||
|             document.querySelector(".contact-form-content").remove(); |             document.querySelector(".contact-form-content").remove(); | ||||||
|             document.querySelector("#submit-contact-form").remove(); |             document.querySelector("#submit-contact-form").remove(); | ||||||
|             document.querySelector(".contact-modal-header").innerText = "An error occurred"; |             document.querySelector(".contact-modal-header").innerText = "An error occurred"; | ||||||
| @@ -168,6 +170,7 @@ if(!Helper.mobilecheck() && (window.location.host != "localhost" && window.locat | |||||||
|             <div class="error-code-container"> \ |             <div class="error-code-container"> \ | ||||||
|             <code id="error-report-code"></code> \ |             <code id="error-report-code"></code> \ | ||||||
|             </div>'); |             </div>'); | ||||||
|  |         } catch(e){} | ||||||
|         M.Modal.init(document.getElementById("contact")); |         M.Modal.init(document.getElementById("contact")); | ||||||
|         M.Modal.getInstance(document.getElementById("contact")).open(); |         M.Modal.getInstance(document.getElementById("contact")).open(); | ||||||
|         var cache = []; |         var cache = []; | ||||||
| @@ -1303,9 +1306,15 @@ window.addEventListener("resize", function(){ | |||||||
|            document.querySelector("#all_chat").style.height = ""; |            document.querySelector("#all_chat").style.height = ""; | ||||||
|            document.querySelector("#chat-container").style.height = ""; |            document.querySelector("#chat-container").style.height = ""; | ||||||
|         } else if(window.innerWidth < 601) { |         } else if(window.innerWidth < 601) { | ||||||
|             resizePlaylistPlaying(Player.player.getPlayerState() == YT.PlayerState.PLAYING || Player.soundcloud_player.isPlaying()); |             if(!client && !embed) { | ||||||
|  |                 var scPlaying = false; | ||||||
|  |                 try { | ||||||
|  |                     scPlaying = Player.soundcloud_player.isPlaying(); | ||||||
|  |                 } catch(e){} | ||||||
|  |                 resizePlaylistPlaying(Player.player.getPlayerState() == YT.PlayerState.PLAYING || scPlaying || Player.player.getPlayerState() == YT.PlayerState.BUFFERING); | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|  |         } | ||||||
|         var temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71)+1; |         var temp_fit = Math.round(Helper.computedStyle("#wrapper", "height") / 71)+1; | ||||||
|         if(temp_fit > List.can_fit || temp_fit < List.can_fit){ |         if(temp_fit > List.can_fit || temp_fit < List.can_fit){ | ||||||
|             List.dynamicContentPage(-10); |             List.dynamicContentPage(-10); | ||||||
| @@ -1372,8 +1381,10 @@ addListener("click", ".result-object", function(e){ | |||||||
|  |  | ||||||
| addListener("click", ".result-get-more-info", function(event) { | addListener("click", ".result-get-more-info", function(event) { | ||||||
|     this.preventDefault(); |     this.preventDefault(); | ||||||
|     var that = this; |     var that = this.target; | ||||||
|     var parent = that.parentElement.parentElement.parentElement.parentElement; |     var parent = that.parentElement.parentElement.parentElement.parentElement; | ||||||
|  |     if(that.tagName == "I") parent = parent.parentElement; | ||||||
|  |  | ||||||
|     var videoId = parent.getAttribute("data-video-id"); |     var videoId = parent.getAttribute("data-video-id"); | ||||||
|     var to_toggle = document.getElementById("inner-results").querySelectorAll("[data-video-id='" + videoId + "']")[0]; |     var to_toggle = document.getElementById("inner-results").querySelectorAll("[data-video-id='" + videoId + "']")[0]; | ||||||
|     to_toggle = to_toggle.children[0]; |     to_toggle = to_toggle.children[0]; | ||||||
| @@ -1403,15 +1414,50 @@ addListener("submit", '#contact-form', function(event){ | |||||||
|  |  | ||||||
| addListener("click", ".send-error-modal", function(event) { | addListener("click", ".send-error-modal", function(event) { | ||||||
|     this.preventDefault(); |     this.preventDefault(); | ||||||
|     document.getElementById("error-report-form").submit(); |     var captcha_response = grecaptcha.getResponse(); | ||||||
|  |  | ||||||
|  |     Helper.removeClass("#send-loader", "hide"); | ||||||
|  |     Helper.ajax({ | ||||||
|  |         type: "POST", | ||||||
|  |         headers: { | ||||||
|  |             "Content-Type": "application/json" | ||||||
|  |         }, | ||||||
|  |         data: { | ||||||
|  |             from: "no-reply@zoff.me", | ||||||
|  |             message: Helper.html("#error-report-code"), | ||||||
|  |             "g-recaptcha-response": captcha_response, | ||||||
|  |         }, | ||||||
|  |         url: "/api/mail", | ||||||
|  |         success: function(data){ | ||||||
|  |             if(data == "success"){ | ||||||
|  |                 Helper.removeElement(".send-error-modal"); | ||||||
|  |                 Helper.removeElement("#error-report-form"); | ||||||
|  |                 Helper.removeElement(".error-code-container"); | ||||||
|  |                 Helper.setHtml(".error-report-success", "Error report sent!"); | ||||||
|  |                 Helper.setHtml("#contact-container", "Mail has been sent, we'll be back with you shortly."); | ||||||
|  |                 window.location.reload(true); | ||||||
|  |             }else{ | ||||||
|  |                 Helper.setHtml(".error-report-success", "Mail was not sent, try again"); | ||||||
|  |             } | ||||||
|  |             Helper.addClass("#send-loader", "hide"); | ||||||
|  |         } | ||||||
|  |     }); | ||||||
|  |     return false; | ||||||
|  |     //document.getElementById("error-report-form").submit(); | ||||||
| }) | }) | ||||||
|  |  | ||||||
| addListener("submit", "#error-report-form", function(event) { | addListener("submit", "#error-report-form", function(event) { | ||||||
|     this.preventDefault(); |     this.preventDefault(); | ||||||
|  |     //event.preventDefault(); | ||||||
|  |  | ||||||
|     var captcha_response = grecaptcha.getResponse(); |     var captcha_response = grecaptcha.getResponse(); | ||||||
|  |  | ||||||
|     Helper.removeClass("#send-loader", "hide"); |     Helper.removeClass("#send-loader", "hide"); | ||||||
|     Helper.ajax({ |     Helper.ajax({ | ||||||
|         type: "POST", |         type: "POST", | ||||||
|  |         headers: { | ||||||
|  |             "Content-Type": "application/json" | ||||||
|  |         }, | ||||||
|         data: { |         data: { | ||||||
|             from: "no-reply@zoff.me", |             from: "no-reply@zoff.me", | ||||||
|             message: Helper.html("#error-report-code"), |             message: Helper.html("#error-report-code"), | ||||||
|   | |||||||
| @@ -630,7 +630,11 @@ var Player = { | |||||||
|         } else { |         } else { | ||||||
|             was_stopped = true; |             was_stopped = true; | ||||||
|             if(!embed && !client && window.location.pathname != "/") { |             if(!embed && !client && window.location.pathname != "/") { | ||||||
|                 resizePlaylistPlaying(false); |                 var scPlaying = false; | ||||||
|  |                 try { | ||||||
|  |                     scPlaying = Player.soundcloud_player.isPlaying(); | ||||||
|  |                 } catch(e){} | ||||||
|  |                 resizePlaylistPlaying(Player.player.getPlayerState() == YT.PlayerState.PLAYING || scPlaying || Player.player.getPlayerState() == YT.PlayerState.BUFFERING); | ||||||
|             } |             } | ||||||
|             if(!chromecastAvailable){ |             if(!chromecastAvailable){ | ||||||
|                 if(Helper.mobilecheck()) { |                 if(Helper.mobilecheck()) { | ||||||
| @@ -672,7 +676,11 @@ var Player = { | |||||||
|             //} |             //} | ||||||
|         } |         } | ||||||
|         if(!embed && !client && window.location.pathname != "/") { |         if(!embed && !client && window.location.pathname != "/") { | ||||||
|             resizePlaylistPlaying(true); |             var scPlaying = false; | ||||||
|  |             try { | ||||||
|  |                 scPlaying = Player.soundcloud_player.isPlaying(); | ||||||
|  |             } catch(e){} | ||||||
|  |             resizePlaylistPlaying(Player.player.getPlayerState() == YT.PlayerState.PLAYING || scPlaying || Player.player.getPlayerState() == YT.PlayerState.BUFFERING); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         Helper.css("#playpause", "visibility", "visible"); |         Helper.css("#playpause", "visibility", "visible"); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user