BS Shoutbox Popout

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

Από την 03/07/2017. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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...
})();