Twitter - Match username with user color

Change the color of the username to match with the desired user color

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

  1. // ==UserScript==
  2. // @name Twitter - Match username with user color
  3. // @copyright hzmen1 <hzmen1@hotmail.com>
  4. // @version 1.7.1
  5. // @namespace https://greasyfork.org/users/11517
  6. // @homepageURL https://greasyfork.org/scripts/9952
  7. // @description Change the color of the username to match with the desired user color
  8. // @match *://twitter.com/*
  9. // @include /^https?://twitter.com
  10. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
  11. // @grant none
  12. // @author hzmen1
  13. // @license (CC) by-nc-sa 3.0
  14. // @run-at document-end
  15. // ==/UserScript==
  16.  
  17. (function(win){var main=function(){Array.prototype.slice.call(win.document.querySelectorAll('#page-container a.twitter-timeline-link[href*="t.co"]'),0).forEach(function(el){if(el.dataset && el.dataset.expandedUrl){el.href=el.dataset.expandedUrl;}});};main();win.onscroll=main;})(window);
  18.  
  19. $("a").click(function(){someFunction();});
  20. $(document).ready(function(){someFunction();});
  21.  
  22. setInterval(function(){someFunction()},50);
  23.  
  24. function someFunction(){
  25. $('.ProfileHeaderCard-nameLink').removeClass('u-textInheritColor');
  26. $('.ProfileNameTruncated-link').removeClass('u-textInheritColor');
  27. $('.ProfileNameTruncated-link').addClass('u-textUserColor');
  28. $('.ProfileNameTruncated-link').addClass('bypassuser');
  29. $('.ProfileNameTruncated-link').removeClass('ProfileNameTruncated-link');
  30.  
  31. $('.Icon--verified').addClass('u-textUserColor');
  32. $('.Icon--protected').addClass('u-textUserColor');
  33. $('.Icon--translator').addClass('u-textUserColor');
  34.  
  35. $('.twitter-atreply').removeClass('pretty-link');
  36. $('.twitter-hashtag').removeClass('pretty-link');
  37. $('.twitter-atreply').addClass('u-textUserColor');
  38. $('.twitter-hashtag').addClass('u-textUserColor');
  39.  
  40. $('.avatar').addClass('u-bgUserColor');
  41. $('.ProfileHeaderCard-location').addClass('u-textUserColor');
  42. $('.bird-topbar-etched').addClass('u-textUserColor');
  43. $('.DashboardProfileCard-name').addClass('u-textUserColor');
  44. $('.Icon--person').addClass('u-textUserColor');
  45. $('.PhotoRail-heading').addClass('u-textUserColor');
  46. $('.ProfileHeaderCard-joinDate').addClass('u-textUserColor');
  47. $('.ProfileHeaderCard-url').addClass('u-textUserColor');
  48. $('.ProfileHeaderCard-birthdate').addClass('u-textUserColor');
  49. $('.ProfileAvatar').addClass('u-borderUserColor');
  50. $('.avatar').addClass('u-borderUserColor');
  51. $('.DMAvatar-image').addClass('u-borderUserColor');
  52. $('.DashboardProfileCard-avatarImage').addClass('u-borderUserColor');
  53. $('.hovercard.profile-card .ProfileCard-avatarImage').addClass('u-borderUserColor');
  54. }