BS Shoutbox Popout

popup für die shoutbox wahlweise als iframe auf der video seite

As of 03.07.2017. See ბოლო ვერსია.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         BS Shoutbox Popout
// @namespace    http://tampermonkey.net/
// @version      1.22
// @description  popup für die shoutbox wahlweise als iframe auf der video seite
// @author       jonnyy / High_village
// @match        https://bs.to/*
// @grant        none
// @icon         https://bs.to/favicon.ico
// ==/UserScript==

(function() {
	'use strict';
	var t;
	if(!location.hash.split("popup=")[1]||location.hash.split("popup=")[1].indexOf("true")===-1){
		if(document.getElementById("navigation")){
			if(location.href.replace(location.hash,"")=="https://bs.to/"||location.href.replace(location.hash,"")=="https://bs.to/home"){
				document.getElementById("shoutbox").children[0].appendChild(t=document.getElementById("navigation").children[0].children[0].cloneNode(true));
				t.innerText="POPOUT";
				t.style.cursor="pointer";
				var width=60;
				t.style.float="right";
				t.style.left=t.parentElement.clientWidth-width+"px";
				t.onclick=function(){
					var wnd=open("https://bs.to/home#popup=true",null,{width:280,height:500,location:0,menubar:0});
				};
			}else{
					localStorage.setItem("BSTOPOPUP",true);
					var btn = document.createElement("BUTTON");
					document.body.appendChild(btn);
					btn.onmouseover=function(a,b){
						a.target.children[0].style.visibility="visible";
					};
					btn.onmouseleave=function(a){
						a.target.children[0].style.visibility="hidden";
					};
					var s=btn.style;
					s.position="fixed";
					s.height="20px";
					s.width="20px";
					s.top="0";
					s.zIndex=20999999999;
					var i = document.createElement('iframe');
					i.style.position="fixed";
					btn.appendChild(i);
					i.frameBorder = "0";
					i.src = "https://bs.to/home#popup=true";
					var st=i.style;
					st.height="700px";
					st.width="435px";
					st.top="0px";
					st.zIndex=20999999999;
					st.visibility="hidden";
				
			}
		}
	}else if(location.hash.split("popup=")[1].indexOf("true")===0){
		var el=document.getElementsByClassName("home")[0].children;
		for(var i=el.length-1;i>-1;i--){
			if(el[i].localName=="h2"){
				el[i].remove();
			}
			for(var j=el[i].children.length-1;j>-1;j--){
				if(el[i].children[j].id!=="shoutbox"){
					el[i].children[j].remove();
				}else{
					el[i].children[j].style.marginTop="0px";
					el[i].children[j].style.position="fixed";
					el[i].children[j].style.left="5px";
				}
			}

		}
		$("nav")[0].remove();
		$("header")[0].remove();
		$("footer")[0].remove();
		document.getElementsByClassName("home")[0].style.height="0px";
		document.getElementsByClassName("home")[0].style.padding="0px";
		document.getElementById("root").style.height="0px";
		document.getElementById("root").style.paddingBottom="0px";
		window.resizeTo(435,700);
	}
	// Your code here...
})();