// ==UserScript==
// @name SmileExt
// @namespace http://annimon.com/
// @description It's not even needed ;)
// @match http://annimon.com/*
// @version 0.2
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
var form = document.querySelector("form[name='mess']");
if(form !== null) {
var tags = document.querySelectorAll("table.tags_pan td");
if(tags.length > 0) {
GM_addStyle(getStyle());
var tag = document.createElement("a");
tag.title = "Смайлы";
tag.href = "javascript:void(0)";
tag.style.color = "#3a3a3a";
tag.style.textDecoration = "none";
tag.innerHTML = ":)";
var div = document.createElement("div");
div.id = "smiles";
var tagPanel = document.querySelector("div.tagspanel");
tag.addEventListener("click", function() {
div.style.width = tagPanel.offsetWidth + "px";
div.classList.toggle("show");
if(!tagPanel.contains(div)) {
tagPanel.appendChild(div);
getSmileDB(div);
}
});
div.addEventListener("click", function() {
div.classList.toggle("show");
});
window.addEventListener("resize", function() {
div.style.width = tagPanel.offsetWidth + "px";
});
var td = document.createElement("td");
td.appendChild(tag);
tags[0].parentNode.insertBefore(td, tags[0]);
}
}
function getSmileDB(div) {
var wrap = document.createElement("div");
div.appendChild(wrap);
var smileDB = "NULL";
if(typeof (smileDB = GM_getValue("smile_db")) === "undefined") {
var db = getJSONSmileDB();
for(var i=0; idiv{padding:0;margin:10px;text-align:left}#smiles p{font-weight:700;padding:0;margin:5px 0}#smiles a{padding:0;margin:0}#smiles img{display:inline-block;padding:0;margin:2px 5px;vertical-align:middle}.show{display:block!important}";
}
function getJSONSmileDB() {
return [{"category":"Эмоции","smiles":[["ah","14.gif"],["bis","15.gif"],["blabla","16.gif"],["bratok","17.gif"],["cry","18.gif"],["dovolen","19.gif"],["fuu","21.gif"],["gg","22.gif"],["gy","23.gif"],["gyy","24.gif"],["ha","25.gif"],["hack","26.gif"],["haha","27.gif"],["helpme","28.gif"],["hm","29.gif"],["hrap","30.gif"],["isterika","31.gif"],["kraken","33.gif"],["krasn","34.gif"],["kub","35.gif"],["lol","36.gif"],["plak","37.gif"],["preved","38.gif"],["rofl","39.gif"],["rzhu","40.gif"],["shok","42.gif"],["sljuni","43.gif"],["sorry","44.gif"],["stena","45.gif"],["swoon","46.gif"],["yahoo","47.gif"],["zloj","48.gif"],["biggrin","144.gif"],["dum","151.gif"],["fu","152.gif"],["facepalm","162.gif"],["aaa","164.gif"],["aj","165.gif"],["facepalm2","166.gif"],["gordo","167.gif"],["ispug","168.gif"],["plushit","170.gif"],["zharko","171.gif"],["nus","172.gif"],["umora","173.gif"],["or","232.gif"],["wow","256.gif"],["wow2","283.png"],["mat","302.gif"],["lol2","314.gif"],["seestars","315.gif"],["pardon","334.gif"],["pryg","339.gif"],["triplefacepalm","346.png"],["кек","347.png"],["кек2","354.gif"]]},{"category":"Спорт","smiles":[["beg","49.gif"],["best","50.gif"],["boks","51.gif"],["mjach","52.gif"],["basket","119.gif"],["plavaet","183.gif"],["rybalka","184.gif"],["tennis","185.gif"],["tennis2","186.gif"],["hokkej","206.gif"],["wtanga","207.gif"],["fan","213.gif"],["fanaty","214.gif"],["salto","258.gif"]]},{"category":"Техника","smiles":[["nokia","53.gif"],["samole","54.gif"],["skuter","55.gif"],["velo","56.gif"],["helloworld","150.gif"],["tank","191.gif"],["bolid","192.gif"],["lamer","218.gif"]]},{"category":"Любовь","smiles":[["2heart","136.gif"],["celuyu","137.gif"],["d","138.gif"],["m","139.gif"],["miwka","140.gif"],["sex","141.gif"],["serdce","142.gif"],["roza","187.gif"],["roza4","188.gif"],["roza3","189.gif"],["romawki","190.gif"],["roza2","220.gif"]]},{"category":"Животные","smiles":[["kot","155.png"],["mudr","156.png"],["akula","193.gif"],["babochka","194.gif"],["kitti","196.gif"],["martywka","197.gif"],["pingvin","200.gif"],["angrycat","263.png"],["nya","264.png"],["lowadka","304.gif"],["horseshe","306.gif"],["nasobakah","307.gif"],["osminog","357.gif"]]},{"category":"Жесты","smiles":[["apl","89.gif"],["clapping","90.gif"],["druj","91.gif"],["druzhba","92.gif"],["kul2","93.gif"],["xz","94.gif"],["nono","95.gif"],["sarkastik","96.gif"],["kul3","169.gif"],["nopanic","174.gif"],["cool","175.gif"],["es","176.gif"],["molchu","177.gif"],["victory","178.gif"],["ploho","179.gif"],["superski","180.gif"],["fuckoff","198.gif"],["figa","253.gif"],["sumas","254.gif"],["sumas2","255.gif"],["nevozm","301.gif"],["stranno","303.gif"],["yes","310.gif"],["glad","320.gif"],["poklon","355.gif"]]},{"category":"Праздники","smiles":[["ded_moroz","86.gif"],["ded_snegur2","87.gif"],["snegur","88.gif"],["dr","227.gif"],["tost","228.gif"],["pivanet","230.gif"],["kruzhki","235.gif"],["alkawi","236.gif"],["pivo2","237.gif"],["pivo3","238.gif"],["salut","260.gif"],["salut2","261.gif"],["salut3","262.gif"]]},{"category":"Разное","smiles":[["russia","71.gif"],["anm","72.gif"],["anm2","73.gif"],["banan","74.gif"],["belarus","75.gif"],["demrule","76.gif"],["fire","77.gif"],["kopilka","78.gif"],["mail","79.gif"],["pylesos","81.gif"],["teleskop","82.gif"],["vampir","83.gif"],["vizard","84.gif"],["yad","85.gif"],["sho","110.gif"],["yy","111.gif"],["patstulom","113.gif"],["zona","117.gif"],["idea","160.gif"],["von","161.png"],["2druga","215.gif"],["benzopila","216.gif"],["derg","217.gif"],["draka","221.gif"],["palach","222.gif"],["puwki","223.gif"],["starwar","224.gif"],["vglaz","226.gif"],["chit","240.gif"],["rain","241.gif"],["kur","242.gif"],["night","243.gif"],["sortir","244.gif"],["zvezdy","245.gif"],["hackcat","257.gif"],["zhelud","266.gif"],["zub2","267.gif"],["owibochka","284.gif"],["vsempr","285.gif"],["google","286.gif"],["ogurec","289.png"],["ogurec2","290.png"],["siski","299.gif"],["oops","300.gif"],["ogurjum","305.gif"],["tomat","308.gif"],["жесть","311.gif"],["stul","316.gif"],["o_o","336.gif"],["sad","348.png"],["nashka","351.png"],["ukraine","352.gif"]]},{"category":"Для администрации","smiles":[["adm","57.gif"],["ban","58.gif"],["ban2","59.gif"],["ban3","60.gif"],["closed","61.gif"],["devil","62.gif"],["dont","63.gif"],["flood","64.gif"],["huligan","65.gif"],["moder","66.gif"],["moder2","67.gif"],["offtop","68.gif"],["pravila","69.gif"],["flood2","287.gif"],["otkaz","317.gif"],["eviloldman","338.png"]]},{"category":"Быстрые смайлы","smiles":[["","97.gif"],["","98.gif"],["","99.gif"],["-","100.gif"],["","101.gif"],["","103.gif"],["","104.gif"],["-","106.gif"],["","107.gif"],["-","108.gif"],["","109.gif"],["","114.gif"],["-","181.gif"],["-","182.gif"],["","225.gif"],["","233.gif"]]},{"category":"Персонажи","smiles":[["emo","20.gif"],["killseva","32.gif"],["seva","41.gif"],["ktulhu","112.gif"],["ofiget","116.png"],["doodle","118.png"],["princess","133.gif"],["princess2","134.gif"],["gotess","135.gif"],["bart","145.gif"],["webdemon","146.gif"],["scream","148.gif"],["bender","154.gif"],["cap","159.png"],["ghost","195.gif"],["puh","219.gif"],["holms","239.gif"],["angel","246.gif"],["cherep","247.gif"],["mertvec","248.gif"],["skosoj","249.gif"],["zlodej","250.gif"],["killer","252.gif"],["girl","288.gif"],["lenin","309.png"],["bomberman","313.gif"],["nelson","322.png"],["sparta","330.gif"],["gordon","331.gif"],["hurray","332.gif"],["rambo","335.png"],["oak","337.png"],["babka","340.png"],["maga","341.png"],["ukr","343.gif"],["maga2","344.png"],["pony","353.gif"],["ded","356.gif"]]},{"category":"Значки","smiles":[["selov","70.gif"],["php","80.gif"],["torrent","121.png"],["linux","123.png"],["se","127.gif"],["walkman","128.gif"],["java2","129.gif"],["cpp","132.png"],["666","149.gif"],["miha","153.png"],["oblivion","158.png"],["ps","234.gif"],["bomba","251.gif"],["ppm","259.png"],["chrome","291.png"],["vk","292.png"],["windows","293.png"],["opera","294.png"],["android","295.png"],["java","296.png"],["csharp","297.png"],["python","298.png"],["linux2","312.gif"],["bt","318.png"],["skype","321.png"],["strela","324.gif"],["strela2","325.gif"],["ahtung","326.gif"],["annimon","327.png"],["idea2","328.gif"],["question","329.gif"],["bredometr","333.gif"],["error","342.png"],["fapable","345.png"]]},{"category":"Музыка","smiles":[["git","199.gif"],["metal","202.gif"],["dj","203.gif"],["punk","204.gif"],["music","205.gif"],["rojal","208.gif"],["rock","209.gif"],["drum","210.gif"],["bajan","211.gif"],["truba","212.gif"],["punk2","231.gif"],["band","323.gif"]]}];
}