View Single Post
  #4  
Unread 04-03-2005, 03:59 AM
taco-man's Avatar
taco-man taco-man is offline
EQ2MAP Updater Author
This person is a EQ2Map developer.
Interface Author - Click to view interfaces
 
Join Date: Nov 2004
Server: Antonia Bayle
Posts: 1,349
Default

i know this much, mozilla is "retarded" when it comes to dealing with text. compare...
the scripting it takes to do the button for IE:
Code:
		if (text.substring(0, vbcode.length + 2 ) == "[" + vbcode + "]" && text.substring(text.length - vbcode.length - 3, text.length) == "[/" + vbcode + "]")
		{
			AddTxt = text.substring(vbcode.length + 2, text.length - vbcode.length - 3);
		}
		else
		{
			AddTxt = "[" + vbcode + optioncompiled + "]" + text + "[/" + vbcode + "]";
		}
		AddText(AddTxt);
the scripting it takes to do the button for Mozilla:
Code:
		var start_selection = theform.message.selectionStart;
		var end_selection = theform.message.selectionEnd;

		// fetch everything from start of text area to selection start
		var start = (theform.message.value).substring(0, start_selection);
		// fetch everything from start of selection to end of selection
		var middle = (theform.message.value).substring(start_selection, end_selection);
		// fetch everything from end of selection to end of text area
		var end = (theform.message.value).substring(end_selection, theform.message.textLength);

		if (middle.substring(0, vbcode.length + 2 ) == "[" + vbcode + "]" && middle.substring(middle.length - vbcode.length - 3, middle.length) == "[/" + vbcode + "]")
		{
			middle = middle.substring(vbcode.length + 2, middle.length - vbcode.length - 3);
		}
		else
		{
			middle = "[" + vbcode + optioncompiled + "]" + middle + "[/" + vbcode + "]";
		}

		theform.message.value = start + middle + end;
		setfocus();
		theform.message.selectionStart = end_selection + middle.length;
		theform.message.selectionEnd = start_selection + middle.length;
		return false;
__________________
EQ2MAP Updater Download
EQ2MAP Website
How to Install a custom interface
Reply With Quote