gogodr I post too much
Reputation: 125
Joined: 19 Dec 2006 Posts: 2041
|
Posted: Thu Jun 10, 2010 8:12 pm Post subject: why does it keeps freezing? |
|
|
test
dam..
even if there are no quotes it is freezing.... ;-; why?
| Code: | // ==UserScript==
// @name adding text styling test
// @namespace http://forum.cheatengine.org/*
// @include *forum.cheatengine.org/*
// ==/UserScript==
var postButton = document.forms.namedItem("post").elements.namedItem("post");
var newmsg = "";
var oldmsg = "";
function FLQ(){
var evaluationMessage = document.forms.namedItem("post").elements.namedItem("message");
var originalMessage = document.forms.namedItem("post").elements.namedItem("message");
var newmsgpos;
if (evaluationMessage.value.search("[/quote]") != -1){
while (evaluationMessage.value.search("[/quote]") != -1 ){
newmsgpos = evaluationMessage.value.search("[/quote]");
evaluationMessage.value.replace("[/quote]","[/oldquote]");
}
newmsg = originalMessage.value.substring(newmsgpos + 8);
oldmsg = originalMessage.value.substring(0,newmsgpos + 8);
}
else if (evaluationMessage.value.search("[/quote]") != -1){
oldmsg = "";
newmsg = evaluationMessage.value
}
}
function styling(newmsg,oldmsg){
FLQ();
var postMessage = document.forms.namedItem("post").elements.namedItem("message");
postMessage.value=oldmsg+"[color=darkblue][size=9] "+newmsg+" [/size][/color]";
}
postButton.addEventListener("click", styling, true); |
|
|