📄 webhtmleditordialog.txt.exclude
字号:
return reg.exec(color)?color: "";
} ;
ColorPicker.prototype.AddCustomColorCell = function (color)
{
color=this.CheckColor(color);
this.SelectColor(color, true);
if ("" != color)this.AddCustomSelectColorCell(color);
} ;
ColorPicker.prototype.AddCustomSelectColorCell= function (color)
{
var table= this.Document.getElementById(this.Id + "Color_Table");
if (!table)return;
var lastRowState=null;
var rowIndex=0;
if (this.ShowAddCustomColor)
{
rowIndex++;
}
if (this.ShowAddHexColor)
{
rowIndex++;
}
if (table.rows.length>(this.ColorsArray.length+rowIndex))
{
var row=table.rows[table.rows.length-1];
if (row.cells.length<this.ColorTableCellLength)
{
lastRowState=row;
}
}
if (!lastRowState)
{
lastRowState=table.insertRow(table.rows.length);
}
this.CreateColorPickerTableCell(lastRowState,color);
if (this.IsIE)
{
this.DropDownMenu.SetDropDownMenuContent(table);
}
} ;
ColorPicker.prototype.CreateColorPickerTableCell= function (colorPickerRow, color)
{
var obj = this;
var cell=colorPickerRow.insertCell(colorPickerRow.cells.length);
cell.onmouseover = function(){this.className = "Over";};
cell.onmouseout = function(){this.className = "";}
cell.onclick = function(){obj.SelectColor(color)}
var div = this.Document.createElement("DIV");
div.style.backgroundColor=color;
if ("" == color)
{
cell.style.backgroundImage="url("+this.ImagePath+"x.gif)";
cell.style.backgroundRepeat="no-repeat";
cell.style.backgroundPosition="center";
}
cell.appendChild(div);
} ;
ColorPicker.prototype.OnAddHexColor= function ()
{
var color=prompt(LR["PromptColor"],"#");
this.AddCustomColorCell(color);
} ;
ColorPicker.prototype.FormatColor= function (color)
{
color=parseInt(color);
color=color.toString(020);
if (color.length<6)
{
var str="000000" .substring(0,(6-color.length));
color="#"+str.concat(color).toUpperCase();
}
else
{
color="#"+color.toUpperCase();
}
return color;
} ;
ColorPicker.prototype.Toggle= function ()
{
if (null != this.DropDownMenu)
{
this.DropDownMenu.Toggle();
if (window.event)
{
window.event.cancelBubble= true;
}
}
} ;
function TablePreView(previewHolder, doc)
{
this.PreviewHolder=previewHolder;
this.Document = doc;
this.PreviewHolder.innerHTML="";
var table = this.Document.createElement("TABLE");
this.PreviewHolder.appendChild(table);
this.PreviewTable = table;
this.SelectCell=null;
}
TablePreView.prototype.UpdateTable= function (table, selectCell)
{
var preTable = this.Document.createElement("TABLE");
preTable.style.width="328px";
preTable.style.height="250px";
preTable.cellPadding=1;
preTable.cellSpacing=1;
for (var i=0; i<table.rows.length; i++)
{
var tableRow=table.rows[i];
var preTableRow=preTable.insertRow(preTable.rows.length);
for (var j=0; j<tableRow.cells.length; j++)
{
var tableCell=tableRow.cells[j];
var preTableCell=preTableRow.insertCell(preTableRow.cells.length);
preTableCell.rowSpan=tableCell.rowSpan;
preTableCell.colSpan=tableCell.colSpan;
if (tableCell == selectCell)
{
preTableCell.className="TableDialogSelectedCell";
this.SelectCell=preTableCell;
}
else
{
preTableCell.className="TableDialogCell";
}
preTableCell.Obj=this ;
preTableCell.onclick=this.PreviewTableCellOnClick;
}
}
this.PreviewTable.parentNode.replaceChild(preTable,this.PreviewTable);
this.PreviewTable=preTable;
} ;
TablePreView.prototype.SelectCellCssClass= function (selectCell)
{
if (this.SelectCell&&this.SelectCell == selectCell)
{
this.SelectCell.className="TableDialogCell";
this.SelectCell=null;
}
else
{
if (this.SelectCell)
{
this.SelectCell.className="TableDialogCell";
}
this.SelectCell=selectCell;
this.SelectCell.className="TableDialogSelectedCell";
}
if (this.ClientSelectCellOnClick)
{
this.ClientSelectCellOnClick();
}
} ;
TablePreView.prototype.PreviewTableCellOnClick= function (e)
{
if (!e)
{
e=window.event;
}
var source=GetSrcElement(e);
this.Obj.SelectCellCssClass(source);
} ;
TablePreView.prototype.GetPreviewViewTable= function ()
{
return this.PreviewTable;
} ;
TablePreView.prototype.GetTablePreviewView_SelectCell= function ()
{
return this.SelectCell;
} ;
function TableBorderControl(doc, id, borderColorPicker, borderSpinBox, themePath)
{
this.Document = doc;
this.ThemePath = themePath;
this.Id=id;
this.TableToModify=null;
this.SpinBox=borderSpinBox;
this.PreViewTable=this.Document.getElementById(this.Id+"PREVIEW");
this.BorderColorPicker = borderColorPicker;
this._FrmBorder = this.Document.getElementById(this.Id+"FrmBorder");
this._AllRowsAndColumns = this.Document.getElementById(this.Id+"AllRowsAndColumns");
this._NoBorders = this.Document.getElementById(this.Id+"NoBorders");
this._InteriorBorders = this.Document.getElementById(this.Id+"InteriorBorders");
this._FrmLeft = this.Document.getElementById(this.Id+"FrmLeft");
this._RuleCols = this.Document.getElementById(this.Id+"RuleCols");
this._FrmRight = this.Document.getElementById(this.Id+"FrmRight");
this._FrmLeftRight = this.Document.getElementById(this.Id+"FrmLeftRight");
this._TopAndBottomSide = this.Document.getElementById(this.Id+"TopAndBottomSide");
this._TopSide = this.Document.getElementById(this.Id+"TopSide");
this._BetweenRows = this.Document.getElementById(this.Id+"BetweenRows");
this._BottomSide = this.Document.getElementById(this.Id+"BottomSide");
this.InitializeEvents();
}
TableBorderControl.prototype.InitializeEvents = function ()
{
var obj = this;
var imagePath = this.ThemePath + "/Images/Dialogs/";
var col = this._FrmBorder;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "FrmBorderIcon.gif");
col.onclick = function(){obj.SetFrame('border');return false;};
}
col = this._AllRowsAndColumns;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "RuleAllIcon.gif");
col.onclick = function(){obj.SetRules('all');return false;};
}
col = this._NoBorders;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "FrmVoidIcon.gif");
col.onclick = function(){obj.SetFrame('void');return false;};
}
col = this._InteriorBorders;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "RuleNoneIcon.gif");
col.onclick = function(){obj.SetRules('none');return false;};
}
col = this._FrmLeft;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "FrmLeftIcon.gif");
col.onclick = function(){obj.SetFrame('lhs');return false;};
}
col = this._RuleCols;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "RuleColsIcon.gif");
col.onclick = function(){obj.SetRules('cols');return false;};
}
col = this._FrmRight;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "FrmRightIcon.gif");
col.onclick = function(){obj.SetFrame('rhs');return false;};
}
col = this._FrmLeftRight;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "FrmVsidesIcon.gif");
col.onclick = function(){obj.SetFrame('vsides');return false;};
}
col = this._TopAndBottomSide;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "FrmHsidesIcon.gif");
col.onclick = function(){obj.SetFrame('hsides');return false;};
}
col = this._TopSide;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "FrmAboveIcon.gif");
col.onclick = function(){obj.SetFrame('above');return false;};
}
col = this._BetweenRows;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "RuleRowsIcon.gif");
col.onclick = function(){obj.SetRules('rows');return false;};
}
col = this._BottomSide;
if(col)
{
this.SetDesignButtonEvent(col, imagePath + "FrmBelowIcon.gif");
col.onclick = function(){obj.SetFrame('below');return false;};
}
}
TableBorderControl.prototype.SetDesignButtonEvent = function (col, src)
{
var obj = this;
col.onmouseover = function(){obj.OnButtonOver(this);};
col.onmouseout = function(){obj.OnButtonOut(this);};
if(src && col.childNodes.length>0){var img = col.childNodes[0];img.src = src;img.align="absMiddle";img.border="0";};
}
TableBorderControl.prototype.IsEnabled= function (elem)
{
if (elem.className != "Disabled")
{
return true;
}
else
{
return false;
}
} ;
TableBorderControl.prototype.OnButtonOver= function (elem)
{
if (this.IsEnabled(elem))
{
elem.className="Over";
}
} ;
TableBorderControl.prototype.OnButtonOut= function (elem)
{
if (this.IsEnabled(elem))
{
elem.className="";
}
} ;
TableBorderControl.prototype.Initialize= function (tableToModify)
{
this.TableToModify=tableToModify;
if (this.TableToModify)
{
var size=parseInt(this.TableToModify.border);
if (isNaN(size))
{
this.PreViewTable.removeAttribute("border");
this.PreViewTable.className="TableBorderControlPreviewNoBorder";
}
else
{
this.PreViewTable.border=size;
}
}
else {}
this.PreViewTable.rules=this.TableToModify?this.TableToModify.rules: "all";
this.PreViewTable.frame=this.TableToModify?this.TableToModify.frame: "border";
this.PreViewTable.borderColor=this.TableToModify?this.TableToModify.borderColor: "";
this.SpinBox.Initialize(this.PreViewTable.border,022,4);
var obj=this ;
this.SpinBox.TextBoxChangeOnClientClick = function I3d()
{
obj.SpinBoxOnClick(this.GetCurrValue());
};
this.BorderColorPicker.OnClientClick= function I3d()
{
obj.BorderColorPickerClick(this.ColorPickerSelectColor);
};
this.Ial=null;
this.BorderColorPicker.SelectColor(this.PreViewTable.borderColor);
} ;
TableBorderControl.prototype.oam= function ()
{
if (null != this.TableToModify&&null != this.PreViewTable)
{
var frame=this.CheckPreViewTableIsFrame();
if (frame)
{
this.TableToModify.frame=frame;
}
else
{
this.TableToModify.removeAttribute("frame");
}
var rules=this.CheckPreViewTableIsRules();
if (rules)
{
this.TableToModify.rules=rules;
}
else
{
this.TableToModify.removeAttribute("rules");
}
if (this.PreViewTable.border != "")
{
this.TableToModify.border=this.PreViewTable.border;
}
else
{
this.TableToModify.removeAttribute("border");
}
this.TableToModify.borderColor=this.PreViewTable.borderColor;
}
} ;
TableBorderControl.prototype.CheckPreViewTableIsFrame= function ()
{
if (null != this.PreViewTable&&"border" != this.PreViewTable.frame&&"box" != this.PreViewTable.frame)
{
return this.PreViewTable.frame;
}
else {return ""; }
} ;
TableBorderControl.prototype.CheckPreViewTableIsRules= function ()
{
if (null != this.PreViewTable&&"all" != this.PreViewTable.rules)
{
return this.PreViewTable.rules;
}
else {return ""; }
} ;
TableBorderControl.prototype.iam= function ()
{
if (null != this.PreViewTable)
{
return this.PreViewTable.border;
}
else {return 0; }
} ;
TableBorderControl.prototype.Iam= function ()
{
if (null != this.PreViewTable)
{
return this.PreViewTable.borderColor;
}
else {return ""; }
} ;
TableBorderControl.prototype.SetFrame= function (frame)
{
if (null != this.PreViewTable)
{
if ("void" != frame&&"" != frame&&0 == parseInt(this.PreViewTable.border))
{
this.SpinBox.SetSize(1);
}
this.PreViewTable.frame=frame;
}
} ;
TableBorderControl.prototype.SetRules= function (rule)
{
if (null != this.PreViewTable)
{
if ("none" != rule&&"" != rule&&0 == parseInt(this.PreViewTable.border))
{
this.SpinBox.SetSize(1);
}
this.PreViewTable.rules=rule;
}
} ;
TableBorderControl.prototype.SpinBoxOnClick= function (size)
{
if (null != this.PreViewTable)
{
if (size<0)
{
this.PreViewTable.removeAttribute("border");
}
else
{
if (size>01750)
{
alert(LR["BORDER_SIZE_OVERFLOW"]);
size=01750;
}
this.PreViewTable.border=size;
}
this.PreViewTable.className=(this.PreViewTable.border>0)?"TableBorderControlPreview": "TableBorderControlPreviewNoBorder";
}
} ;
TableBorderControl.prototype.BorderColorPickerClick= function (color)
{
if (null != this.PreViewTable)
{
if ("" != color&&0 == parseInt(this.PreViewTable.border))
{
this.SpinBox.SetSize(1);
}
this.PreViewTable.borderColor=color;
}
} ;
function TableDesignControl(id, doc, themePath)
{
this.Id = id;
this.Document = doc;
this._TableDesignControl_delCol = this.Document.getElementById(this.Id+"TableDesignControl_delCol");
this._TableDesignControl_addCol = this.Document.getElementById(this.Id+"TableDesignControl_addCol");
this._TableDesignControl_delColSpan = this.Document.getElementById(this.Id+"TableDesignControl_delColSpan");
this._TableDesignControl_addColSpan = this.Document.getElementById(this.Id+"TableDesignControl_addColSpan");
this._TableDesignControl_delRow = this.Document.getElementById(this.Id+"TableDesignControl_delRow");
this._TableDesignControl_addRow = this.Document.getElementById(this.Id+"TableDesignControl_addRow");
this._TableDesignControl_delRowSpan = this.Document.getElementById(this.Id+"TableDesignControl_delRowSpan");
this._TableDesignControl_addRowSpan = this.Document.getElementById(this.Id+"TableDesignControl_addRowSpan");
this.SelectCell=null;
this.RowSpa
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -