IP.Chat - Auto-Resizing Popup

Automatically resizes the chat container to fill the window when in pop-up mode.

Tính đến 13-05-2014. Xem phiên bản mới nhất.

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

Bạn sẽ cần cài đặt một tiện ích mở rộng như Tampermonkey hoặc Violentmonkey để cài đặt kịch bản này.

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.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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	IP.Chat - Auto-Resizing Popup
// @namespace	Makaze
// @description	Automatically resizes the chat container to fill the window when in pop-up mode.
// @include	*
// @grant	none
// @version	1.0
// ==/UserScript==

if (document.body.id === 'ipboard_body' && document.getElementById('storage_chatroom') != null && window.location.href.match(/_popup=1/)) {
	document.getElementById('messages-display').style.transition = 'height 50ms ease-in-out';

	document.getElementById('messages-display').style.height = window.innerHeight - 30 - 121 + 'px';

	window.addEventListener('resize', function() {
		document.getElementById('messages-display').style.height = window.innerHeight - 30 - 121 + 'px';
	}, false);
}