phpBB

Code Changes

File: adm/style/editor.js

  Unmodified   Added   Modified   Removed
Line 16Line 16
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));

var baseHeight;

var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));

var baseHeight;

window.onload = initInsertions;

 

/**
* Shows the help messages in the helpline window


/**
* Shows the help messages in the helpline window

Line 47Line 46
	{
textarea.focus();
baseHeight = doc.selection.createRange().duplicate().boundingHeight;

	{
textarea.focus();
baseHeight = doc.selection.createRange().duplicate().boundingHeight;

		// document.body.focus();






if (!document.forms[form_name])
{
document.body.focus();
}

	}
}


	}
}


Line 153Line 156
		var sel_start = textarea.selectionStart;
var sel_end = textarea.selectionEnd;


		var sel_start = textarea.selectionStart;
var sel_end = textarea.selectionEnd;


		mozWrap(textarea, text, '')

		mozWrap(textarea, text, '');

		textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length;
}

		textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length;
}

Line 231Line 234
			theSelection = theSelection.replace(/&lt\;/ig, '<');
theSelection = theSelection.replace(/&gt\;/ig, '>');
theSelection = theSelection.replace(/&amp\;/ig, '&');

			theSelection = theSelection.replace(/&lt\;/ig, '<');
theSelection = theSelection.replace(/&gt\;/ig, '>');
theSelection = theSelection.replace(/&amp\;/ig, '&');

 
			theSelection = theSelection.replace(/&nbsp\;/ig, ' ');

		}
else if (document.all)
{

		}
else if (document.all)
{

Line 259Line 263
*/
function mozWrap(txtarea, open, close)
{

*/
function mozWrap(txtarea, open, close)
{

	var selLength = txtarea.textLength;

	var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;

	var selStart = txtarea.selectionStart;
var selEnd = txtarea.selectionEnd;
var scrollTop = txtarea.scrollTop;

	var selStart = txtarea.selectionStart;
var selEnd = txtarea.selectionEnd;
var scrollTop = txtarea.scrollTop;

Line 270Line 274
	}

var s1 = (txtarea.value).substring(0,selStart);

	}

var s1 = (txtarea.value).substring(0,selStart);

	var s2 = (txtarea.value).substring(selStart, selEnd)

	var s2 = (txtarea.value).substring(selStart, selEnd);

	var s3 = (txtarea.value).substring(selEnd, selLength);

txtarea.value = s1 + open + s2 + close + s3;

	var s3 = (txtarea.value).substring(selEnd, selLength);

txtarea.value = s1 + open + s2 + close + s3;

	txtarea.selectionStart = selEnd + open.length + close.length;
txtarea.selectionEnd = txtarea.selectionStart;

	txtarea.selectionStart = selStart + open.length;
txtarea.selectionEnd = selEnd + open.length;

	txtarea.focus();
txtarea.scrollTop = scrollTop;


	txtarea.focus();
txtarea.scrollTop = scrollTop;


Line 288Line 292
*/
function storeCaret(textEl)
{

*/
function storeCaret(textEl)
{

	if (textEl.createTextRange)

	if (textEl.createTextRange && document.selection)

	{
textEl.caretPos = document.selection.createRange().duplicate();
}

	{
textEl.caretPos = document.selection.createRange().duplicate();
}

Line 328Line 332
			for (b = 0; b < 5; b++)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);

			for (b = 0; b < 5; b++)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);

				document.write('<td bgcolor="#' + color + '">');
document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');" onmouseout="helpline(\'tip\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');

				document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">');
document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');

				document.writeln('</td>');
}


				document.writeln('</td>');
}