Skip to content

Instantly share code, notes, and snippets.

@com4
Created July 30, 2014 19:06
Show Gist options
  • Save com4/d9da7d53a403b2dda234 to your computer and use it in GitHub Desktop.
Save com4/d9da7d53a403b2dda234 to your computer and use it in GitHub Desktop.
emoji icons on youtrack userscript
// ==UserScript==
// @name Youtrack Emoji-desu
// @namespace https://enderlabs.com/
// @version 0.1b
// @description parses emoji from included pages
// @copyright 2014+
// @include /^https?://eb\.honeystack\.io/.*$/
// @require https://code.jquery.com/jquery-latest.js
// @require https://s3.amazonaws.com/zzq/emoji.js
// ==/UserScript==
var css = "body{font-size:10pt;}\
.comment-controls {font-size:10pt;}\
span.emoji{-moz-box-orient:vertical;display:inline-block;vertical-align:baseline;width:1em;height:1em;background-size:1em;background-repeat:no-repeat;text-indent:-9999px}span.emoji-sizer{line-height:.81em;font-size:1em;margin:-2px 0}span.emoji-outer{display:-moz-inline-box;display:inline-block;height:1em;width:1em}span.emoji-inner{display:-moz-inline-box;display:inline-block;text-indent:-9999px;width:100%;height:100%;vertical-align:baseline}img.emoji{width:1em;height:1em}";
function addCss(cssString) {
try{
var head = document.getElementsByTagName('head')[0];
} catch(err) { return; }
var newCss = document.createElement('style');
newCss.type = "text/css";
newCss.innerHTML = cssString;
head.appendChild(newCss);
}
addCss(css);
emoji.img_path = 'https://raw.githubusercontent.com/github/gemoji/master/images/emoji/unicode/';
emoji.sheet_path = 'https://s3.amazonaws.com/zzq/sheet_64.png';
emoji.use_sheet = true;
emoji.init_env();
window.onload = function() {
var elems = document.getElementsByClassName("wiki");
for (var i = 0; i < elems.length; i++) {
elems[i].innerHTML = emoji.replace_colons(elems[i].innerHTML);
}
};
@butrom4ik
Copy link

И че это бля за гавно

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment