InstaSynchP Emote Names

Show emote names when hovering over the image

目前为 2014-10-27 提交的版本。查看 最新版本

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