JudgeZexion's Custom Emotes

Custom Emotes!!!

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

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