Greasy Fork is available in English.

W2G Add-ons!

Add-ons for watch2gether to show parts of the website that can be changed or added.

Od 17.06.2020.. Pogledajte najnovija verzija.

// ==UserScript==
// @name         W2G Add-ons!
// @namespace    http://tampermonkey.net/
// @version      1
// @description  Add-ons for watch2gether to show parts of the website that can be changed or added.
// @author       Specy
// @match        https://www.watch2gether.com/rooms/*
// @grant        none
// ==/UserScript==

//Removes limits of the video size
var playSearch = document.getElementsByClassName("w2g-player-search")[0]
var videoContainer = document.getElementsByClassName("w2g-video-container")[0]
var playerContainer = document.getElementsByClassName("w2g-player-container")[0]
var playerVideo = document.getElementsByClassName("w2g-player-video")[0]
var userList = document.getElementsByClassName("w2g-userbar-list")[0]
playSearch.style.maxWidth = "none"
videoContainer.style.maxWidth = "none"
videoContainer.style.maxHeight = "none"
playerVideo.style.maxHeight = "none"
//----------------------------------------------------//
//For the actual resize
var savedSize = parseInt(localStorage.getItem("savedSize"))
if(isNaN(savedSize)) {
    savedSize = 80
}
resizeVideo(0)

var plusMinusStyle = "border:2px black solid; display:block; width:40px; height:40px; font-size:2em; font-weight:bold; border-radius:5px;"
var buttonPlus = document.createElement("button")
var buttonMinus = document.createElement("button")
buttonPlus.innerHTML = "+"
buttonPlus.style = plusMinusStyle
buttonMinus.innerHTML = "-"
buttonMinus.style = plusMinusStyle + "position:absolute; bottom:0;"
var buttonsContainer = document.createElement("div")

buttonPlus.addEventListener("click", function() {
    resizeVideo(2)
})
buttonMinus.addEventListener("click", function() {
    resizeVideo(-2)
})

function resizeVideo(resizeAmount) {
    savedSize += resizeAmount
    localStorage.setItem("savedSize", savedSize)
    playerContainer.style.width = savedSize + "%"
    playerContainer.style.marginLeft = (100 - savedSize) / 2 + "%"
}
buttonsContainer.appendChild(buttonPlus)
buttonsContainer.appendChild(buttonMinus)
userList.parentNode.insertBefore(buttonsContainer, userList.nextSibling);