Old YouTube Rating Colours

Makes the rating bar and thumbs have the original red & green look.

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

  1. // ==UserScript==
  2. // @name Old YouTube Rating Colours
  3. // @namespace http://kippykip.x10.mx/
  4. // @version 1.0
  5. // @description Makes the rating bar and thumbs have the original red & green look.
  6. // @author Kippykip
  7. // @match https://*.youtube.com/watch*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. function addGlobalStyle(css) {
  12. var head, style;
  13. head = document.getElementsByTagName('head')[0];
  14. if (!head) { return; }
  15. style = document.createElement('style');
  16. style.type = 'text/css';
  17. style.innerHTML = css;
  18. head.appendChild(style);
  19. }
  20.  
  21. //Rating bar
  22. addGlobalStyle('.video-extras-sparkbar-likes{float:left;height:2px;background: #00BB00 !important;}');
  23. addGlobalStyle('.video-extras-sparkbar-dislikes{float:left;height:2px;background: #BB0000 !important;}');
  24. addGlobalStyle('.like-button-renderer-like-button.yt-uix-button-toggled .yt-uix-button-content{color: #00BB00}');
  25. addGlobalStyle('.like-button-renderer-like-button.yt-uix-button.yt-uix-button-toggled:before{background:no-repeat url(//i.imgur.com/purOUgL.png) -299px -44px;background-size:auto;width:20px;height:20px}');
  26. addGlobalStyle('.like-button-renderer-like-button:active .yt-uix-button-content,.like-button-renderer-like-button.yt-uix-button-toggled .yt-uix-button-content{color:#00CC00}');
  27. addGlobalStyle('.like-button-renderer-like-button.yt-uix-button:active:before,.like-button-renderer-like-button.yt-uix-button.yt-uix-button-toggled:before{background:no-repeat url(//i.imgur.com/purOUgL.png) -299px -44px;background-size:auto;width:20px;height:20px}');
  28.  
  29. //Uncomment for red dislike button on the dislike thumb, however it will always be red! :(
  30. //addGlobalStyle('.like-button-renderer-dislike-button:before{background:no-repeat url(//i.imgur.com/2zFI0q0.png) -113px -83px;background-size:auto;width:20px;height:20px;padding-bottom:1px}');
  31.  
  32. //Comments!
  33. addGlobalStyle('.comments .like-count{margin-right:8px;color:#00BB00;font-size:9pt;vertical-align:top}');
  34. addGlobalStyle('.comments .sprite_like_on{display:none;background:no-repeat url(//i.imgur.com/ynVNO87.png) 0 -144px;background-size:auto;width:14px;height:14px}');
  35. addGlobalStyle('.comments .sprite_dislike_on{display:none;background:no-repeat url(//i.imgur.com/ynVNO87.png) 0 -53px;background-size:auto;width:14px;height:14px}');