// ==UserScript==
// @name Rushnerd
// @namespace Rushnerd's room
// @version 3.1
// @description New memes
// @grant none
// @copyright 2014
// @include *://*.instasynch.com/*
// @include *://instasynch.com/*
// @include *://*.instasync.com/*
// @include *://instasync.com/*
// ==/UserScript==
// { src:"", width:, height:, title:''},
// { src:"", width:, height:, name:''},
var emotes = [
{ src:"http://i.imgur.com/Bo8EnVS.png", width:60, height:60, title:'cod'},
{ src:"http://i.imgur.com/PbjjZNH.jpg", width:60, height:60, title:'beer'},
{ src:"http://i.imgur.com/6NTEerN.png", width:60, height:60, title:'reggie'},
{ src:"http://i.imgur.com/8Fl0LgE.png", width:60, height:60, title:'gabe'},
{ src:"http://i.imgur.com/OiH6MLz.gif", width:60, height:60, title:'lain'},
{ src:"http://i.imgur.com/5HGqgOI.gif", width:60, height:60, title:'high5'},
{ src:"http://i.imgur.com/CFgU0Fg.jpg", width:60, height:60, title:'happy'},
{ src:"http://i.imgur.com/inPDtzG.jpg", width:60, height:60, title:'coon'},
{ src:"http://i.imgur.com/6pesFxP.jpg", width:60, height:60, title:'sleep'},
{ src:"http://i.imgur.com/XVn1OVl.png", width:60, height:60, title:'fat'},
{ src:"http://i.imgur.com/lTk4T9p.jpg", width:60, height:60, title:'coonface'},
{ src:"http://i.imgur.com/qdc64WS.jpg", width:60, height:60, title:'fap'},
{ src:"http://i.imgur.com/mPJYIjD.jpg", width:60, height:60, title:'kiss'},
{ src:"http://i.imgur.com/NOV18ZB.gif", width:60, height:60, title:'grin'},
{ src:"http://i.imgur.com/h0WHExY.gif", width:60, height:60, title:'computer'},
{ src:"http://i.imgur.com/WvNRaEy.gif", width:60, height:60, title:'bearsuit'},
{ src:"http://i.imgur.com/jzyAnhX.png", width:60, height:60, title:'sanic'},
{ src:"http://i.imgur.com/U5bwIzm.png", width:60, height:60, title:'mysides'},
{ src:"http://i.imgur.com/oFvTMnF.jpg", width:60, height:60, title:'annoy'},
{ src:"http://i.imgur.com/b6YCnEh.jpg", width:60, height:60, title:'brock'},
{ src:"http://i.imgur.com/WyL1dCR.png", width:60, height:60, title:'datass'},
{ src:"http://i.imgur.com/61TNGXO.jpg", width:60, height:60, title:'furry'},
{ src:"http://i.imgur.com/ev8HaOz.jpg", width:60, height:60, title:'umad'},
{ src:"http://i.imgur.com/iIcv9ot.jpg", width:60, height:60, title:'doge'},
{ src:"http://i.imgur.com/dXyz0WX.gif", width:60, height:60, title:'bill'},
{ src:"http://i.imgur.com/6TArzzc.jpg", width:60, height:60, title:'usad'},
{ src:"http://i.imgur.com/VUSUBRd.gif", width:60, height:60, title:'roll'},
{ src:"http://i.imgur.com/Ef5JYWO.gif", width:60, height:60, title:'eat'},
{ src:"http://i.imgur.com/GLNQmF0.jpg", width:60, height:60, title:'party'},
{ src:"http://i.imgur.com/0kSBnoU.gif", width:60, height:60, title:'dance'},
{ src:"http://i.imgur.com/Lx7I2t7.gif", width:60, height:60, title:'nom'},
{ src:"http://i.imgur.com/u2L7kcT.gif", width:60, height:60, title:'carlton'},
{ src:"http://i.imgur.com/IEKY8eG.gif", width:60, height:60, title:'boogie'},
{ src:"http://i.imgur.com/VPc6Hi0.jpg", width:60, height:60, title:'merica'},
{ src:"http://i.imgur.com/43tnPmj.jpg", width:60, height:60, title:'facepalm'},
{ src:"http://i.imgur.com/z5MkDhx.jpg", width:60, height:60, title:'facepaw'},
{ src:"http://i.imgur.com/AWQAM7c.png", width:60, height:60, title:'pika'},
{ src:"http://i.imgur.com/yk3wRAV.gif", width:60, height:60, title:'wut'},
{ src:"http://i.imgur.com/WXOF1Ma.png", width:60, height:60, title:'scum'},
{ src:"http://i.imgur.com/RJzafu6.gif", width:60, height:60, title:'420'},
{ src:"http://i.imgur.com/b8u441e.gif", width:60, height:60, title:'panchi'},
{ src:"http://i.imgur.com/Yh9Jqos.gif", width:60, height:60, title:'genie'},
{ src:"http://i.imgur.com/2ULrUfU.gif", width:60, height:60, title:'what'},
{ src:"http://i.imgur.com/nxrszFS.gif", width:60, height:60, title:'catdance'},
{ src:"http://i.imgur.com/a1m7bcB.gif", width:60, height:60, title:'fail'},
{ src:"http://i.imgur.com/nR4MwCJ.gif", width:60, height:60, title:'groove'},
{ src:"http://i.imgur.com/FnkkrNI.gif", width:60, height:60, title:'sexymouse'},
{ src:"http://i.imgur.com/N86hquW.gif", width:60, height:60, title:'surprise'},
{ src:"http://i.imgur.com/XwHuHzi.gif", width:60, height:60, title:'ratdance'},
{ src:"http://i.imgur.com/5AmA9ao.gif", width:60, height:60, title:'frog'},
{ src:"http://i.imgur.com/MBHsHF8.gif", width:60, height:60, title:'hug'},
{ src:"http://i.imgur.com/oeqN7KJ.gif", width:60, height:60, title:'rocket'},
{ src:"http://i.imgur.com/EKnllY9.png", width:60, height:60, title:'mike'},
{ src:"http://i.imgur.com/BcsLfAJ.gif", width:60, height:60, title:'rlm'},
{ src:"http://i.imgur.com/qUk3YlA.png", width:60, height:60, title:'evans'},
{ src:"http://i.imgur.com/lPGc98U.gif", width:60, height:60, title:'alien'},
{ src:"http://i.imgur.com/vLSAfTo.gif", width:60, height:60, title:'donnie'},
{ src:"http://i.imgur.com/rrZCPlw.gif", width:60, height:60, title:'denny'},
{ src:"http://i.imgur.com/J6wTB7o.gif", width:60, height:60, title:'tearmeapart'},
{ src:"http://i.imgur.com/XECefbR.gif", width:60, height:60, title:'underwears'},
{ src:"http://i.imgur.com/7JOaU3P.gif", width:60, height:60, title:'mark'},
{ src:"http://i.imgur.com/87YEelJ.gif", width:60, height:60, title:'lisa'},
{ src:"http://i.imgur.com/Yb79Tv4.gif", width:60, height:60, title:'drunklisa'},
{ src:"http://i.imgur.com/eIWQCfi.gif", width:60, height:60, title:'ohhai'},
{ src:"http://i.imgur.com/adSrmSf.gif", width:60, height:60, title:'football'},
{ src:"http://i.imgur.com/OyAGmB1.jpg", width:60, height:60, title:'chin'},
{ src:"http://i.imgur.com/8DNLJNq.jpg", width:60, height:60, title:'realca'},
{ src:"http://i.imgur.com/lb0Q3ys.gif", width:60, height:60, title:'becky'},
{ src:"http://i.imgur.com/arOQ4N8.png", width:60, height:60, title:'raven'},
{ src:"http://i.imgur.com/ICSgZ7B.jpg", width:60, height:60, title:'york'},
{ src:"http://i.imgur.com/LZKmQov.jpg", width:60, height:60, title:'happyyork'},
{ src:"http://i.imgur.com/PM7QLmG.jpg", width:60, height:60, title:'devo'},
{ src:"http://i.imgur.com/RdUwLUv.gif", width:60, height:60, title:'ca'},
{ src:"http://i.imgur.com/QzGNniV.jpg", width:60, height:60, title:'ru'},
{ src:"http://i.imgur.com/dczH8K7.gif", width:60, height:60, title:'tim'},
{ src:"http://i.imgur.com/kx56UzU.gif", width:60, height:60, title:'chicken'},
{ src:"http://i.imgur.com/QHr4n33.gif", width:60, height:60, title:'rotor'},
{ src:"http://i.imgur.com/AJsUSRs.jpg", width:60, height:60, title:'vacation'},
{ src:"http://i.imgur.com/jn7BXCQ.gif", width:60, height:60, title:'value'},
{ src:"http://i.imgur.com/bK3QeSv.gif", width:60, height:60, title:'kill'},
{ src:"http://i.imgur.com/B46oV9w.gif", width:60, height:60, title:'lewd'},
{ src:"http://i.imgur.com/NpG29vI.gif", width:60, height:60, title:'evansdance'},
{ src:"http://i.imgur.com/NpG29vI.gif", width:60, height:60, title:'toast'},
{ src:"http://i.imgur.com/X7o7pBv.gif", width:60, height:60, title:'starwars'},
{ src:"http://i.imgur.com/vX9tN07.gif", width:60, height:60, title:'hoak'},
{ src:"http://i.imgur.com/upvYobM.gif", width:60, height:60, title:'stare'},
{ src:"http://i.imgur.com/ZQmQQCu.gif", width:60, height:60, title:'ninjaroll'},
{ src:"http://i.imgur.com/ZsrhKli.gif", width:60, height:60, title:'confused'},
{ src:"http://i.imgur.com/qNSkrwT.gif", width:60, height:60, title:'traitor'},
{ src:"http://i.imgur.com/3erSbOE.gif", width:60, height:60, title:'fire'},
{ src:"http://i.imgur.com/0QyReNe.gif", width:60, height:60, title:'dart'}
];
function addEmotes(){
for(var i = 0; i < emotes.length; i += 1){
var parameter = emotes[i];
window.$codes[parameter.title] = $('<img>', parameter)[0].outerHTML;
window.$codes[parameter.name] = $('<img>', parameter)[0].outerHTML;
}
}
function main(){
var oldOnConnected;
function onConnected(){
oldOnConnected.apply(undefined, arguments);
addEmotes();
}
if (!!window.global){ //old.instasync
oldOnConnected = window.global.onConnected;
window.global.onConnected = onConnected;
}else if(!!window.room){ //InstaSync 2.0
oldOnConnected = window.room.onConnected;
window.room.onConnected = onConnected;
}
}
if (window.document.readyState === 'complete') {
main();
} else {
window.addEventListener('load', main, false);
}