KAT - Limit Reputation Width

Makes it so that column goes onto new line for long names

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        KAT - Limit Reputation Width
// @namespace   LimitReputationWidth
// @version     1.04
// @description Makes it so that column goes onto new line for long names
// @match     http://kat.cr/user/*/reputation*
// @match     https://kat.cr/user/*/reputation*
// ==/UserScript==

$("td.left").css("max-width", "625px");
$("td.left").css("word-wrap", "break-word");

/** Wrap mode on (true) / off (false) - on by default
 * 
 *  If on, the torrent name will continue on the next line - works in most cases
 *  If off, only the first 630 pixels of the column/title is visible, anything extra is simply hidden
 */

var wrap = true;

if (wrap == true)
{
    var max = "750px";
    if ($(".sideBar").is(':visible')) { max = "550px"; }
    $(".widgetButton").each(function()
   	{
        if ($(this).width() > $(this).parent().width() - 60)
        {
            $(this).css("max-width", max);
            $(this).css("word-wrap", "break-word");
            $(this).css("margin-bottom", "3px");
            $(this).addClass("wrap");
            $(this).addClass("block");
        }
    });
}
$(".nowrap").removeClass("nowrap");