JudgeZexion's Custom Emotes

Custom Emotes!!!

当前为 2015-07-17 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name JudgeZexion's Custom Emotes
  3. // @namespace Rooms
  4. // @version 1
  5. // @description Custom Emotes!!!
  6. // @grant none
  7. // @copyright 2015
  8. // @include *://*.instasynch.com/*
  9. // @include *://instasynch.com/*
  10. // @include *://*.instasync.com/*
  11. // @include *://instasync.com/*
  12. // ==/UserScript==
  13.  
  14. // { src:"", width:, height:, title:''},
  15. // { src:"", width:, height:, name:''},
  16.  
  17.  
  18. var emotes = [
  19. { src:"https://i.ytimg.com/vi/Z6gG3tKDBlk/maxresdefault.jpg", width:80, height:40, title:'doit'},
  20.  
  21.  
  22. ];
  23.  
  24. function addEmotes(){
  25. emotes.forEach(function(emote){
  26. window.$codes[emote.title || emote.name] = $('<img>', emote)[0].outerHTML;
  27. });
  28. }
  29.  
  30. function main(){
  31. if(!window.$codes || Object.keys(window.$codes).length === 0){
  32. setTimeout(main, 75);
  33. }else{
  34. addEmotes();
  35. }
  36. }
  37. if (window.document.readyState === 'complete') {
  38. main();
  39. } else {
  40. window.addEventListener('load', main, false);
  41. }