FFL Chat Modifier

This userscript allows you to run the FFL LIVE chat within a tab in your browser and allows for some new BBCode!

目前為 2015-09-24 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         FFL Chat Modifier
// @namespace    http://fusionfalllegacy.com/
// @version      1.0
// @description  This userscript allows you to run the FFL LIVE chat within a tab in your browser and allows for some new BBCode!
// @author       L0L_Limewire
// @match        http://interact.modulatornetwork.com/forums/chat/index.php
// @grant        none
// ==/UserScript==

// ADDED FEATURES LIST
// [textcolor=#COLOR IN HEX]message[/textcolor]
// [code]message[/code]
// [img]image url[/img]
// enabled opening the LIVE chat in a tab

// allow for tab chat to be open

window.name = 'ModNetFMHQliveMainWindow';
top = self;

// very hacky but it works

// now for the real features

sound = new Audio("http://s1.vocaroo.com/media/download_temp/Vocaroo_s1i83BLxw0A0.mp3"); // you're welcome Professor

NaughtyWords = [ // avert your eyes, children!
    'bastard',
    'basstard',
    'basterd',
    'bassterd',
    'bas tard',
    'bass tard',
    'bas terd',
    'bass terd',
    'asshole',
    'asshoie',
    'assho1e',
    'assho!e',
    'ass',
    'azzhole',
    'azzhoie',
    'azzho1e',
    'azzho!e',
    'beer',
    'boob',
    'badb',
    'bitch',
    'cunt',
    'dammit',
    'damm!t',
    'damm1t',
    'dammlt',
    'damn',
    'dick',
    'd!ck',
    'd1ck',
    'dlck',
    'fuc',
    'fuk',
    'fuck',
    'fux',
    'nipple',
    'nude',
    'nudity',
    'p!ss',
    'p1ss',
    'penis',
    'pen!s',
    'pen1s',
    'piss',
    'puss',
    'sex',
    'shit',
    'sh!t',
    'sh1t',
    'shlt',
    'tits',
    'vagisil',
    'vagina',
    'arse',
    'hel',
    'hell',
    'bullass',
    'fvck',
    'twat',
    'jerkwad',
    'jack coco',
    'jackazz',
    'jack azz',
    'porn',
    'customass',
    'sasser',
    'sasst',
    'helpuffs',
    'cock',
    'faggot',
    'fagot',
    'fagot',
    'fagot',
    'fag',
    'nigger',
    'n!gger',
    'panty',
    'porm',
    'pr0n',
    'anal',
    'ccoco',
    'semen',
    'whore',
    'biggot',
    'chink',
    'clit',
    'vag',
    'slut',
    'skank',
    'hooker',
    'prostitute',
    'nigga',
    'thot',
    'hentai'
];

ajaxChat.bbCodeTags = ['b','i','u','strike','quote','color','url','img','textcolor']; //add new bbcode and revive old bbcode
ajaxChat.settings.bbCodeImages = true; // enable images

ajaxChat.replaceBBCodeCallback = function(str, p1, p2, p3) { // replace functions to allow for new features
	// Only replace predefined BBCode tags:
	if(!ajaxChat.inArray(ajaxChat.bbCodeTags, p1)) {
		return str;
	}
	// Avoid invalid XHTML (unclosed tags):
	if(ajaxChat.containsUnclosedTags(p3)) {
		return str;
	}	
	switch(p1) {
		case 'color':
			return ajaxChat.replaceBBCodeColor(p3, p2);
        case 'textcolor': // [color] tag but allows for use within nested colors such as 
            return ajaxChat.replaceBBCodeColor(p3,p2);
		case 'url':
			return ajaxChat.replaceBBCodeUrl(p3, p2);
		case 'quote':
			return ajaxChat.replaceBBCodeQuote(p3, p2);
		case 'u':
			return ajaxChat.replaceBBCodeUnderline(p3);
		case 'strike':
			return ajaxChat.replaceBBCodeStrike(p3);
		case 'img': // [img] tag
			return ajaxChat.replaceBBCodeImage(p3);
		default:
			return ajaxChat.replaceCustomBBCode(p1, p2, p3);
	}
};

ajaxChat.replaceBBCodeImage = function(url) { // function enabled
	var regExpUrl;
	regExpUrl = new RegExp(this.regExpMediaUrl,'');
	if(!url || !url.match(regExpUrl))
		return url;
	url = url.replace(/\s/gm, this.encodeText(' '));
	return	'<a href="'+url+'" onclick="window.open(this.href); return false;">'+'<img class="bbCodeImage" style="max-width:250px;" src="'+url+'" alt="Click to view full-size image." onload="ajaxChat.updateChatlistView();"/></a>';
};

ajaxChat.replaceBBCodeColor = function(content, attribute) { // color limitations removed
    if(this.settings.bbCodeColors) {
		return 	'<span style="color:'+ attribute + ';">'+ this.replaceBBCode(content)+ '</span>';
	}
	return content;
};

ajaxChat.replaceCustomText = function(text){
    var doAlert,index;
    doAlert = false; // do sound upon naughty word
    for(index in NaughtyWords){
        naughty = NaughtyWords[index];
        if(text.search(new RegExp('\\b'+naughty+'\\b','gi'))!=-1){
            doAlert = true; // enable sound playback
        }
        text = text.replace(new RegExp('\\b'+naughty+'\\b','gi'), 'coco'); // and then censor the word
    }
    if(doAlert === true){
        sound.play();
    }
    return text;
};