/*
 * @package AJAX_Chat
 * @author Sebastian Tschan
 * @copyright (c) Sebastian Tschan
 * @license GNU Affero General Public License
 * @link https://blueimp.net/ajax/
 */

// Overriding client side functionality:

/*
// Example - Overriding the replaceCustomCommands method:
ajaxChat.replaceCustomCommands = function(text, textParts) {
	return text;
}
 */

//add /takeover to sigmabot
 ajaxChat.replaceCustomCommands = function(text, textParts) {
	switch(textParts[0]) {
		case '/takeover':
		text=text.replace('/takeover', ' ');
		return '<span class="chatBotMessage">' + text + '</span>';
		default:
		return text;
	}
}

//Welcome Message
ajaxChat.customInitialize = function() {
	ajaxChat.addChatBotMessageToChatList('Welcome to www.Sigma-Galant.com chat. Please keep it clean and polite, excersize tollerance and respect toward others, welcome newcomers and have fun!');
}

//Replace stuff people say:
ajaxChat.replaceCustomText = function(text) {
    text=text.replace(/fuck/gi, 'fork');
    text=text.replace(/shit/gi, 'shite');
    text=text.replace(/cunt/gi, 'beaver');
    return text;
}