KAT - Limit Reputation Width

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

当前为 2015-07-07 提交的版本,查看 最新版本

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