DC - Chat

Personalisation du Chat. Adaptation du script de Gideon, ou d'Odul, je sais plus!

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name        	DC - Chat
// @namespace   	DreadCast
// @include     	http://www.dreadcast.net/Main
// @grant       	none
// @author 		Ianouf
// @date 		07/01/2013
// @version 		1.0
// @description 	Personalisation du Chat. Adaptation du script de Gideon, ou d'Odul, je sais plus!
// @compat 		Firefox, Chrome
// ==/UserScript==


$(document).ready(function() {

	//Couleurs dans le chat:
	var chatBox = $('#chatForm .text_chat').eq(0);
	chatBox.keypress(function(event) {
		 if ( event.which == 13 ) {
			var text = chatBox.val();
			text = text.replace(/\*R([^\*]+)\*R/gi, "[couleur=DF0101]$1[/couleur]");
			text = text.replace(/\*V([^\*]+)\*V/gi, "[couleur=298A08]$1[/couleur]");
			text = text.replace(/\*B([^\*]+)\*B/gi, "[couleur=0404B4]$1[/couleur]");
			text = text.replace(/\*J([^\*]+)\*J/gi, "[couleur=FFFF00]$1[/couleur]");
			if(text.substr(0,3) == '/me'){
				text = text.replace(/\*([^\*]+)\*/gi, "[couleur=FFFFFF]$1[/couleur]");
			}else{
				text = text.replace(/\*I([^\*]+)\*I/gi, "[i]$1[/i]");
				text = text.replace(/\*([^\*]+)\*/gi, "[couleur=7BEEFF][i]$1[/i][/couleur]");
			}
			chatBox.val(text);
		}
	});
});