Title: [JavaScript] name replace fix
Author: boxes
Pastebin link: http://pastebin.com/R7b5XJrr
First Edit: Thursday 26th of July 2012 10:43:15 AM CDT
Last Edit: Thursday 26th of July 2012 10:43:15 AM CDT
function loadExternalJS() {
//littlegirlshow
var facecodes = {
// Emotes:
//names
"Boxes:": "Faggot:",
// Pony with socks emotes:
":applebloom:":'
',
":applefritter:":'
',
":applejack:":'
',
":berrypunch:":'
',
":bestship:":'
',
":bigmacintosh:":'
',
":celestia:":'
',
":cheerilee:":'
',
":cheeselegs:":'
',
":derpyhooves:":'
',
":fluttershy:":'
',
":goldenharvest:":'
',
":grannysmith:":'
',
":luna:":'
',
":lyraheartstrings:":'
',
":minty:":'
',
":minuette:":'
',
":octavia:":'
',
":pinkiepie:":'
',
":pipsqueak:":'
',
":rainbowdash:":'
',
":rarity:":'
',
":roseluck:":'
',
":royalguard:":'
',
":scootaloo:":'
',
":snails:":'
',
":spike:":'
',
":sweetiebelle:":'
',
":trixie:":'
',
":twilightsparkle:":'
',
":twist:":'
',
":wub:":'
',
":zecora:":'
',
// Pony and people emotes:
":chicken:":'
',
":correspondent:":'
',
":faust:":'
',
":futashy:":'
',
":lyra:":'
',
":tarastrong:":'
',
// Autism emotes:
":autism:":'
',
":bestbrony:":'
',
":brony:":'
',
":chrischan:":'
',
":cinnamongroove:":'
',
":friendshipismagic:":'
',
":foamadventure:":'
',
":meelz:":'
',
":nathan:":'
',
":rainboomcrash:":'
',
// Circlejerk emotes:
":bestmod:":'
',
":jewclops:":'
',
":jewswaifu:":'
',
":lgsclops:":'
',
":littlegirlshow:":'
',
":penspin:":'
',
":senor:":'
',
// Other emotes:
":420:":'
',
":AMERICA:":'
',
":basicmushroom:":'
',
":BAWW:":'
',
":bongrips:":'
',
":clap:":'
',
":clop:":'
',
":coolstorybro:":'
',
":cumonstepitup!!!:":'
',
":cupcakes:":'
',
":datplot:":'
',
":duane:":'
',
":facepalm:":'
',
":flutterface:":'
',
":gangsta:":'
',
":gildamenow:":'
',
":GOTTAGOFAST:":'
',
":ISHYGDDT:":'
',
":jump:":'
',
":killmenow:":'
',
":laughingponywhores:":'
',
":lolcocks:":'
',
":ohmy:":'
',
":rape:":'
',
":sanic:":'
',
":smokeweed:":'
',
":soon:":'
',
":stonerrarity:":'
',
":stonershy:":'
',
":techno:":'
',
":tulpa:":'
',
":whatever:":'
',
":yourtooslow:":'
',
// New emotes:
":sweetcelestia:":'
',
":pinkamenadianepie:":'
',
// Possible emotes:
// ":example:":'
',
// Unused emotes:
":dontgiveafuck:":'
',
":HEILCELESTIA:":'
',
":love:":'
',
":motherland:":'
',
// Wordfilters:
"brohoof":"brofist",
"Brohoof":"Brofist",
"BroHoof":"BroFist",
"BROHOOF":"BROFIST",
"bro hoof":"brofist",
"Bro hoof":"Brofist",
"Bro Hoof":"BroFist",
"BRO HOOF":"BROFIST",
"brohoove":"brofist",
"Brohoove":"Brofist",
"BroHoove":"BroFist",
"BROHOOVE":"BROFIST",
"bro hoove":"brofist",
"Bro hoove":"Brofist",
"Bro Hoove":"BroFist",
"BRO HOOVE":"BROFIST",
"everypony":"everybody",
"Everypony":"Everybody",
"EVERYPONY":"EVERYBODY",
"EveryPony":"EveryBody",
"everypone":"everybody",
"Everypone":"Everybody",
"EVERYPONE":"EVERYBODY",
"EveryPone":"EveryBody",
"everyponi":"everybody",
"Everyponi":"Everybody",
"EVERYPONI":"EVERYBODY",
"EveryPoni":"EveryBody",
"anypony":"anybody",
"Anypony":"Anybody",
"ANYPONY":"ANYBODY",
"AnyPony":"Anybody",
"anypone":"anybody",
"Anypone":"Anybody",
"ANYPONE":"ANYBODY",
"AnyPone":"AnyBody",
"anyponi":"anybody",
"Anyponi":"Anybody",
"ANYPONI":"ANYBODY",
"AnyPoni":"AnyBody",
"somepony":"somebody",
"Somepony":"Somebody",
"SOMEPONY":"SOMEBODY",
"SomePony":"SomeBody",
"somepone":"somebody",
"Somepone":"Somebody",
"SOMEPONE":"SOMEBODY",
"SomePone":"SomeBody",
"someponi":"somebody",
"Someponi":"Somebody",
"SOMEPONI":"SOMEBODY",
"SomePoni":"SomeBody",
"nopony":"nobody",
"Nopony":"Nobody",
"NOPONY":"NOBODY",
"NoPony":"NoBody",
"nopone":"nobody",
"Nopone":"Nobody",
"NOPONE":"NOBODY",
"NoPone":"NoBody",
"noponi":"nobody",
"Noponi":"Nobody",
"NOPONI":"NOBODY",
"NoPoni":"NoBody",
"what the hay":"what the hell",
"What the hay":"What the hell",
"WHAT THE HAY":"WHAT THE HELL",
"lel":"lol",
"LEL":"LOL",
"leI":"lol",
"Iel":"lol",
"IeI":"lol",
"lemonkeyface":"I am a faggot",
"lemonkey face":"I am a faggot",
"Iemonkeyface":"I am a faggot",
"Iemonkey face":"I am a faggot",
"PONIES ARE FOR FAGGOTS":"VIDYA4CHAN IS FOR FAGGOTS",
"PONIESAREFORFAGGOTS":"VIDYA4CHANISFORFAGGOTS",
"PONYS ARE FOR FAGGOTS":"VIDYA4CHAN IS FOR FAGGOTS",
"PONYSAREFORFAGGOTS":"VIDYA4CHANISFORFAGGOTS",
//Text color
':end:' : '',
':tomato:' : '',
':yellow:' : '',
':blue:' : '',
':darkblue:' : '',
':cyan:' : '',
':red:' : '',
':green:' : '',
':darkgreen:' : '',
':violet:' : '',
':purple:' : '',
':orange:' : '',
':blueviolet:' : '',
':brown:' : '',
':deeppink:' : '',
':aqua:' : '',
':indigo:' : '',
':pink:' : '',
':chocolate:' : '',
':yellowgreen:' : '',
':steelblue:' : '',
':silver:' : '',
':tan:' : '',
':royalblue:' : '',
':twilightpurple:' : '',
//Name filters
"Rainbow Dash" : 'Rainbow Dash',
"Rainbow dash" : 'Rainbow Dash',
"rainbow dash" : 'Rainbow Dash',
"Twilight Sparkle" : 'Twilight Sparkle',
"Twilight sparkle" : 'Twilight Sparkle',
"twilight sparkle" : 'Twilight Sparkle',
"Applejack" : 'Applejack',
"applejack" : 'Applejack',
"Pinkie Pie" : 'Pinkie Pie',
"Pinkie pie" : 'Pinkie Pie',
"pinkie pie" : 'Pinkie Pie',
"Rarity" : 'Rarity',
"rarity" : 'Rarity',
"Fluttershy" : 'Fluttershy',
"fluttershy" : 'Fluttershy',
"littlegirlshow" : ' littlegirlshow',
};
var showfcmenu = false;
helpers.animateEmotes = function(el) {
message_chat = ' '+$("#st-vanilla .st-vanilla-stage-ct .chat #chat #chat_list").html()+' ';
$.each(facecodes, function(code, image) {
regexp = new RegExp(code,'g');
message_chat = message_chat.replace(regexp, image);
});
el.html(message_chat);
$("#st-vanilla .st-vanilla-stage-ct .chat #chat #chat_list").html(el.html(message_chat));
};
$('.controls').append('
');
var menuHTML = '';
var menuCount = 0;
$.each(facecodes, function(code, image) {
menuHTML = menuHTML+ ''+image+' ';
menuCount = menuCount+1;
if(menuCount == 7) {
menuCount = 0;
menuHTML = menuHTML+'
';
}
});
$('#chat').append('');
$("#showfacecodes").click(function() {
if(showfcmenu == false) {
$("#facecodesmenu").removeClass('hide');
showfcmenu = true;
}else{
$("#facecodesmenu").addClass('hide');
showfcmenu = false;
}
});
jQuery.fn.extend({
insertAtCaret: function(myValue){
return this.each(function(i) {
if (document.selection) {
//For browsers like Internet Explorer
this.focus();
sel = document.selection.createRange();
sel.text = myValue;
this.focus();
}
else if (this.selectionStart || this.selectionStart == '0') {
//For browsers like Firefox and Webkit based
var startPos = this.selectionStart;
var endPos = this.selectionEnd;
var scrollTop = this.scrollTop;
this.value = this.value.substring(0, startPos)+myValue+this.value.substring(endPos,this.value.length);
this.focus();
this.selectionStart = startPos + myValue.length;
this.selectionEnd = startPos + myValue.length;
this.scrollTop = scrollTop;
} else {
this.value += myValue;
this.focus();
}
})
}
});
addFaceCode = function (code) {
$("#facecodesmenu").addClass('hide');
showfcmenu = false;
//$('#cin').val($('#cin').val()+' '+code);
$('#cin').insertAtCaret(code);
};
}
setTimeout(loadExternalJS, 3000);