Vergleich jscripts/editor.js - 1.2.0 - 1.2.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 19Zeile 19
			{
return false;
}

			{
return false;
}

 
			

			if(!this.options.rtl)
{

			if(!this.options.rtl)
{

				this.options.trl = 0;

				this.options.rtl = 0;

			}
}


			}
}


Zeile 40Zeile 41
		this.sizes["xx-small"] = this.options.lang.size_xx_small;
this.sizes["x-small"] = this.options.lang.size_x_small;
this.sizes["small"] = this.options.lang.size_small;

		this.sizes["xx-small"] = this.options.lang.size_xx_small;
this.sizes["x-small"] = this.options.lang.size_x_small;
this.sizes["small"] = this.options.lang.size_small;

		this.sizes["medium"] = this.options.lang.size_medium


		this.sizes["medium"] = this.options.lang.size_medium;
this.sizes["large"] = this.options.lang.size_large;

		this.sizes["x-large"] = this.options.lang.size_x_large;
this.sizes["xx-large"] = this.options.lang.size_xx_large;

// An array of colours to be shown.
this.colors = new Array();

		this.sizes["x-large"] = this.options.lang.size_x_large;
this.sizes["xx-large"] = this.options.lang.size_xx_large;

// An array of colours to be shown.
this.colors = new Array();

		this.colors["white"] = this.options.lang.color_white;
this.colors["black"] = this.options.lang.color_black;
this.colors["red"] = this.options.lang.color_red;
this.colors["yellow"] = this.options.lang.color_yellow;
this.colors["pink"] = this.options.lang.color_pink;
this.colors["green"] = this.options.lang.color_green;
this.colors["orange"] = this.options.lang.color_orange;
this.colors["purple"] = this.options.lang.color_purple;
this.colors["blue"] = this.options.lang.color_blue;
this.colors["beige"] = this.options.lang.color_beige;
this.colors["brown"] = this.options.lang.color_brown;
this.colors["teal"] = this.options.lang.color_teal;
this.colors["navy"] = this.options.lang.color_navy;
this.colors["maroon"] = this.options.lang.color_maroon;
this.colors["limegreen"] = this.options.lang.color_limegreen;


		this.colors["#ffffff"] = this.options.lang.color_white;
this.colors["#000000"] = this.options.lang.color_black;
this.colors["#FF0000"] = this.options.lang.color_red;
this.colors["#FFFF00"] = this.options.lang.color_yellow;
this.colors["#FFC0CB"] = this.options.lang.color_pink;
this.colors["#008000"] = this.options.lang.color_green;
this.colors["#FFA500"] = this.options.lang.color_orange;
this.colors["#800080"] = this.options.lang.color_purple;
this.colors["#0000FF"] = this.options.lang.color_blue;
this.colors["#F5F5DC"] = this.options.lang.color_beige;
this.colors["#A52A2A"] = this.options.lang.color_brown;
this.colors["#008080"] = this.options.lang.color_teal;
this.colors["#000080"] = this.options.lang.color_navy;
this.colors["#800000"] = this.options.lang.color_maroon;
this.colors["#32CD32"] = this.options.lang.color_limegreen;


		// Here we get the ID of the textarea we're replacing and store it.
this.textarea = textarea;

		// Here we get the ID of the textarea we're replacing and store it.
this.textarea = textarea;

		

 
		
// Only swap it over once the page has loaded (add event)
Event.observe(window, "load", this.showEditor.bindAsEventListener(this));

		
// Only swap it over once the page has loaded (add event)
Event.observe(window, "load", this.showEditor.bindAsEventListener(this));

