InstaSynchP Emote Names

Show emote names when hovering over the image

  1. // ==UserScript==
  2. // @name InstaSynchP Emote Names
  3. // @namespace InstaSynchP
  4. // @description Show emote names when hovering over the image
  5.  
  6. // @version 1.0.5
  7. // @author Zod-
  8. // @source https://github.com/Zod-/InstaSynchP-Emote-Names
  9. // @license MIT
  10.  
  11. // @include *://instasync.com/r/*
  12. // @include *://*.instasync.com/r/*
  13. // @grant none
  14. // @run-at document-start
  15.  
  16. // @require https://greasyfork.org/scripts/5647-instasynchp-library/code/InstaSynchP%20Library.js?version=37716
  17. // ==/UserScript==
  18.  
  19. function EmoteNames(version) {
  20. "use strict";
  21. this.version = version;
  22. this.name = 'InstaSynchP Emote Names';
  23. }
  24.  
  25. EmoteNames.prototype.executeOnce = function () {
  26. "use strict";
  27. events.on(this, 'AddMessage', function () {
  28. //check all <img> in case there can be more in the future
  29. $('#chat_messages > :last-child > span.message > img').each(function () {
  30. var emote;
  31. for (emote in window.$codes) {
  32. if (window.$codes.hasOwnProperty(emote) &&
  33. window.$codes[emote].contains($(this).attr('src'))) {
  34. $(this).attr('title', emote);
  35. break;
  36. }
  37. }
  38. });
  39. });
  40. };
  41.  
  42. window.plugins = window.plugins || {};
  43. window.plugins.emoteNames = new EmoteNames('1.0.5');