JudgeZexion's Custom Emotes

Custom Emotes!!!

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

  1. // ==UserScript==
  2. // @name JudgeZexion's Custom Emotes
  3. // @namespace Rooms
  4. // @version 1.31
  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. { src:"https://wwcdn.weddingwire.com/wedding/1120001_1125000/1123438/thumbnails/400x400_1346783188237-partyhard.jpg", width:90, height:90, title:'partyhard'},
  21. { src:"http://i.imgur.com/YqdnTBX.jpg", width:90, height:90, title:'bigblacknigga'},
  22. { src:"http://i.imgur.com/RFlgdxc.gif", width:120, height:90, title:'lipsuckin'},
  23. ];
  24.  
  25. function addEmotes(){
  26. emotes.forEach(function(emote){
  27. window.$codes[emote.title || emote.name] = $('<img>', emote)[0].outerHTML;
  28. });
  29. }
  30.  
  31. function main(){
  32. if(!window.$codes || Object.keys(window.$codes).length === 0){
  33. setTimeout(main, 75);
  34. }else{
  35. addEmotes();
  36. }
  37. }
  38. if (window.document.readyState === 'complete') {
  39. main();
  40. } else {
  41. window.addEventListener('load', main, false);
  42. }