Gaia Booty Grab Auto Re-Sizer

Re-sizes the aquarium to reduce lag thus allowing higher scores.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name           Gaia Booty Grab Auto Re-Sizer
// @description    Re-sizes the aquarium to reduce lag thus allowing higher scores.
// @include        http://www.gaiaonline.com/tank/*?*
// @include        http://www.gaiaonline.com/aquariumViewer/FishTankViewer.html?*
// @version 0.0.1.20140525024109
// @namespace https://greasyfork.org/users/2178
// ==/UserScript==

//settings
var StartSize = 150; //sets how tall it is to start with (in pixels).
var is = 25; //sets the buttons increase and decrease sizes in pixles.
//function
function resize(fx){
	var FishTank = document.getElementById('FishTank');
	var TnkHt = document.getElementById('TnkHt');
	var height = Number(FishTank.style.height.replace('px',''));
	var NewHeight = height+fx*is;
	if (NewHeight<0){NewHeight=0;}
	FishTank.style.height=NewHeight+'px';
	TnkHt.value=NewHeight;
}
if(document.body.offsetWidth>200){//avoid market preview
	//the following line makes the comment captcha stuff less blinding if you dont like it you can delete it.
	GM_addStyle('html{background-color:black;}#add_comment,#comment_box{text-align:center;}#recaptcha_image{opacity:.65}#recaptcha_response_field,#comment_body{background-color:gray !important;color:white}');

	var FishTank = document.getElementById('FishTank');
	if(FishTank){
		//set default styles
		FishTank.width='100%';
		FishTank.style.height=StartSize+'px';
		FishTank.removeAttribute('height');

		//set notification if flash can't find mouse
		FishTank.setAttribute('onmouseover','document.getElementById("alert").textContent=""');
		FishTank.setAttribute('onmouseout','document.getElementById("alert").textContent="Flash can\'t find mouse!!!"');

		//insert input fields
		var NewDiv = document.createElement('div');
		NewDiv.setAttribute('style','font-size:15px;width:100%;height:23px');
		NewDiv.innerHTML='<span style="font-size:12px;float:left;margin-right:68px;"><input id="plus" value="+'+is+' pixles" onmouseover="this.focus()" type="button"/><input id="minus" value="-'+is+' pixles" onmouseover="this.focus()" type="button"/></span><span style="color: white;float:right;">Aquarium height is <input id="TnkHt" onmouseover="this.select();this.focus();" title="Press \'Enter\' to apply changes." onkeypress="if (event.which==13)document.getElementById(\'FishTank\').style.height=this.value+\'px\'" style="width:30px;position:relative;top:1px;" value="'+StartSize+'" type="text"> <span>pixels.</span></span><center><span id="alert" style="color: red;">Flash can\'t find mouse!!!</span></center>';
		FishTank.parentNode.insertBefore(NewDiv,FishTank);

		//add event listener
		document.getElementById("plus").addEventListener('click', function(){ resize(1); }, false);
		document.getElementById("minus").addEventListener('click', function(){ resize(-1); }, false);
	}
	else{
		var input=document.createElement('input');
		input.value="Submit Captcha";
		input.type="submit";
		document.getElementById('tank_captcha').appendChild(input);
	}
}