KAT - Limit Reputation Width

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

目前為 2014-10-04 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name KAT - Limit Reputation Width
  3. // @namespace LimitReputationWidth
  4. // @version 1.01
  5. // @description Makes it so that column goes onto new line for long names
  6. // @require http://code.jquery.com/jquery-latest.js
  7. // @match http://kickass.to/user/*/reputation*
  8. // @match https://kickass.to/user/*/reputation*
  9. // ==/UserScript==
  10.  
  11. $("td.left").css("max-width", "625px");
  12. $("td.left").css("word-wrap", "break-word");
  13.  
  14. /** Wrap mode on (true) / off (false) - on by default
  15. *
  16. * If on, the torrent name will continue on the next line - works in most cases
  17. * If off, only the first 630 pixels of the column/title is visible, anything extra is simply hidden
  18. */
  19.  
  20. var wrap = true;
  21.  
  22. if (wrap == true)
  23. {
  24. var max = "750px";
  25. if ($(".sideBar").is(':visible')) { max = "550px"; }
  26. $(".widgetButton").each(function()
  27. {
  28. if ($(this).width() > $(this).parent().width() - 60)
  29. {
  30. $(this).css("max-width", max);
  31. $(this).css("word-wrap", "break-word");
  32. $(this).css("margin-bottom", "3px");
  33. $(this).addClass("wrap");
  34. $(this).addClass("block");
  35. }
  36. });
  37. }
  38. $(".nowrap").removeClass("nowrap");