InstaSynch emote list

Shows a list of available emotes.

As of 2014-10-06. See the latest version.

// ==UserScript==
// @name        InstaSynch emote list
// @description Shows a list of available emotes.
// @namespace   oh no oh god oh man og nafaasdasd
// @include     http://instasynch.com/rooms/*
// @version     1.2
// @run_at      document_end
// @grant       none
// ==/UserScript==

// post a message
function sendMessage(message){
    $('#cin').val(message);
    $('#cin').trigger({ type : 'keypress', which : 13 });
}
sndmsg_pre = "$(\"#cin\").val(\""
sndmsg_post = "\");$(\"#cin\").trigger({ type : \"keypress\", which : 13 });"

$("\
<button id='emotes' onclick='javascript: $(\"#create-poll.emotes\").toggle();'>Emotes</button>").insertAfter("#create-pollBtn")

function toDo(){
  emote_container=$("\
<div id='create-poll' class='emotes' style='display:block;overflow:auto;vertical-align:middle; height: 200px;'></div>").insertAfter("#create-poll")
  for(code in $codes){
    emote_container.append("<tr onclick='javascript:"+sndmsg_pre+"/"+code+sndmsg_post+"'><td style='padding:5px 0px 5px 5px;'>"+code+":</td><td style='padding:5px 5px 5px 0px;'>"+$codes[code]+"</td></tr>")
  }
  emote_container.toggle();
}


// gotta delay the script to allow other scripts to settle down
setTimeout(toDo,3000);