InstaSynch emote list

Shows a list of available emotes, hidden by default and toggled by button. Click on an emote to post it.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        InstaSynch emote list
// @description Shows a list of available emotes, hidden by default and toggled by button. Click on an emote to post it.
// @namespace   oh no oh god oh man og nafaasdasd
// @include     http://instasync.com/r/*
// @version     1.23
// @run_at      document_end
// @grant       none
// ==/UserScript==

$("<style type='text/css'> .poll.always-active{ box-shadow:0px 0px 8px rgba(0,0,0,0.25); background-color:#FFF !important;} </style>").appendTo("head");

// 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 });"

function toDo(){
	var emotes_button = $("\
<button id='emotes' class='btn btn-xs btn-default' onclick='javascript: $(\"#poll_column.emotes\").toggle();' style='margin-left: 4px; margin-bottom: 6px;'>Emotes</button>");
	if($(".mod-control").is(":visible")){
		emotes_button.insertAfter("#create_poll_btn_column");
	}
	else{
		emotes_button.insertBefore(".mod-control");
	}
  emote_container=$("\
<div id='poll_column' class='emotes poll'><div class='poll always-active' style='overflow: auto;vertical-align: middle;height: 200px;'></div></div>").insertAfter("#poll_column")
  for(code in $codes){
    emote_container.find(">:first-child").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,2500);