Kod: Zaznacz cały
// ==UserScript==
// @name BW Chat+Emotki
// @version 1.0.2
// @author Cartman na bazie skryptu ThomassPWA z DW
// @description Emotikony na sb
// @namespace https://bugwie.com/memberlist.php?mode=viewprofile&u=98
// @namespace http://darkwarez.pl/forum/profil-1083311.html
// @include http://bugwie.com/*
// @include https://bugwie.com/*
// @require http://code.jquery.com/jquery-1.11.2.min.js
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
$(document).ready(function()
{
// Sprawdzenie czy czat jest włączony
// Dodanie skryptów do <head>
var script = document.createElement('script');
script.type = 'text/javascript';
script.innerHTML = "function emoticon(x) { document.getElementById('text_shoutbox').value = document.getElementById('text_shoutbox').value + ' ' + x + ' '; document.getElementById('text_shoutbox').focus(); updateCharEV(); }\n";
script.innerHTML+= "function updateCharEV() { document.getElementById(\"charCounterEV\").innerHTML = document.getElementById(\"text_shoutbox\").value.length; }\n";
script.innerHTML+= "function sendMessage(session) { sendComment(session); document.getElementById('charCounterEV').innerHTML = '0'; }";
document.getElementsByTagName('head')[0].appendChild(script);
// Dodanie kodu HTML do chatu
var chat = $('#text_shoutbox').parent().parent().parent().parent().parent();
var html = "<tr><td class=\"row\"><span class=\"row\"><\/b> Znaków: <b id=\"charCounterEV\">0<\/b>\/198<\/span><br /> <a href=\"javascript:emoticon(' :) ')\"><img src=\"images\/smilies\/).gif\" border=\"0\" alt=\"\" title=\"\"><\/a> <a href=\"javascript:emoticon(' :] ')\"><img src=\"images\/smilies\/fake-smile.gif\" border=\"0\" alt=\"Smile\" title=\"Smile\"><\/a> <a href=\"javascript:emoticon(' ;) ')\"><img src=\"images\/smilies\/;).gif\" border=\"0\" alt=\"Sad\" title=\"Sad\"><\/a> <a href=\"javascript:emoticon(' ;D ')\"><img src=\"images\/smilies\/big_wink.gif\" border=\"0\" alt=\"Facepalm\" title=\"Facepalm\"><\/a> <a href=\"javascript:emoticon(' :puppyeyes: ')\"><img src=\"images\/smilies\/puppy-eyes_anim.gif\" border=\"0\" alt=\"Cool\" title=\"Cool\"><\/a> <a href=\"javascript:emoticon(' :D ')\"><img src=\"images\/smilies\/big-grin.gif\" border=\"0\" alt=\"Laughing\" title=\"Laughing\"><\/a> <a href=\"javascript:emoticon(' :hihi: ')\"><img src=\"images\/smilies\/hihi_anim.gif\" border=\"0\" alt=\"Mad\" title=\"Mad\"><\/a> <a href=\"javascript:emoticon(' xD ')\"><img src=\"images\/smilies\/very-happy.gif\" border=\"0\" alt=\"Razz\" title=\"Razz\"><\/a> <a href=\"javascript:emoticon(' :lmao: ')\"><img src=\"images\/smilies\/hahaha.gif\" border=\"0\" alt=\"Embarassed\" title=\"Embarassed\"><\/a> <a href=\"javascript:emoticon(' :rotfl: ')\"><img src=\"images\/smilies\/rotfl_anim.gif\" border=\"0\" alt=\"Crying or Very sad\" title=\"Crying or Very sad\"><\/a> <a href=\"javascript:emoticon(' :letssin: ')\"><img src=\"images\/smilies\/lets_sin-anim.gif\" border=\"0\" alt=\"Evil or Very Mad\" title=\"Evil or Very Mad\"><\/a> <a href=\"javascript:emoticon(' :shy: ')\"><img src=\"images\/smilies\/shy.gif\" border=\"0\" alt=\"Twisted Evil\" title=\"Twisted Evil\"><\/a> <a href=\"javascript:emoticon(' ;P ')\"><img src=\"images\/smilies\/tongue2.gif\" border=\"0\" alt=\"Rolling Eyes\" title=\"Rolling Eyes\"><\/a> <a href=\"javascript:emoticon(' :thumbup: ')\"><img src=\"images\/smilies\/thumb-up_anim.gif\" border=\"0\" alt=\"Wink\" title=\"Wink\"><\/a> <a href=\"javascript:emoticon(':3')\"><img src=\"images\/smilies\/3.gif\" border=\"0\" alt=\"Neutral\" title=\"Neutral\"><\/a> <a href=\"javascript:emoticon(' :fack-off: ')\"><img src=\"images\/smilies\/fackoff.gif\" border=\"0\" alt=\"Mr. Green\" title=\"Mr. Green\"><\/a><\/td><\/tr>";
$('#text_shoutbox').attr('onpaste','updateCharEV();');
$('#text_shoutbox').attr('onchange','updateCharEV();');
$('#text_shoutbox').attr('maxlength','198');
$(chat).append(html);
// Pobranie ID sesji i ustawienie podczas wysyłania
var uid = new RegExp('([0-9]+)').exec( $('#shoutbox_scroll').attr('onsubmit') )[0];
$('#shoutbox_test').attr('onsubmit','sendMessage('+uid+'); return false;');
// Uchwyt odpowiedzialny za wciskanie klawiszy
$('#chatbarText').keyup(function(event) { if(event.which != 13) { updateCharEV(); if( initPwLink) updatePwTopic(); }});
// Uchwyt odpowiedzialny za wysyłanie formy
$('#shoutbox_test').submit(function(event) { if( $('#text_shoutbox').val().length > 3 ) { var count = GM_getValue('EvCount'); count = 0; count++; GM_setValue('EvCount',count); $('#msgCounterEV').text(count); $('#charCounterEV').text('0'); return false; } });
}
);
Możecie też podawać emordy, które byście chcieli.