Thankfully for you, I was bored and sick of looking at jquery stuff so here is your script in its entirety:
Packaged file is below the code.
code:
function OnEvent_ChatWndSendMessage (ChatWnd, message){
var translated_message = "";
var non_words = /\W/g;
var separators = message.match (non_words);
if (separators == null){
separators = new Array ("");
}
else if (message.indexOf (separators [0]) != 0){ //checks for leading non-word
separators.unshift ("");
}
var words = message.split (non_words);
for (var i in words){
translated_message += separators [i];
//vague instructions, made first letter of each word capitalized
words [i] = words [i].toLowerCase ();
if (words [i].length == 1){
translated_message += words [i];
}else if (words [i].length < 7){
translated_message += words [i].charAt (words [i].length - 1).toUpperCase ()
+ words [i].charAt (words [i].length - 2)
+ words [i].substr (0, words [i].length - 2);
}else{
translated_message += words [i].charAt (words [i].length - 2).toUpperCase ()
+ words [i].substr (0, words [i].length - 2);
}
}
if (separators.length > words.length){ //checks for trailing non-word
translated_message += separators [separators.length - 1];
}
return translated_message;
}