Zeile 19 | Zeile 19 |
---|
{ return false; }
|
{ return false; }
|
|
|
if(!this.options.rtl) {
|
if(!this.options.rtl) {
|
this.options.trl = 0;
| this.options.rtl = 0;
|
} }
| } }
|
Zeile 46 | Zeile 47 |
---|
// An array of colours to be shown. this.colors = new Array();
|
// 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["#000"] = 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 75 | Zeile 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);
|
// Begin the creation of our new editor.
| // 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";
// Determine the overall height and width - messy, but works if(this.options && this.options.width)
|
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)
|
{
| {
|
w = this.options.width;
|
w = this.options.width;
|
}
| }
|
else if(oldTextarea.style.width)
|
else if(oldTextarea.style.width)
|
{
| {
|
w = oldTextarea.style.width; } else if(oldTextarea.clientWidth) { w = oldTextarea.clientWidth+"px";
|
w = oldTextarea.style.width; } else if(oldTextarea.clientWidth) { w = oldTextarea.clientWidth+"px";
|
}
| }
|
else { w = "560px"; }
|
else { w = "560px"; }
|
|
|
if(this.options && this.options.height) { w = this.options.height;
| if(this.options && this.options.height) { w = this.options.height;
|
Zeile 109 | Zeile 113 |
---|
else if(oldTextarea.clientHeight) { h = oldTextarea.clientHeight+"px";
|
else if(oldTextarea.clientHeight) { h = oldTextarea.clientHeight+"px";
|
} else {
| } else {
|
h = "400px"; } editor.style.width = w;
| h = "400px"; } editor.style.width = w;
|
Zeile 126 | Zeile 130 |
---|
// 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 139 | Zeile 146 |
---|
// 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 150 | Zeile 159 |
---|
// 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 161 | Zeile 172 |
---|
// 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 174 | Zeile 187 |
---|
// 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)
|
if(this.options.rtl == 1)
|
{
| {
|
closeBar.style.left = 0;
|
closeBar.style.left = 0;
|
}
| }
|
else { closeBar.style.right = 0; }
|
else { 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 204 | Zeile 219 |
---|
toolbar2 = document.createElement("div"); toolbar2.style.height = "28px"; toolbar2.style.position = "relative";
|
toolbar2 = document.createElement("div"); toolbar2.style.height = "28px"; toolbar2.style.position = "relative";
|
|
|
// 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 231 | Zeile 249 |
---|
// 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;
|
} else
| } else
|
{ elements.style.right = 0; }
| { elements.style.right = 0; }
|
Zeile 257 | Zeile 276 |
---|
// 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) {
| insertStandardButton: function(into, id, src, insertText, insertExtra, alt) {
|
Zeile 325 | Zeile 364 |
---|
toolbarItemOut: function(e) { element = MyBB.eventElement(e);
|
toolbarItemOut: function(e) { element = MyBB.eventElement(e);
|
|
|
if(!element) { return false; }
|
if(!element) { return false; }
|
|
|
if(element.insertText)
|
if(element.insertText)
|
{
| {
|
if(element.insertExtra) { insertCode = element.insertText+"_"+element.insertExtra;
| if(element.insertExtra) { insertCode = element.insertText+"_"+element.insertExtra;
|
Zeile 339 | Zeile 380 |
---|
{ 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 348 | Zeile 390 |
---|
},
toolbarItemHover: function(e)
|
},
toolbarItemHover: function(e)
|
{ element = MyBB.eventElement(e); if(!element) { return false;
| { element = MyBB.eventElement(e); if(!element) { 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 372 | Zeile 418 |
---|
else { this.insertMyCode(element.insertText, element.insertExtra);
|
else { this.insertMyCode(element.insertText, element.insertExtra);
|
} },
| } },
|
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) { return false;
| { element = MyBB.eventElement(e); if(!element) { 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 406 | Zeile 458 |
---|
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";
|
if(listItem != "" && listItem != null) { list = list+"[*]"+listItem+"\n";
|
}
| }
|
} while(listItem != "" && listItem != null);
|
} while(listItem != "" && listItem != null);
|
|
|
if(list == "")
|
if(list == "")
|
{
| {
|
return false; }
|
return false; }
|
|
|
if(type) { list = "[list="+type+"]\n"+list;
|
if(type) { list = "[list="+type+"]\n"+list;
|
}
| }
|
else { list = "[list]\n"+list; }
|
else { 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) { this.performInsert("[url="+url+"]"+title+"[/url]", "", true, false);
| if(title) { this.performInsert("[url="+url+"]"+title+"[/url]", "", true, false);
|
Zeile 466 | Zeile 528 |
---|
else { this.performInsert("[url]"+url+"[/url]", "", true, false);
|
else { this.performInsert("[url]"+url+"[/url]", "", true, false);
|
} }
| } }
|
},
insertEmail: function() { selectedText = this.getSelectedText($(this.textarea)); email = prompt(this.options.lang.enter_email, "");
|
},
insertEmail: function() { 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 498 | Zeile 562 |
---|
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 531 | Zeile 596 |
---|
{ 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(this.openTags[i] == full_tag) { no_insert = true;
| if(this.openTags[i] == full_tag) { no_insert = true;
|
Zeile 556 | Zeile 625 |
---|
} } }
|
} } }
|
|
|
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+"]";
|
Zeile 584 | Zeile 655 |
---|
} } }
|
} } }
|
| 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 609 | Zeile 685 |
---|
var start = element.value.substring(0, select_start); var middle = element.value.substring(select_start, select_end); return middle;
|
var start = element.value.substring(0, select_start); var middle = element.value.substring(select_start, select_end); return middle;
|
}
| }
|
},
|
},
|
|
|
performInsert: function(open_tag, close_tag, is_single, ignore_selection) { var is_closed = true;
| performInsert: function(open_tag, close_tag, is_single, ignore_selection) { var is_closed = true;
|
Zeile 619 | Zeile 695 |
---|
if(!ignore_selection) { var ignore_selection = false;
|
if(!ignore_selection) { var ignore_selection = false;
|
}
| }
|
if(!close_tag)
|
if(!close_tag)
|
{
| {
|
var close_tag = ""; } var textarea = $(this.textarea); textarea.focus();
|
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)
|
if(ignore_selection != false)
|
{
| {
|
selection.collapse; }
|
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 644 | Zeile 724 |
---|
else { var keep_selected = false;
|
else { var keep_selected = false;
|
|
|
if(is_single) { is_closed = false;
| if(is_single) { is_closed = false;
|
Zeile 662 | Zeile 743 |
---|
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)
|
if(select_end <= 2)
|
{
| {
|
select_end = textarea.textLength; }
|
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; middle = open_tag+middle+close_tag;
|
if(select_end - select_start > 0 && ignore_selection != true && close_tag != "") { var keep_selected = true; middle = open_tag+middle+close_tag;
|
}
| }
|
else { var keep_selected = false;
| else { var keep_selected = false;
|
Zeile 683 | Zeile 767 |
---|
} 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 695 | Zeile 781 |
---|
textarea.selectionEnd = textarea.selectionStart; } textarea.scrollTop = scroll_top;
|
textarea.selectionEnd = textarea.selectionStart; } textarea.scrollTop = scroll_top;
|
}
| }
|
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 717 | Zeile 805 |
---|
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($(tag))
| if($(exploded_tag[0]))
|
{
|
{
|
DomLib.removeClass($(tag), "toolbar_clicked");
| tag = $(exploded_tag[0]); if(tag.type == "select-one") { tag.selectedIndex = 0; } else { DomLib.removeClass($(tag), "toolbar_clicked"); }
|
} } }
| } } }
|
Zeile 729 | Zeile 826 |
---|
},
setToolbarItemState: function(id, state)
|
},
setToolbarItemState: function(id, state)
|
{
| {
|
element = $(id); if(element && element != null) {
| element = $(id); if(element && element != null) {
|
Zeile 739 | Zeile 836 |
---|
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 762 | Zeile 861 |
---|
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;
|