// ==UserScript==
// @name okaymotes
// @namespace originalokay's emotes
// @version 1.0.2
// @description Nice memes
// @grant none
// @copyright 2015
// @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/bgMc6yx.gif", width:80, height:70, title:'haha'},
{ src:"http://i.imgur.com/7kekVJZ.gif", width:80, height:60, title:'abandonthread'},
{ src:"http://i.imgur.com/COb9tuY.gif", width:80, height:60, title:'smooch'},
{ src:"http://i.imgur.com/HAOrOzu.jpg", width:80, height:80, title:'fire'},
{ src:"http://i.imgur.com/ni4SGbJ.gif", width:90, height:80, title:'jam'},
{ src:"http://i.imgur.com/nQFMpKl.gif", width:90, height:80, title:'retard'},
{ src:"http://i.imgur.com/tg0Pc6O.jpg", width:90, height:80, title:'rip'},
{ src:"http://i.imgur.com/eR3Pg8U.gif", width:90, height:80, title:'shock'},
{ src:"http://i.imgur.com/Rp1mRoL.gif", width:100, height:80, title:'welcome'},
];
function addEmotes(){
emotes.forEach(function(emote){
window.$codes[emote.title || emote.name] = $('<img>', emote)[0].outerHTML;
});
}
function main(){
if(!window.$codes || Object.keys(window.$codes).length === 0){
setTimeout(main, 75);
}else{
addEmotes();
}
}
if (window.document.readyState === 'complete') {
main();
} else {
window.addEventListener('load', main, false);
}