// ==UserScript== // @name Fullscreen Chat *OLD* // @namespace tag://kongregate // @description Adds a command to hide the game and expand chat // @author Ventero // @include http://www.kongregate.com/games/* // @date 06/29/10 // @version 1.5 // require http://kong.ventero.de/updates/70076.js // @license MIT license // @downloadURL none // ==/UserScript== // Written by Ventero (http://www.kongregate.com/accounts/Ventero) 02/27/10 // Based on an idea by SavageWolf (http://www.kongregate.com/accounts/SavageWolf - http://www.wolfthatissavage.com) // Licensed under MIT/X11 license // Copyright (c) 2010-2012 Ventero // Full text of the license here: // http://www.opensource.org/licenses/mit-license.php function init_resize(){ var dom = (typeof unsafeWindow === "undefined"?window:unsafeWindow); function d(c){ return document.getElementById(c); } if(!d("maingame")) return; function setWidth(width, gamewidth){ d("maingame").style.width = (gamewidth + width) + "px"; d("maingamecontent").style.width = (gamewidth + width) + "px"; d("flashframecontent").style.width = (gamewidth + width) + "px"; d("chat_container").style.width = width + "px"; d('chat_window_spinner').style.right = width/2 - 38 + "px"; if(d('high_scores_spinner')) d('high_scores_spinner').style.right = width/2 - 38 + "px"; z = d("kong_game_ui").childNodes for(i=0;is var isChrome = /Chrome/.test(navigator.appVersion); if(isChrome){ var inject = document.createElement("script"); var head = document.getElementsByTagName("head")[0]; inject.type = "text/javascript"; inject.textContent = init_resize.toString() + "\ninit_resize();"; (head || document.body).appendChild(inject); } else { init_resize(); } var call = document.createElement("option"); call.setAttribute("class","action"); call.setAttribute("value", "resize_chat"); call.setAttribute("onclick","resizeChat();"); call.innerHTML = "Fullscreen Chat"; var template = document.getElementById("chat_actions_dropdown_template"); var container = document.createElement("div"); container.appendChild(call); template.innerHTML = template.innerHTML.replace("", container.innerHTML + ""); [].slice.call(document.querySelectorAll(".chat_actions_container")).forEach(function(n){ var c = n.querySelector("select"); if(c) { c.appendChild(call); if(isChrome) c.setAttribute("onchange", "if(this.getValue() == 'resize_chat') resizeChat();"); } });