Software: Apache/2.0.54 (Fedora). PHP/5.0.4 uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /home/mnnews/public_html/dwmail/scripts/ drwxr-xr-x | |
| Viewing file: Select action/file-type: var starttime = new Date();
var f1 = new Array("Arial, Helvetica, sans-serif","Arial Black","Comic Sans MS","Courier New, Courier, mono","Fixedsys","Garamond","Georgia, Times New Roman, Times, serif","Geneva, Arial, Helvetica, sans-serif","Impact","Microsoft Sans Serif, Helvetica, sans-serif","System","Tahoma, Verdana, Arial, Helvetica, sans-serif","Times New Roman, Times, serif","Trebuchet MS, Verdana, Arial, Helvetica, sans-serif","Verdana, Arial, Helvetica, sans-serif");
var f2 = new Array("Arial","Arial Black","Comic Sans MS","Courier New","Fixedsys","Garamond","Georgia","Geneva","Impact","Microsoft Sans Serif","System","Tahoma","Times New Roman","Trebuchet MS","Verdana");
var c1 = new Array("FFFFCC","FFCC66","FF9900","FFCC99","FF6633","FFCCCC","CC9999","FF6699","FF99CC","FF66CC","FFCCFF","CC99CC","CC66FF","CC99FF","9966CC","CCCCFF","9999CC","3333FF","6699FF","0066FF","99CCFF","66CCFF","99CCCC","CCFFFF","99FFCC","66CC99","66FF99","99FF99","CCFFCC","33FF33","66FF00","CCFF99","99FF00","CCFF66","CCCC66","FFFFFF");
var c2 = new Array("FFFF99","FFCC00","FF9933","FF9966","CC3300","FF9999","CC6666","FF3366","FF3399","FF00CC","FF99FF","CC66CC","CC33FF","9933CC","9966FF","9999FF","6666FF","3300FF","3366FF","0066CC","3399FF","33CCFF","66CCCC","99FFFF","66FFCC","33CC99","33FF99","66FF66","99CC99","00FF33","66FF33","99FF66","99FF33","CCFF00","CCCC33","CCCCCC");
var c3 = new Array("FFFF66","FFCC33","CC9966","FF6600","FF3300","FF6666","CC3333","FF0066","FF0099","FF33CC","FF66FF","CC00CC","CC00FF","9933FF","6600CC","6633FF","6666CC","3300CC","0000FF","3366CC","0099FF","00CCFF","339999","66FFFF","33FFCC","00CC99","00FF99","33FF66","66CC66","00FF00","33FF00","66CC00","99CC66","CCFF33","999966","999999");
var c4 = new Array("FFFF33","CC9900","CC6600","CC6633","FF0000","FF3333","993333","CC3366","CC0066","CC6699","FF33FF","CC33CC","9900CC","9900FF","6633CC","6600FF","666699","3333CC","0000CC","0033FF","6699CC","3399CC","669999","33FFFF","00FFCC","339966","33CC66","00FF66","669966","00CC00","33CC00","66CC33","99CC00","CCCC99","999933","666666");
var c5 = new Array("FFFF00","CC9933","996633","993300","CC0000","FF0033","990033","996666","993366","CC0099","FF00FF","990099","996699","660099","663399","330099","333399","000099","0033CC","003399","336699","0099CC","006666","00FFFF","33CCCC","009966","00CC66","339933","336633","33CC33","339900","669933","99CC33","666633","999900","333333");
var c6 = new Array("CCCC00","996600","663300","660000","990000","CC0033","330000","663333","660033","990066","CC3399","993399","660066","663366","330033","330066","333366","000066","000033","003366","006699","003333","336666","00CCCC","009999","006633","009933","006600","003300","00CC33","009900","336600","669900","333300","666600","000000");
var s1 = new Array("1","2","3","4","5","6","7");
// --------------------------------------------------------
function ReFormat(form) {
var field = document.getElementById('body');
field.value = document.getElementById('editorHTML').innerHTML;
}
// --------------------------------------------------------
function getOffsetTop(elm) {
var mOffsetTop = elm.offsetTop;
var mOffsetParent = elm.offsetParent;
while(mOffsetParent) {
mOffsetTop += mOffsetParent.offsetTop;
mOffsetParent = mOffsetParent.offsetParent;
}
return mOffsetTop;
}
function getOffsetLeft(elm) {
var mOffsetLeft = elm.offsetLeft;
var mOffsetParent = elm.offsetParent;
while(mOffsetParent) {
mOffsetLeft += mOffsetParent.offsetLeft;
mOffsetParent = mOffsetParent.offsetParent;
}
return mOffsetLeft;
}
function PopupHide() {
ForeColorBox.style.display = 'none';
FontFaceBox.style.display = 'none';
FontSizeBox.style.display = 'none';
changeImages('ifont2', 'images/wysiwyg/font_off.gif');
changeImages('isize2', 'images/wysiwyg/size_off.gif');
changeImages('icolour2', 'images/wysiwyg/forecolour_off.gif');
changeImages('icolour3', 'images/wysiwyg/downarrow_off.gif');
}
// --------------------------------------------------------
function SelectSize() {
PopupHide();
buttonElement = document.getElementById('isize');
if(divFontSize.innerHTML == '') {
divFontSize.innerHTML = SizePicker("idFontSize","ec2('FontSize', idFontSize.value); RefreshElements();");
for (i=0; i<divFontSize.all.length; i++) {
divFontSize.all(i).unselectable = "on";
}
}
DefaultColor("idFontSize","");
document.getElementById("FontSizeBox").style.left = getOffsetLeft(buttonElement);
document.getElementById("FontSizeBox").style.top = getOffsetTop(buttonElement) + buttonElement.offsetHeight;
document.getElementById("FontSizeBox").style.display = 'block';
changeImages('isize2', 'images/wysiwyg/size_on.gif');
}
function SizePicker(strName, strCommand) {
var ReturnID = strName;
var sHTML = "";
sHTML += ("<table width='100%' cellpadding='2' border='0' cellspacing='0'><tr><td>");
sHTML += ("<table cellpadding='0' cellspacing='0' border='0' width=\"100%\">");
for(var r=0;r<eval("s1").length;r++) {
sHTML += ("<tr>");
var size = eval("s1[r]");
sHTML += ("<td align=\"center\" onclick=\"" + ReturnID + ".value='" + size + "';" + strCommand + "\" style=\" cursor:hand;\"><table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" style=\"border-width:1px; border-style:solid; background-color:#FFFFFF; border-color:#FFFFFF;\" onmouseover=\"this.style.backgroundColor='#FFD091'; this.style.borderColor='#4B4B6F';\" onmouseout=\"this.style.backgroundColor='#FFFFFF'; this.style.borderColor='#FFFFFF';\"><tr><td><font size=\""+ size + "\">"+ size +"</font></td></tr></table></td>");
sHTML += ("</tr>");
}
sHTML += ("</table>");
sHTML += ("<input type='hidden' id='"+ReturnID+"'>");
sHTML += ("</td></tr></table>");
return sHTML;
}
function DefaultSize(strName, strFontFace) {
var ReturnID = strName
eval(ReturnID).value = strFontSize;
}
// --------------------------------------------------------
function SelectFont() {
PopupHide();
buttonElement = document.getElementById('ifont');
if(divFontFace.innerHTML == '') {
divFontFace.innerHTML = FontPicker("idFontFace","ec2('FontName', idFontFace.value); RefreshElements();");
for (i=0; i<divFontFace.all.length; i++) {
divFontFace.all(i).unselectable = "on";
}
}
DefaultFont("idFontFace","");
document.getElementById("FontFaceBox").style.left = getOffsetLeft(buttonElement);
document.getElementById("FontFaceBox").style.top = getOffsetTop(buttonElement) + buttonElement.offsetHeight;
document.getElementById("FontFaceBox").style.display = 'block';
changeImages('ifont2', 'images/wysiwyg/font_on.gif');
}
function FontPicker(strName, strCommand) {
var ReturnID = strName;
var sHTML = "";
sHTML += ("<table width='100%' cellpadding='2' border='0' cellspacing='0'><tr><td>");
sHTML += ("<table cellpadding='0' cellspacing='0' border='0' width=\"100%\">");
for(var r=0;r<eval("f1").length;r++) {
sHTML += ("<tr>");
var face = eval("f1[r]");
var facesel = eval("f2[r]");
sHTML += ("<td onclick=\"" + ReturnID + ".value='" + face + "';" + strCommand + "\" style=\" cursor:hand;\"><table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" style=\"border-width:1px; border-style:solid; background-color:#FFFFFF; border-color:#FFFFFF;\" onmouseover=\"this.style.backgroundColor='#FFD091'; this.style.borderColor='#4B4B6F';\" onmouseout=\"this.style.backgroundColor='#FFFFFF'; this.style.borderColor='#FFFFFF';\"><tr><td><font face=\""+ face +"\" size=\"2\">"+ facesel +"</font></td></tr></table></td>");
sHTML += ("</tr>");
}
sHTML += ("</table>");
sHTML += ("<input type='hidden' id='"+ReturnID+"'>");
sHTML += ("</td></tr></table>");
return sHTML;
}
function DefaultFont(strName, strFontFace) {
var ReturnID = strName
eval(ReturnID).value = strFontFace;
}
// --------------------------------------------------------
function SelectColour() {
PopupHide();
buttonElement = document.getElementById('icolour');
if(divFgColor.innerHTML == '') {
divFgColor.innerHTML = ColourPicker("idForeColor","ec2('ForeColor', idForeColor.value); RefreshElements();");
for (i=0; i<divFgColor.all.length; i++) {
divFgColor.all(i).unselectable = "on";
}
}
DefaultColor("idForeColor","");
document.getElementById("ForeColorBox").style.left = getOffsetLeft(buttonElement);
document.getElementById("ForeColorBox").style.top = getOffsetTop(buttonElement) + buttonElement.offsetHeight;
document.getElementById("ForeColorBox").style.display = 'block';
changeImages('icolour2', 'images/wysiwyg/forecolour_on.gif');
changeImages('icolour3', 'images/wysiwyg/downarrow_on.gif');
}
function ColourPicker(strName, strCommand) {
var ReturnID = strName;
var sHTML = "";
sHTML += ("<table style='border-width:1px; border-style:solid; border-color:#808080; background:#FFFFFF;' width='325' cellpadding='5' cellspacing='0'><tr><td>");
sHTML += ("<table cellpadding='0' cellspacing='2'>");
for(var i=1;i<=6;i++) {
sHTML += ("<tr>");
for(var r=0;r<eval("c"+i).length;r++) {
var colour = eval("c"+i+"[r]");
sHTML += ("<td onclick=\"" + ReturnID + ".value='" + colour + "';" + strCommand + "\" style=\" cursor:hand; background-color:"+colour+";\" width=\"10\" height=\"10\"><table style=\"border-width:1px; border-style:solid; border-color:#808080;\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" onmouseover=\"this.style.borderColor='red';\" onmouseout=\"this.style.borderColor='#808080';\"><tr><td height=\"10\"></td></tr></table></td>");
}
sHTML += ("</tr>");
}
sHTML += ("</table>");
sHTML += ("<input type='hidden' id='"+ReturnID+"'>");
sHTML += ("</td></tr></table>");
return sHTML;
}
function DefaultColor(strName, strColour) {
var ReturnID = strName
eval(ReturnID).value = strColour;
}
// --------------------------------------------------------
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}
var preloadFlag = false;
if (document.images) {
nav_over = newImage("images/wysiwyg/bold_on.gif");
italic_over = newImage("images/wysiwyg/italic_on.gif");
underline_over = newImage("images/wysiwyg/underline_on.gif");
strike_over = newImage("images/wysiwyg/strike_on.gif");
sup_over = newImage("images/wysiwyg/sup_on.gif");
sub_over = newImage("images/wysiwyg/sub_on.gif");
ol_over = newImage("images/wysiwyg/ol_on.gif");
ul_over = newImage("images/wysiwyg/ul_on.gif");
toleft_over = newImage("images/wysiwyg/toleft_on.gif");
toright_over = newImage("images/wysiwyg/toright_on.gif");
link_over = newImage("images/wysiwyg/link_on.gif");
left_over = newImage("images/wysiwyg/left_on.gif");
center_over = newImage("images/wysiwyg/center_on.gif");
right_over = newImage("images/wysiwyg/right_on.gif");
cut_over = newImage("images/wysiwyg/cut_on.gif");
copy_over = newImage("images/wysiwyg/copy_on.gif");
paste_over = newImage("images/wysiwyg/paste_on.gif");
undo_over = newImage("images/wysiwyg/undo_on.gif");
redo_over = newImage("images/wysiwyg/redo_on.gif");
table_over = newImage("images/wysiwyg/table_on.gif");
picture_over = newImage("images/wysiwyg/picture_on.gif");
downarrow_over = newImage("images/wysiwyg/downarrow_on.gif");
forecolour_over = newImage("images/wysiwyg/forecolour_on.gif");
symbol_over = newImage("images/wysiwyg/symbol_on.gif");
preloadFlag = true;
}
// --------------------------------------------------------
function Table_showdialog(objTableProperties) {
var objNewTableProperties = showModalDialog("includes/wysiwyg_generic.php?tpl=table&" + sessionvar, objTableProperties, "dialogWidth:425px;dialogHeight:400px;help:0;status:no;");
return objNewTableProperties;
}
function Table_OnClick() {
if (document.getElementById('body').style.display == "none") {
var objTableProperties = new Array();
var objNewTableProperties = new Array();
var objSelection = document.getElementById('editorHTML').document.selection;
var objRange = objSelection.createRange();
var type = objSelection.type;
// if table was selected
if (type=="Control") {
for (i = 0; i < objRange.length; i++) {
var objElement = objRange(i);
if(objElement.tagName == "TABLE") {
//get table properties
var lastchar = objElement.width.substr((objElement.width.length-1));
if (lastchar == '%') {
objTableProperties[0] = objElement.width.replace(/%/, '');
objTableProperties[10] = 'pc';
}
else {
objTableProperties[0] = objElement.width;
objTableProperties[10] = 'px';
}
objTableProperties[1] = objElement.height;
objTableProperties[2] = objElement.border;
objTableProperties[3] = objElement.align;
objTableProperties[4] = objElement.bgColor;
objTableProperties[5] = objElement.borderColor;
objTableProperties[6] = objElement.cellSpacing;
objTableProperties[7] = objElement.cellPadding;
objTableProperties[11] = objElement.summary;
// open table dialog and get new table properties
objNewTableProperties = Table_showdialog(objTableProperties);
// if dialog has returned new table properties - reassign them
if(objNewTableProperties != null ) {
if (objNewTableProperties[10] == 'pc') {
objElement.width = objNewTableProperties[0] + '%';
}
else {
objElement.width = objNewTableProperties[0];
}
objElement.height = objNewTableProperties[1];
objElement.border = objNewTableProperties[2];
objElement.align = objNewTableProperties[3];
objElement.bgColor = objNewTableProperties[4];
objElement.borderColor = objNewTableProperties[5];
objElement.cellSpacing = objNewTableProperties[6];
objElement.cellPadding = objNewTableProperties[7];
objElement.summary = objNewTableProperties[11];
}
}
}
}
// insert new table
else {
// open table dialog and get new table properties
objNewTableProperties = Table_showdialog(objTableProperties);
// if dialog has returned new table properties - reassign them
if(objNewTableProperties != null ) {
var tableCode = MakeTable(objTableProperties);
InsertHtmlCode(tableCode);
}
}
}
else {
alert("Sorry that function is not available in HTML mode");
}
}
//----------------------------------------------------------------
function MakeTable(objTableProperties) {
var height = objTableProperties[1];
var border = objTableProperties[2];
var align = objTableProperties[3];
var bgColor = objTableProperties[4];
var borderColor = objTableProperties[5];
var cellSpacing = objTableProperties[6];
var cellPadding = objTableProperties[7];
var rowCount = objTableProperties[8];
var colCount = objTableProperties[9];
var summary = objTableProperties[11];
var width;
if (objTableProperties[10] == 'pc') {
width = objTableProperties[0] + '%';
}
else {
width = objTableProperties[0];
}
var strHtml = "";
strHtml += "<table ";
if(width!="") strHtml += " width=\""+width+"\" ";
if(height!="") strHtml += " height=\""+height+"\" ";
if(border!="") strHtml += " border=\""+border+"\" ";
strHtml += " cellspacing=\""+cellSpacing+"\" cellpadding=\""+cellPadding+"\" align=\""+align+"\"";
if(borderColor!="") strHtml += " bordercolor=\""+borderColor+"\" ";
if(bgColor!="") strHtml += " bgcolor=\""+bgColor+"\" ";
if(summary!="") strHtml += " summary=\""+summary.replace(/"/, '"')+"\" ";
strHtml += ">";
for(var i=0; i<rowCount; i++)
{
strHtml += "<tr>";
for(var j=0; j<colCount; j++)
{
strHtml += "<td valign=\"top\" id=\"etd\"></td>";
strHtml += "";
}
strHtml += "</tr>";
}
strHtml += "</table>";
return strHtml;
}
// --------------------------------------------------------
function Symbol_showdialog(objSymbolProperties) {
var objNewSymbolProperties = showModalDialog("includes/wysiwyg_generic.php?tpl=symbol&" + sessionvar, objSymbolProperties, "dialogWidth:340px;dialogHeight:325px;help:0;status:no;");
return objNewSymbolProperties;
}
function Symbol_OnClick() {
if (document.getElementById('body').style.display == "none") {
var objSymbolProperties = new Array();
var objNewSymbolProperties = new Array();
// open symbol dialog
objNewSymbolProperties = Symbol_showdialog(objSymbolProperties);
if(objNewSymbolProperties != null ) {
InsertHtmlCode(objNewSymbolProperties[0]);
}
}
else {
alert("Sorry that function is not available in HTML mode");
}
}
// --------------------------------------------------------
function Picture_showdialog(objPictureProperties) {
var objNewPictureProperties = showModalDialog("includes/wysiwyg_picture.php?" + sessionvar, objPictureProperties, "dialogWidth:450px;dialogHeight:300px;help:0;status:no;");
return objNewPictureProperties;
}
function Picture_OnClick() {
if (document.getElementById('body').style.display == "none") {
var objPictureProperties = new Array();
var objNewPictureProperties = new Array();
var objSelection = editorHTML.document.selection;
var objRange = objSelection.createRange();
var type = objSelection.type;
// if Picture was selected
if (type=="Control") {
for (i = 0; i < objRange.length; i++) {
var objElement = objRange(i);
if(objElement.tagName == "IMG") {
//get Picture properties
objPictureProperties[0] = objElement.width;
objPictureProperties[1] = objElement.height;
objPictureProperties[2] = objElement.border;
objPictureProperties[3] = objElement.align;
objPictureProperties[4] = objElement.src;
objPictureProperties[5] = objElement.alt;
// open Picture dialog and get new Picture properties
objNewPictureProperties = Picture_showdialog(objPictureProperties);
// if dialog has returned new Picture properties - reassign them
if(objNewPictureProperties != null ) {
objElement.width = objNewPictureProperties[0];
objElement.height = objNewPictureProperties[1];
objElement.border = objNewPictureProperties[2];
objElement.align = objNewPictureProperties[3];
objElement.src = objNewPictureProperties[4];
objElement.alt = objNewPictureProperties[5];
}
}
}
}
// insert new Picture
else {
// open Picture dialog and get new Picture properties
objNewPictureProperties = Picture_showdialog(objPictureProperties);
// if dialog has returned new Picture properties - reassign them
if(objNewPictureProperties != null ) {
var PictureCode = MakePicture(objPictureProperties);
InsertHtmlCode(PictureCode);
}
}
}
else {
alert("Sorry that function is not available in HTML mode");
}
}
//----------------------------------------------------------------
function MakePicture(objPictureProperties) {
var width = objPictureProperties[0];
var height = objPictureProperties[1];
var border = objPictureProperties[2];
var align = objPictureProperties[3];
var src = objPictureProperties[4];
var alt = objPictureProperties[5];
var strHtml = "";
strHtml += "<img ";
if(src!="") strHtml += " src='"+src+"' ";
if(width!="") strHtml += " width='"+width+"' ";
if(height!="") strHtml += " height='"+height+"' ";
if(border!="") strHtml += " border='"+border+"' ";
if(alt!="") strHtml += " alt='"+alt+"' ";
if(align!="") strHtml += " align='"+align+"' ";
strHtml += " />";
return strHtml;
}
// --------------------------------------------------------
function InsertHtmlCode(strHtmlCode) {
document.getElementById('editorHTML').focus();
var objRange = document.getElementById('editorHTML').document.selection.createRange();
objRange.pasteHTML(strHtmlCode);
}
// --------------------------------------------------------
function InsertExecCommand(strCommandRef) {
document.getElementById('editorHTML').focus();
document.execCommand("CreateLink",false,strCommandRef[0]);
}
// --------------------------------------------------------
function trimFont(fontString) {
commaPos = fontString.indexOf(",");
if (commaPos != -1) {
fontString = fontString.substring(0, commaPos);
}
return fontString.substring(0, 1).toUpperCase() + fontString.substring(1);
}
// --------------------------------------------------------
var doNext = true;
function RefreshElements(element, force) {
if (document.selection.type == "Control") {
return;
}
PopupHide();
curSelection = document.selection.createRange();
cPos = curSelection.duplicate();
kc = window.event.keyCode;
if (!(doNext == true || (kc>32 && kc<41) || kc==0 || kc==8 || kc==17 || kc==46)) {
return;
}
else if (doNext == true) {
doNext = false;
}
else {
doNext = true;
}
var theText = curSelection.parentElement();
var selectedText = theText.currentStyle;
// Set the font face
newFont = trimFont(selectedText.fontFamily);
document.getElementById("fontbar").innerHTML = newFont;
// Set the font size
newSize = selectedText.fontSize;
if (newSize == '11px') {
newSize = idFontSize;
}
document.getElementById("fontsizebar").innerHTML = newSize;
// Set the font color
newColor = selectedText.color.toUpperCase();
document.getElementById("colourbar").style.backgroundColor = newColor;
// Set alignment
newAlign = selectedText.textAlign;
if (newAlign == "left") {
changeImages('left', 'images/wysiwyg/left_sel.gif');
changeImages('right', 'images/wysiwyg/right_off.gif');
changeImages('center', 'images/wysiwyg/center_off.gif');
}
if (newAlign == "center") {
changeImages('center', 'images/wysiwyg/center_sel.gif');
changeImages('left', 'images/wysiwyg/left_off.gif');
changeImages('right', 'images/wysiwyg/right_off.gif');
}
if (newAlign == "right") {
changeImages('right', 'images/wysiwyg/right_sel.gif');
changeImages('left', 'images/wysiwyg/left_off.gif');
changeImages('center', 'images/wysiwyg/center_off.gif');
}
// Set font weight
newWeight = selectedText.fontWeight;
if (newWeight == "700") { changeImages('bold', 'images/wysiwyg/bold_sel.gif'); }
else { changeImages('bold', 'images/wysiwyg/bold_off.gif'); }
// Set font style
newStyle = selectedText.fontStyle;
if (newStyle == "italic") { changeImages('italic', 'images/wysiwyg/italic_sel.gif'); }
else { changeImages('italic', 'images/wysiwyg/italic_off.gif'); }
// Set underline
newUL = selectedText.textDecoration;
if (newUL == "underline") { changeImages('underline', 'images/wysiwyg/underline_sel.gif'); }
else { changeImages('underline', 'images/wysiwyg/underline_off.gif'); }
// Set strikethrough
newUL = selectedText.textDecoration;
if (newUL == "line-through") { changeImages('strike', 'images/wysiwyg/strike_sel.gif'); }
else { changeImages('strike', 'images/wysiwyg/strike_off.gif'); }
}
function ButtonActiveOff(strWhich, element, force) {
var objSelection = editorHTML.document.selection;
var objRange = objSelection.createRange();
var type = objSelection.type;
// if Picture was selected
if(type=="Control") {
}
else {
curSelection = document.selection.createRange();
cPos = curSelection.duplicate();
var theText = curSelection.parentElement();
var selectedText = theText.currentStyle;
if (strWhich == "Bold") {
newWeight = selectedText.fontWeight;
if (newWeight != "700") { changeImages('bold', 'images/wysiwyg/bold_off.gif'); }
else { changeImages('bold', 'images/wysiwyg/bold_sel.gif'); }
}
if (strWhich == "Italic") {
newStyle = selectedText.fontStyle;
if (newStyle != "italic") { changeImages('italic', 'images/wysiwyg/italic_off.gif'); }
else { changeImages('italic', 'images/wysiwyg/italic_sel.gif'); }
}
if (strWhich == "UL") {
newUL = selectedText.textDecoration;
if (newUL != "underline") { changeImages('underline', 'images/wysiwyg/underline_off.gif'); }
else { changeImages('underline', 'images/wysiwyg/underline_sel.gif'); }
}
if (strWhich == "Strike") {
newUL = selectedText.textDecoration;
if (newUL != "line-through") { changeImages('strike', 'images/wysiwyg/strike_off.gif'); }
else { changeImages('strike', 'images/wysiwyg/strike_sel.gif'); }
}
if (strWhich == "Left") {
newUL = selectedText.textAlign;
if (newUL != "left") { changeImages('left', 'images/wysiwyg/left_off.gif'); }
else { changeImages('left', 'images/wysiwyg/left_sel.gif'); }
}
if (strWhich == "Center") {
newUL = selectedText.textAlign;
if (newUL != "center") { changeImages('center', 'images/wysiwyg/center_off.gif'); }
else { changeImages('center', 'images/wysiwyg/center_sel.gif'); }
}
if (strWhich == "Right") {
newUL = selectedText.textAlign;
if (newUL != "right") { changeImages('right', 'images/wysiwyg/right_off.gif'); }
else { changeImages('right', 'images/wysiwyg/right_sel.gif'); }
}
}
}
function ButtonActiveOver(strWhich, element, force) {
var objSelection = document.getElementById('editorHTML').document.selection;
var objRange = objSelection.createRange();
var type = objSelection.type;
// if Picture was selected
if (type=="Control") {
}
else {
curSelection = document.selection.createRange();
cPos = curSelection.duplicate();
var theText = curSelection.parentElement();
var selectedText = theText.currentStyle;
if (strWhich == "Bold") {
newWeight = selectedText.fontWeight;
if (newWeight != "700") { changeImages('bold', 'images/wysiwyg/bold_on.gif'); }
else { changeImages('bold', 'images/wysiwyg/bold_sel2.gif'); }
}
if (strWhich == "Italic") {
newStyle = selectedText.fontStyle;
if (newStyle != "italic") { changeImages('italic', 'images/wysiwyg/italic_on.gif'); }
else { changeImages('italic', 'images/wysiwyg/italic_sel2.gif'); }
}
if (strWhich == "UL") {
newUL = selectedText.textDecoration;
if (newUL != "underline") { changeImages('underline', 'images/wysiwyg/underline_on.gif'); }
else { changeImages('underline', 'images/wysiwyg/underline_sel2.gif'); }
}
if (strWhich == "Strike") {
newUL = selectedText.textDecoration;
if (newUL != "line-through") { changeImages('strike', 'images/wysiwyg/strike_on.gif'); }
else { changeImages('strike', 'images/wysiwyg/strike_sel2.gif'); }
}
if (strWhich == "Left") {
newUL = selectedText.textAlign;
if (newUL != "left") { changeImages('left', 'images/wysiwyg/left_on.gif'); }
else { changeImages('left', 'images/wysiwyg/left_sel2.gif'); }
}
if (strWhich == "Center") {
newUL = selectedText.textAlign;
if (newUL != "center") { changeImages('center', 'images/wysiwyg/center_on.gif'); }
else { changeImages('center', 'images/wysiwyg/center_sel2.gif'); }
}
if (strWhich == "Right") {
newUL = selectedText.textAlign;
if (newUL != "right") { changeImages('right', 'images/wysiwyg/right_on.gif'); }
else { changeImages('right', 'images/wysiwyg/right_sel2.gif'); }
}
}
}
// --------------------------------------------------------
function ec(strCommandRef) {
document.getElementById('editorHTML').focus();
try {
document.execCommand(strCommandRef);
RefreshElements();
}
catch(e) {
alert(strCommandRef +' '+Lang_CommandNotSupported);
}
document.getElementById('editorHTML').focus();
}
function ec2(strCommandRef, strOption) {
PopupHide();
if (strCommandRef == 'ForeColor') {
document.getElementById("colourbar").style.backgroundColor = strOption;
}
document.getElementById('editorHTML').focus();
document.execCommand(strCommandRef, false, strOption);
document.getElementById('editorHTML').focus();
}
// --------------------------------------------------------
function CaptureReturn() {
if (window.event.keyCode == 13) {
newrange = document.getElementById('editorHTML').document.selection.createRange();
parente = newrange.parentElement();
while (parente.tagName != "P" && parente.tagName != "DIV") {
parente = parente.parentNode;
}
if (parente.tagName == "P") {
parente.style.margin = "0px";
}
}
}
function InitializeEditor() {
buttonElement = document.getElementById('icolour');
document.getElementById("colourbar").style.left = getOffsetLeft(buttonElement) + 4;
document.getElementById("colourbar").style.top = getOffsetTop(buttonElement) + buttonElement.offsetHeight - 7;
document.getElementById("colourbar").style.display = 'block';
buttonElement = document.getElementById('ifont');
document.getElementById("fontbar").style.left = getOffsetLeft(buttonElement) + 5;
document.getElementById("fontbar").style.top = getOffsetTop(buttonElement) + 4;
newFont = trimFont(idFontFace);
document.getElementById("fontbar").innerHTML = newFont;
document.getElementById("fontbar").style.display = 'block';
buttonElement = document.getElementById('isize');
document.getElementById("fontsizebar").style.left = getOffsetLeft(buttonElement) + 5;
document.getElementById("fontsizebar").style.top = getOffsetTop(buttonElement) + 4;
document.getElementById("fontsizebar").innerHTML = idFontSize;
document.getElementById("fontsizebar").style.display = 'block';
document.getElementById('editorHTML').contentEditable = true;
// Capture carriage returns and set the paragraph border to 0px
document.getElementById('editorHTML').attachEvent("onkeypress", CaptureReturn);
var loadedtime = new Date();
window.status = Lang_Loaded + ' ' + (loadedtime - starttime) / 1000 + ' ' + Lang_Seconds;
return true;
}
|
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0035 ]-- |