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.00
  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", "630px");
  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. $(".widgetButton").each(function()
  25. {
  26. if ($(this).width() > $(this).parent().width() - 60)
  27. {
  28. $(this).css("max-width", "550px");
  29. $(this).css("word-wrap", "break-word");
  30. $(this).css("margin-bottom", "3px");
  31. $(this).addClass("wrap");
  32. $(this).addClass("block");
  33. }
  34. });
  35. }
  36. $(".nowrap").removeClass("nowrap");