ao3 hide certain tags

suppress tags that aren't capitalized

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

  1. // ==UserScript==
  2. // @name ao3 hide certain tags
  3. // @namespace https://greasyfork.org/en/users/36620
  4. // @version 0.2
  5. // @description suppress tags that aren't capitalized
  6. // @author scriptfairy
  7. // @match http*://archiveofourown.org/*works*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. function isCap(str) {
  12. if (str[0] == str[0].toUpperCase() && str[0] !== str[0].toLowerCase()) {return true;}
  13. else {return false;}
  14. }
  15.  
  16. (function($) {
  17. var lis = $('.index .tags li');
  18. for (i=0;i<lis.length;i++) {
  19. var li = lis[i];
  20. var tagtext = li.innerText;
  21. if (tagtext.indexOf(" ") == -1 && !isCap(tagtext)) {
  22. li.style.display = 'none';
  23. }
  24. else if (tagtext.indexOf(" ") > -1 && !isCap(tagtext) && !isCap(tagtext.slice(tagtext.indexOf(" ")+1))) {
  25. li.style.display = 'none';
  26. }
  27. }
  28. })(window.jQuery);