MyAnimeList(MAL) - Hover List, Notifications and Profile dropdown

Why click on the icons when you can hover?

  1. // ==UserScript==
  2. // @name MyAnimeList(MAL) - Hover List, Notifications and Profile dropdown
  3. // @version 1.0.8
  4. // @description Why click on the icons when you can hover?
  5. // @author Cpt_mathix
  6. // @match *://myanimelist.net/*
  7. // @exclude *://myanimelist.net/animelist*
  8. // @exclude *://myanimelist.net/mangalist*
  9. // @grant none
  10. // @namespace https://greasyfork.org/users/16080
  11. // @noframes
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. function hover_list_notifications_profile_dropdown() {
  16. var load = true;
  17.  
  18. var properties = {
  19. sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)
  20. interval: 0, // number = milliseconds for onMouseOver polling interval
  21. over: showInfo, // function = onMouseOver callback (required)
  22. timeout: 300, // number = milliseconds delay before onMouseOut
  23. out: hideInfo // function = onMouseOut callback (required)
  24. };
  25.  
  26. $('#header-menu > div.header-menu-unit.header-list').hoverIntent(properties);
  27.  
  28. $('#header-menu > div.header-menu-unit.header-notification').hoverIntent(properties);
  29.  
  30. $('#header-menu > div.header-menu-unit.header-profile').hoverIntent(properties);
  31.  
  32. function showInfo() {
  33. if ($(this).hasClass('header-notification') && load) {
  34. $('#header-menu > div.header-menu-unit.header-notification').find('.header-notification-button')[0].click();
  35. load = false;
  36. }
  37.  
  38. if (! $(this).hasClass('on')) {
  39. $('.header-list-dropdown').hide();
  40. $('.header-notification-dropdown').hide();
  41. $('.header-menu-dropdown').hide();
  42. $(this).find('.header-list-dropdown').show();
  43. $(this).find('.header-notification-dropdown').show();
  44. $(this).find('.header-notification-button').attr("aria-expanded", true);
  45. $(this).find('.header-menu-dropdown').show();
  46. $(this).addClass('on');
  47. }
  48. }
  49.  
  50. function hideInfo() {
  51. $(this).find('.header-list-dropdown').hide();
  52. $(this).find('.header-notification-dropdown').hide();
  53. $(this).find('.header-menu-dropdown').hide();
  54. $(this).removeClass('on');
  55. }
  56. }
  57.  
  58. var hoverScript = document.createElement('script');
  59. hoverScript.appendChild(document.createTextNode('('+ hover_list_notifications_profile_dropdown +')();'));
  60. (document.body || document.head || document.documentElement).appendChild(hoverScript);
  61. })();