Vergleich jscripts/editor.js - 1.2.2 - 1.2.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 22Zeile 22
			
if(!this.options.rtl)
{

			
if(!this.options.rtl)
{

				this.options.trl = 0;

				this.options.rtl = 0;

			}
}


			}
}


Zeile 41Zeile 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;


Zeile 103Zeile 104
		}

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;
}
else if(oldTextarea.clientHeight)
{
h = oldTextarea.clientHeight+"px";

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

		}

		}

		else
{
h = "400px";

		else
{
h = "400px";

Zeile 121Zeile 122
		editor.style.width = w;
editor.style.height = h;
editor.style.padding = "3px";

		editor.style.width = w;
editor.style.height = h;
editor.style.padding = "3px";





		// Create the first toolbar
toolBar = document.createElement("div");
toolBar.style.height = "26px";

		// Create the first toolbar
toolBar = document.createElement("div");
toolBar.style.height = "26px";

Zeile 130Zeile 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)
{

		
if(this.options.rtl == 1)
{

Zeile 249Zeile 252
		elements.style.position = "absolute";

if(this.options.rtl == 1)

		elements.style.position = "absolute";

if(this.options.rtl == 1)

		{

		{

			elements.style.left = 0;
}
else

			elements.style.left = 0;
}
else

Zeile 278Zeile 281

// Set the width/height of the area
subtract = subtract2 = 0;


// Set the width/height of the area
subtract = subtract2 = 0;

		if(MyBB.browser == "mozilla")

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

		{
subtract = subtract2 = 8;
}

		{
subtract = subtract2 = 8;
}

Zeile 318Zeile 321
		this.oldTextarea = oldTextarea;

// Append the new editor

		this.oldTextarea = oldTextarea;

// Append the new editor

		oldTextarea.parentNode.appendChild(editor);

		oldTextarea.parentNode.insertBefore(editor, oldTextarea);


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


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

Zeile 437Zeile 440
	},

changeSize: function(e)

	},

changeSize: function(e)

	{
element = MyBB.eventElement(e);

if(!element)
{
return false;
}

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

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

	{
element = MyBB.eventElement(e);

if(!element)
{
return false;
}

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

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

		}
},


		}
},


Zeile 458Zeile 461
		element = MyBB.eventElement(e);

if(!element)

		element = MyBB.eventElement(e);

if(!element)

		{
return false;
}


		{
return false;
}


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

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

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

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

Zeile 473Zeile 476
	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, "");

Zeile 484Zeile 487
			}
}
while(listItem != "" && listItem != null);

			}
}
while(listItem != "" && listItem != null);

		

		

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

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

Zeile 520Zeile 523
			}

if(title)

			}

if(title)

			{

			{

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

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

			}

			}

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

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

Zeile 531Zeile 534
	},

insertEmail: function()

	},

insertEmail: function()

	{

	{

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


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


Zeile 540Zeile 543
			if(!selectedText)
{
title = prompt(this.options.lang.enter_email_title, "");

			if(!selectedText)
{
title = prompt(this.options.lang.enter_email_title, "");

			}
else

			}
else

			{
title = selectedText;
}

			{
title = selectedText;
}

Zeile 591Zeile 594
					var full_tag = code+"_"+extra;
}
else

					var full_tag = code+"_"+extra;
}
else

				{

				{

					var full_tag = code;
}


					var full_tag = code;
}


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

							{
$(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)
{

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

Zeile 651Zeile 659
					{
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)

Zeile 671Zeile 689
		{
var select_start = element.selectionStart;
var select_end = element.selectionEnd;

		{
var select_start = element.selectionStart;
var select_end = element.selectionEnd;

			if(select_end <= 2)

			if(select_end <= 0)

			{
select_end = element.textLength;
}

			{
select_end = element.textLength;
}

Zeile 798Zeile 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($(exploded_tag[0]))
{
tag = $(exploded_tag[0]);

 
				}
if($(tag))
{

					if(tag.type == "select-one")
{
tag.selectedIndex = 0;

					if(tag.type == "select-one")
{
tag.selectedIndex = 0;

Zeile 811Zeile 831
						DomLib.removeClass($(tag), "toolbar_clicked");
}
}

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

 
				

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

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