Zeile 74Zeile 75
	{
// Assign the old textarea to a variable for later use.
oldTextarea = $(this.textarea);

	{
// Assign the old textarea to a variable for later use.
oldTextarea = $(this.textarea);

 

// Now this.textarea becomes the new textarea ID
this.textarea += "_new";


// Begin the creation of our new editor.

editor = document.createElement("div");
editor.style.position = "relative";
editor.className = "editor";


// Begin the creation of our new editor.

editor = document.createElement("div");
editor.style.position = "relative";
editor.className = "editor";





		// Determine the overall height and width - messy, but works
if(this.options && this.options.width)
{

		// Determine the overall height and width - messy, but works
if(this.options && this.options.width)
{

Zeile 98Zeile 102
		{
w = "560px";
}

		{
w = "560px";
}

 
		

		if(this.options && this.options.height)

		if(this.options && this.options.height)

		{
w = this.options.height;
}

		{
h = this.options.height;
}

		else if(oldTextarea.style.height)

		else if(oldTextarea.style.height)

		{

		{

			h = oldTextarea.style.height;

			h = oldTextarea.style.height;

		}

		}

		else if(oldTextarea.clientHeight)
{
h = oldTextarea.clientHeight+"px";

		else if(oldTextarea.clientHeight)
{
h = oldTextarea.clientHeight+"px";

		}
else

		}
else

		{
h = "400px";
}

		{
h = "400px";
}

Zeile 126Zeile 131
		// Create text font/color/size toolbar
textFormatting = document.createElement("div");
textFormatting.style.position = "absolute";

		// Create text font/color/size toolbar
textFormatting = document.createElement("div");
textFormatting.style.position = "absolute";

 
		textFormatting.style.width = "100%";



		if(this.options.rtl == 1)
{
textFormatting.style.right = 0;

		if(this.options.rtl == 1)
{
textFormatting.style.right = 0;

Zeile 139Zeile 147
		// Create the font drop down.
fontSelect = document.createElement("select");
fontSelect.style.margin = "2px";

		// Create the font drop down.
fontSelect = document.createElement("select");
fontSelect.style.margin = "2px";

 
		fontSelect.id = "font";

		fontSelect.options[fontSelect.options.length] = new Option(this.options.lang.font, "-");

		fontSelect.options[fontSelect.options.length] = new Option(this.options.lang.font, "-");

 
		

		for(font in this.fonts)
{
fontSelect.options[fontSelect.options.length] = new Option(this.fonts[font], font);

		for(font in this.fonts)
{
fontSelect.options[fontSelect.options.length] = new Option(this.fonts[font], font);

Zeile 150Zeile 160
		// Create the font size drop down.
sizeSelect = document.createElement("select");
sizeSelect.style.margin = "2px";

		// Create the font size drop down.
sizeSelect = document.createElement("select");
sizeSelect.style.margin = "2px";

 
		sizeSelect.id = "size";

		sizeSelect.options[sizeSelect.options.length] = new Option(this.options.lang.size, "-");

		sizeSelect.options[sizeSelect.options.length] = new Option(this.options.lang.size, "-");

 
		

		for(size in this.sizes)
{
sizeSelect.options[sizeSelect.options.length] = new Option(this.sizes[size], size);

		for(size in this.sizes)
{
sizeSelect.options[sizeSelect.options.length] = new Option(this.sizes[size], size);

Zeile 161Zeile 173
		// Create the colour drop down.
colorSelect = document.createElement("select");
colorSelect.style.margin = "2px";

		// Create the colour drop down.
colorSelect = document.createElement("select");
colorSelect.style.margin = "2px";

 
		colorSelect.id = "color";

		colorSelect.options[colorSelect.options.length] = new Option(this.options.lang.color, "-");

		colorSelect.options[colorSelect.options.length] = new Option(this.options.lang.color, "-");

 
		

		for(color in this.colors)
{
colorSelect.options[colorSelect.options.length] = new Option(this.colors[color], color);

		for(color in this.colors)
{
colorSelect.options[colorSelect.options.length] = new Option(this.colors[color], color);

Zeile 170Zeile 184
		}
Event.observe(colorSelect, "change", this.changeColor.bindAsEventListener(this));
textFormatting.appendChild(colorSelect);

		}
Event.observe(colorSelect, "change", this.changeColor.bindAsEventListener(this));
textFormatting.appendChild(colorSelect);

		

		

		// Create close tags button
closeBar = document.createElement("div");
closeBar.style.position = "absolute";

		// Create close tags button
closeBar = document.createElement("div");
closeBar.style.position = "absolute";

 
		

		if(this.options.rtl == 1)
{
closeBar.style.left = 0;

		if(this.options.rtl == 1)
{
closeBar.style.left = 0;

Zeile 182Zeile 197
		{
closeBar.style.right = 0;
}

		{
closeBar.style.right = 0;
}

 
		

		var closeButton = document.createElement("img");
closeButton.id = "close_tags";
closeButton.src = "images/codebuttons/close_tags.gif";

		var closeButton = document.createElement("img");
closeButton.id = "close_tags";
closeButton.src = "images/codebuttons/close_tags.gif";

Zeile 208Zeile 224
		// Create formatting section of second toolbar.
formatting = document.createElement("div");
formatting.style.position = "absolute";

		// Create formatting section of second toolbar.
formatting = document.createElement("div");
formatting.style.position = "absolute";

 
		formatting.style.width = "100%";
formatting.style.whiteSpace = "nowrap";


		if(this.options.rtl == 1)
{
formatting.style.right = 0;

		if(this.options.rtl == 1)
{
formatting.style.right = 0;

Zeile 231Zeile 250
		// Create insertable elements section of second toolbar.
elements = document.createElement("div");
elements.style.position = "absolute";

		// Create insertable elements section of second toolbar.
elements = document.createElement("div");
elements.style.position = "absolute";

 
		

		if(this.options.rtl == 1)
{
elements.style.left = 0;

		if(this.options.rtl == 1)
{
elements.style.left = 0;

Zeile 257Zeile 277

// Create our new text area
areaContainer = document.createElement("div");


// Create our new text area
areaContainer = document.createElement("div");

 
		areaContainer.style.clear = "both";


// Set the width/height of the area


// Set the width/height of the area

		if(MyBB.browser == "mozilla")


		subtract = subtract2 = 0;
if(MyBB.browser != "ie" || (MyBB.browser == "ie" && MyBB.useragent.indexOf('msie 7.') != -1))

		{

		{

			subtract = subtract2 = parseInt(editor.style.padding)*2;
}
else
{
subtract = subtract2 = 0;

			subtract = subtract2 = 8;





		}
areaContainer.style.height = parseInt(editor.style.height)-parseInt(toolBar.style.height)-parseInt(toolbar2.style.height)-subtract+"px";

		}
areaContainer.style.height = parseInt(editor.style.height)-parseInt(toolBar.style.height)-parseInt(toolbar2.style.height)-subtract+"px";

		areaContainer.style.width = (parseInt(editor.style.width)-subtract2)+"px";


		areaContainer.style.width = parseInt(editor.style.width)-subtract2+"px";


		// Create text area
textInput = document.createElement("textarea");
textInput.id = this.textarea;

		// Create text area
textInput = document.createElement("textarea");
textInput.id = this.textarea;

		textInput.name = oldTextarea.name;
textInput.style.height = areaContainer.style.height;
textInput.style.width = areaContainer.style.width;


		textInput.name = oldTextarea.name+"_new";
textInput.style.height = parseInt(areaContainer.style.height)+"px";
textInput.style.width = parseInt(areaContainer.style.width)+"px";


		if(oldTextarea.value != '')
{
textInput.value = oldTextarea.value;
}

		if(oldTextarea.value != '')
{
textInput.value = oldTextarea.value;
}

 
		

		if(oldTextarea.tabIndex)
{
textInput.tabIndex = oldTextarea.tabIndex;

		if(oldTextarea.tabIndex)
{
textInput.tabIndex = oldTextarea.tabIndex;

		}


		}


		areaContainer.appendChild(textInput);
editor.appendChild(areaContainer);

		areaContainer.appendChild(textInput);
editor.appendChild(areaContainer);

 
		

		if(oldTextarea.form)
{
Event.observe(oldTextarea.form, "submit", this.closeTags.bindAsEventListener(this));

		if(oldTextarea.form)
{
Event.observe(oldTextarea.form, "submit", this.closeTags.bindAsEventListener(this));

 
			Event.observe(oldTextarea.form, "submit", this.updateOldArea.bindAsEventListener(this));

		}

		}

		// Replace the old with the new
oldTextarea.parentNode.replaceChild(editor, oldTextarea);
},


















		// Hide the old editor
oldTextarea.style.visibility = "hidden";
oldTextarea.style.position = "absolute";
oldTextarea.style.top = "-1000px";
oldTextarea.id += "_old";
this.oldTextarea = oldTextarea;

// Append the new editor
oldTextarea.parentNode.insertBefore(editor, oldTextarea);

Event.observe(textInput, "keyup", this.updateOldArea.bindAsEventListener(this));
Event.observe(textInput, "blur", this.updateOldArea.bindAsEventListener(this));
},

updateOldArea: function(e)
{
this.oldTextarea.value = $(this.textarea).value;
},



	insertStandardButton: function(into, id, src, insertText, insertExtra, alt)
{
var button = document.createElement("img");

	insertStandardButton: function(into, id, src, insertText, insertExtra, alt)
{
var button = document.createElement("img");

Zeile 323Zeile 363
	},

toolbarItemOut: function(e)

	},

toolbarItemOut: function(e)

	{
element = MyBB.eventElement(e);
if(!element)
{
return false;
}



	{
element = MyBB.eventElement(e);

if(!element)
{
return false;
}


		if(element.insertText)
{
if(element.insertExtra)

		if(element.insertText)
{
if(element.insertExtra)

Zeile 339Zeile 381
			{
insertCode = element.insertText;
}

			{
insertCode = element.insertText;
}

 
			

			if(MyBB.inArray(insertCode, this.openTags))
{
DomLib.addClass(element, "toolbar_clicked");

			if(MyBB.inArray(insertCode, this.openTags))
{
DomLib.addClass(element, "toolbar_clicked");

Zeile 348Zeile 391
	},

toolbarItemHover: function(e)

	},

toolbarItemHover: function(e)

	{
element = MyBB.eventElement(e);
if(!element)


	{
element = MyBB.eventElement(e);

if(!element)

		{
return false;
}

		{
return false;
}

 
		

		DomLib.addClass(element, "toolbar_hover");
},


		DomLib.addClass(element, "toolbar_hover");
},






	toolbarItemClick: function(e)

	toolbarItemClick: function(e)

	{
element = MyBB.eventElement(e);
if(!element)


	{
element = MyBB.eventElement(e);

if(!element)

		{
return false;
}

		{
return false;
}

 
		

		if(element.id == "close_tags")
{
this.closeTags();

		if(element.id == "close_tags")
{
this.closeTags();

Zeile 378Zeile 425
	changeFont: function(e)
{
element = MyBB.eventElement(e);

	changeFont: function(e)
{
element = MyBB.eventElement(e);

 
		

		if(!element)
{
return false;
}

		if(!element)
{
return false;
}

 
		

		this.insertMyCode("font", element.options[element.selectedIndex].value);

		this.insertMyCode("font", element.options[element.selectedIndex].value);

 
		

		if(this.getSelectedText($(this.textarea)))

		if(this.getSelectedText($(this.textarea)))

		{

		{

			element.selectedIndex = 0;
}
},

changeSize: function(e)

			element.selectedIndex = 0;
}
},

changeSize: function(e)

	{
element = MyBB.eventElement(e);
if(!element)
{


	{
element = MyBB.eventElement(e);

if(!element)
{

			return false;
}

			return false;
}

 
		

		this.insertMyCode("size", element.options[element.selectedIndex].value);

		this.insertMyCode("size", element.options[element.selectedIndex].value);

 
		

		if(this.getSelectedText($(this.textarea)))
{
element.selectedIndex = 0;

		if(this.getSelectedText($(this.textarea)))
{
element.selectedIndex = 0;

Zeile 406Zeile 459
	changeColor: function(e)
{
element = MyBB.eventElement(e);

	changeColor: function(e)
{
element = MyBB.eventElement(e);

 
		

		if(!element)

		if(!element)

		{

		{

			return false;
}

			return false;
}

 
		

		this.insertMyCode("color", element.options[element.selectedIndex].value);

		this.insertMyCode("color", element.options[element.selectedIndex].value);

 
		

		if(this.getSelectedText($(this.textarea)))
{
element.selectedIndex = 0;

		if(this.getSelectedText($(this.textarea)))
{
element.selectedIndex = 0;

		}

		}

	},

insertList: function(type)
{
list = "";

	},

insertList: function(type)
{
list = "";

 
		

		do
{
listItem = prompt(this.options.lang.enter_list_item, "");

		do
{
listItem = prompt(this.options.lang.enter_list_item, "");

 
			

			if(listItem != "" && listItem != null)
{
list = list+"[*]"+listItem+"\n";
}
}
while(listItem != "" && listItem != null);

			if(listItem != "" && listItem != null)
{
list = list+"[*]"+listItem+"\n";
}
}
while(listItem != "" && listItem != null);

 
		

		if(list == "")
{
return false;
}

		if(list == "")
{
return false;
}

 
		

		if(type)
{
list = "[list="+type+"]\n"+list;

		if(type)
{
list = "[list="+type+"]\n"+list;

Zeile 441Zeile 501
		{
list = "[list]\n"+list;
}

		{
list = "[list]\n"+list;
}

 
		

		list = list+"[/list]\n";
this.performInsert(list, "", true, false);
},

insertURL: function()

		list = list+"[/list]\n";
this.performInsert(list, "", true, false);
},

insertURL: function()

	{

	{

		selectedText = this.getSelectedText($(this.textarea));
url = prompt(this.options.lang.enter_url, "http://");

		selectedText = this.getSelectedText($(this.textarea));
url = prompt(this.options.lang.enter_url, "http://");

 
		

		if(url)
{
if(!selectedText)

		if(url)
{
if(!selectedText)

			{

			{

				title = prompt(this.options.lang.enter_url_title, "");
}

				title = prompt(this.options.lang.enter_url_title, "");
}

			else
{
title = selectedText;
}


			else
{
title = selectedText;
}


			if(title)

			if(title)

			{

			{

				this.performInsert("[url="+url+"]"+title+"[/url]", "", true, false);
}
else
{
this.performInsert("[url]"+url+"[/url]", "", true, false);

				this.performInsert("[url="+url+"]"+title+"[/url]", "", true, false);
}
else
{
this.performInsert("[url]"+url+"[/url]", "", true, false);

			}

			}

		}
},


		}
},


Zeile 474Zeile 537
	{
selectedText = this.getSelectedText($(this.textarea));
email = prompt(this.options.lang.enter_email, "");

	{
selectedText = this.getSelectedText($(this.textarea));
email = prompt(this.options.lang.enter_email, "");

 
		

		if(email)
{
if(!selectedText)

		if(email)
{
if(!selectedText)

			{

			{

				title = prompt(this.options.lang.enter_email_title, "");

				title = prompt(this.options.lang.enter_email_title, "");

			}

			}

			else

			else

			{

			{

				title = selectedText;
}

				title = selectedText;
}

 
			

			if(title)
{
this.performInsert("[email="+email+"]"+title+"[/email]", "", true, false);

			if(title)
{
this.performInsert("[email="+email+"]"+title+"[/email]", "", true, false);

			}

			}

			else
{
this.performInsert("[email]"+email+"[/email]", "", true, false);

			else
{
this.performInsert("[email]"+email+"[/email]", "", true, false);

Zeile 498Zeile 563
	insertIMG: function()
{
image = prompt(this.options.lang.enter_image, "http://");

	insertIMG: function()
{
image = prompt(this.options.lang.enter_image, "http://");

 
		

		if(image)
{
this.performInsert("[img]"+image+"[/img]", "", true);

		if(image)
{
this.performInsert("[img]"+image+"[/img]", "", true);

Zeile 531Zeile 597
				{
var full_tag = code;
}

				{
var full_tag = code;
}

 
				

				var newTags = new Array();

				var newTags = new Array();

				for(var i=0;i<this.openTags.length;i++)

				for(var i=0; i< this.openTags.length; ++i)

				{
if(this.openTags[i])
{
exploded_tag = this.openTags[i].split("_");

				{
if(this.openTags[i])
{
exploded_tag = this.openTags[i].split("_");

 
						

						if(exploded_tag[0] == code)
{
already_open = true;
this.performInsert("[/"+exploded_tag[0]+"]", "", false);

						if(exploded_tag[0] == code)
{
already_open = true;
this.performInsert("[/"+exploded_tag[0]+"]", "", false);

 
							

							if($(this.openTags[i]))
{
$(this.openTags[i]).className = "toolbar_normal";
}

							if($(this.openTags[i]))
{
$(this.openTags[i]).className = "toolbar_normal";
}

 

if($(exploded_tag[0]) && $(exploded_tag[0]).type == "select-one")
{
$(exploded_tag[0]).selectedIndex = 0;
}


							if(this.openTags[i] == full_tag)
{
no_insert = true;

							if(this.openTags[i] == full_tag)
{
no_insert = true;

Zeile 554Zeile 629
						{
newTags[newTags.length] = this.openTags[i];
}

						{
newTags[newTags.length] = this.openTags[i];
}

					}
}


					}
}


				this.openTags = newTags;
var do_insert = false;

				this.openTags = newTags;
var do_insert = false;

 
				

				if(extra != "" && extra != "-" && no_insert == false)
{
start_tag = "["+code+"="+extra+"]";

				if(extra != "" && extra != "-" && no_insert == false)
{
start_tag = "["+code+"="+extra+"]";

					end_tag = "[/"+code+"]";

					end_tag = "[/"+code+"]";

					do_insert = true;
}
else if(!extra && already_open == false)

					do_insert = true;
}
else if(!extra && already_open == false)

Zeile 577Zeile 654
					{
MyBB.arrayPush(this.openTags, full_tag);
$('close_tags').style.visibility = '';

					{
MyBB.arrayPush(this.openTags, full_tag);
$('close_tags').style.visibility = '';

					}

					}

					else if($(full_tag))

					else if($(full_tag))

					{

					{

						DomLib.removeClass($(full_tag), "toolbar_clicked");
}

						DomLib.removeClass($(full_tag), "toolbar_clicked");
}

 
					else if($(code) && $(code).type == "select-one")
{
$(code).selectedIndex = 0;
}


				}
}

				}
}

 
		
if(this.openTags.length == 0)
{
$('close_tags').style.visibility = 'hidden';
}

	},

getSelectedText: function(element)

	},

getSelectedText: function(element)

	{

	{

		element.focus();
if(document.selection)
{

		element.focus();
if(document.selection)
{

Zeile 620Zeile 707
		{
var ignore_selection = false;
}

		{
var ignore_selection = false;
}

 
		

		if(!close_tag)
{
var close_tag = "";
}
var textarea = $(this.textarea);
textarea.focus();

		if(!close_tag)
{
var close_tag = "";
}
var textarea = $(this.textarea);
textarea.focus();

 
		

		if(document.selection)
{
var selection = document.selection;

		if(document.selection)
{
var selection = document.selection;

			var range = selection.createRange()


			var range = selection.createRange();


			if(ignore_selection != false)
{
selection.collapse;
}

			if(ignore_selection != false)
{
selection.collapse;
}

 
			

			if((selection.type == "Text" || selection.type == "None") && range != null && ignore_selection != true)
{
if(close_tag != "" && range.text.length > 0)

			if((selection.type == "Text" || selection.type == "None") && range != null && ignore_selection != true)
{
if(close_tag != "" && range.text.length > 0)

Zeile 644Zeile 735
				else
{
var keep_selected = false;

				else
{
var keep_selected = false;

 
					

					if(is_single)
{
is_closed = false;

					if(is_single)
{
is_closed = false;

Zeile 662Zeile 754
			var select_start = textarea.selectionStart;
var select_end = textarea.selectionEnd;
var scroll_top = textarea.scrollTop;

			var select_start = textarea.selectionStart;
var select_end = textarea.selectionEnd;
var scroll_top = textarea.scrollTop;

 
			

			if(select_end <= 2)
{
select_end = textarea.textLength;
}

			if(select_end <= 2)
{
select_end = textarea.textLength;
}

 
			

			var start = textarea.value.substring(0, select_start);
var middle = textarea.value.substring(select_start, select_end);
var end = textarea.value.substring(select_end, textarea.textLength);

			var start = textarea.value.substring(0, select_start);
var middle = textarea.value.substring(select_start, select_end);
var end = textarea.value.substring(select_end, textarea.textLength);

 
			

			if(select_end - select_start > 0 && ignore_selection != true && close_tag != "")
{
var keep_selected = true;

			if(select_end - select_start > 0 && ignore_selection != true && close_tag != "")
{
var keep_selected = true;

Zeile 683Zeile 778
				}
middle = open_tag;
}

				}
middle = open_tag;
}

 
			

			textarea.value = start+middle+end;

			textarea.value = start+middle+end;

 
			

			if(keep_selected == true && ignore_selection != true)
{
textarea.selectionStart = select_start;

			if(keep_selected == true && ignore_selection != true)
{
textarea.selectionStart = select_start;

Zeile 699Zeile 796
		else
{
textarea.value += open_tag;

		else
{
textarea.value += open_tag;

 
			

			if(is_single)
{
is_closed = false;
}
}

			if(is_single)
{
is_closed = false;
}
}

 
		this.updateOldArea();

		textarea.focus();
return is_closed;
},

		textarea.focus();
return is_closed;
},

Zeile 717Zeile 816
				tag = MyBB.arrayPop(this.openTags);
exploded_tag = tag.split("_");
this.performInsert("[/"+exploded_tag[0]+"]", "", false);

				tag = MyBB.arrayPop(this.openTags);
exploded_tag = tag.split("_");
this.performInsert("[/"+exploded_tag[0]+"]", "", false);

 
				if($(exploded_tag[0]))
{
tag = $(exploded_tag[0]);
}

				if($(tag))
{

				if($(tag))
{

					DomLib.removeClass($(tag), "toolbar_clicked");








					if(tag.type == "select-one")
{
tag.selectedIndex = 0;
}
else
{
DomLib.removeClass($(tag), "toolbar_clicked");
}

				}

				}

 
				

			}
}
$(this.textarea).focus();

			}
}
$(this.textarea).focus();

Zeile 734Zeile 845
		if(element && element != null)
{
element.className = "toolbar_"+state;

		if(element && element != null)
{
element.className = "toolbar_"+state;

		}

		}

	},
bindSmilieInserter: function(id)
{
if(!$(id))

	},
bindSmilieInserter: function(id)
{
if(!$(id))

		{

		{

			return false;
}

			return false;
}

 
		

		smilies = DomLib.getElementsByClassName($(id), "img", "smilie");

		smilies = DomLib.getElementsByClassName($(id), "img", "smilie");

 
		

		if(smilies.length > 0)
{

		if(smilies.length > 0)
{

			for(var i=0;i<smilies.length;i++)

			for(var i=0; i < smilies.length; ++i)

			{
var smilie = smilies[i];
smilie.onclick = this.insertSmilie.bindAsEventListener(this);

			{
var smilie = smilies[i];
smilie.onclick = this.insertSmilie.bindAsEventListener(this);

Zeile 762Zeile 875
	insertSmilie: function(e)
{
element = MyBB.eventElement(e);

	insertSmilie: function(e)
{
element = MyBB.eventElement(e);

 
		

		if(!element || !element.alt)
{
return false;

		if(!element || !element.alt)
{
return false;