⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webhtmleditordialog.txt.exclude

📁 毕业设计的源码
💻 EXCLUDE
📖 第 1 页 / 共 5 页
字号:
TableWizard.prototype.SetCellProperties= function ()
{
	if (this.CellPropertiesSelectCell)
	{
		if (!this.CellPropertiesControl.Update())
		{
			return false; 
		} 
		this.PreviewViewTable_SelectCell=null; 
		this.SelectCellIndex=-1; 
	}
	return true; 
} ; 
TableWizard.prototype.InitTableProperties= function ()
{ 
	this.SetCellProperties(); 
	this.TablePropertiesControl.Initialize(this.TableToModify,this.Editor,this.ColorsArray); 
} ; 
TableWizard.prototype.SetSelectCellIs0= function ()
{
	if (this.TableToModify.rows.length>0)
	{
		if (this.TableToModify.rows[0].cells.length>0)
		{ 
			this.PreviewViewTable_SelectCell=this.TableToModify.rows[0].cells[0]; 
		}
	}
} ; 
TableWizard.prototype.InitDesigner= function ()
{ 
	this.SetCellProperties(); 
	this.SetSelectCellIs0(); 
	this.TableDesignControl.Initialize(this.TableToModify,this.PreviewViewTable_SelectCell, this.ThemePath); 
} ; 
TableWizard.prototype.InsertTable= function ()
{
	if (!this.SetCellProperties()){return; } 
	if (!this.TablePropertiesControl.UpdateTable()){return; }
	CloseDlg(this.TableToModify); 
} ;

function SpinBox(doc, id, themePath)
{ 
	this.Document = doc;
	this.ThemePath = themePath;
	this.Id=id; 
	this.TextBox = this.Document.getElementById(this.Id+"TextBox"); 
	this.IncBorderButton = this.Document.getElementById(this.Id+"IncBorderSize"); 
	this.DecBorderButton = this.Document.getElementById(this.Id+"DecBorderSize"); 
	this.CurrTextBoxValue=""; 
	this.TextBoxChangeOnClientClick=null; 
	this.iad= false; 
	this.InitializeEvent();
}  
SpinBox.prototype.InitializeEvent = function ()
{ 
	var obj = this;
	var col = this.TextBox;
	if(col)
	{
		col.onkeydown = function(){obj.OnTextBoxKeyDown(event!=null?event:e);};
		col.onkeyup = function(){obj.OnTextBoxKeyUp();};
	} 
	col = this.IncBorderButton;
	if(col)
	{
		col.onmouseover = function(){obj.ButtonOver(this);};
		col.onmouseout = function(){obj.ButtonOut(this);};
		col.onclick = function(){obj.ModifyBorderSize(true);};
		col.src = this.ThemePath + "/Images/Dialogs/plus2.gif";
	} 
	col = this.DecBorderButton;
	if(col)
	{
		col.onmouseover = function(){obj.ButtonOver(this);};
		col.onmouseout = function(){obj.ButtonOut(this);};
		col.onclick = function(){obj.ModifyBorderSize(false);};
		col.src = this.ThemePath + "/Images/Dialogs/minus2.gif";
	}
} ;
SpinBox.prototype.Initialize= function (size, width,Iad)
{ 
	this.CurrTextBoxValue=size; 
	this.TextBox.value=size; 
	if (width)
	{ 
		this.TextBox.style.width=width; 
		this.TextBox.width=width; 
	}
	if (Iad)
	{
		this.TextBox.oae=Iad; 
	}
} ; 
SpinBox.prototype.GetCurrValue= function ()
{
	return this.CurrTextBoxValue; 
} ;
SpinBox.prototype.SetSize= function (size)
{ 
	this.CurrTextBoxValue=size; 
	this.TextBox.value=size;
	this.CheckTextBoxChangeOnClientClick(); 
};
SpinBox.prototype.OnTextBoxKeyDown= function (ev)
{
	if (!ev)var ev=e; 
	ev.returnValue=this.CheckInputValue(ev);
} ;
SpinBox.prototype.OnTextBoxKeyUp= function (ev)
{
	if (!ev)var ev=e; 
	if (this.CheckInputValue(ev, true))
	{ 
		this.CurrTextBoxValue=this.GetTextBoxValue();
		this.CheckTextBoxChangeOnClientClick(); 
	}
	else
	{
		this.TextBox.value=this.CurrTextBoxValue; 
	}
} ; 
SpinBox.prototype.CheckInputValue= function (e, flag)
{
	try 
	{
		if (!flag)flag= false; 
		if (!e)e=window.event; 
		var inputCode=((060<=e.keyCode&&e.keyCode<=071)||(0140<=e.keyCode&&e.keyCode<=0151)||(015 == e.keyCode)||(8 == e.keyCode)||(056 == e.keyCode)); 
		if (!flag)
		{
		    inputCode |= ((043<=e.keyCode&&e.keyCode<=050)); 
		}
		return inputCode; 
	}
	catch (ex){return true; }
} ; 
SpinBox.prototype.GetTextBoxValue= function ()
{
	var size=-1; 
	if (null != this.TextBox)
	{
		size=parseInt(this.TextBox.value); 
		if (isNaN(size))
		{
		    size=-1; 
		}
	}
	return size; 
} ; 
SpinBox.prototype.CheckTextBoxChangeOnClientClick= function ()
{
	if (this.TextBoxChangeOnClientClick)
	{ 
		this.TextBoxChangeOnClientClick(); 
	}
};
SpinBox.prototype.ModifyBorderSize= function (Oaf)
{
	var size=this.CurrTextBoxValue; 
	var currValue=this.GetTextBoxValue(); 
	if (-1 != currValue&&size != currValue)
	{
		size=currValue; 
	}
	if (Oaf&&size<01750)
	{
	    size++; 
	}
	else if (!Oaf&&size>0)
	{
	    size--; 
	}
	this.CurrTextBoxValue=size; 
	this.TextBox.value=size;
	this.CheckTextBoxChangeOnClientClick(); 
} ; 
SpinBox.prototype.ButtonOver= function (elem)
{
	if (this.IsEnabled(elem))
	{
		elem.className="Over"; 
	}
} ; 
SpinBox.prototype.ButtonOut= function (elem)
{
	if (this.IsEnabled(elem))
	{
		elem.className=""; 
	}
} ; 
SpinBox.prototype.IsEnabled= function (elem)
{
	return (elem.className != "Disabled");
} ;

function AlignmentSelector(doc, id, imagePath, alignMode, dropDownMenu)
{ 
	this.Document = doc;
	this.IsIE=this.Document.all? true : false; 
	this.Id=id; 
	this.AlignmentCellLength = 3;
	this.ImagePath=imagePath; 
	this.AlignmentForHtmlElement=""; 
	this.AlignmentTableArray=null; 
	this.SelectAlignmentTableArrayItem=null; 
	this.SelectIndex=-1;
	this.MenuButtonImage=this.Document.getElementById(this.Id + "Menu_Button_Img");   
	this.MenuButton = this.Document.getElementById(this.Id + "Menu_Button"); 
	this.DropDownMenu=dropDownMenu; 
	this.DropDownMenu.AlignmentControl=this ; 
	this.SetMode(alignMode); 
	this.Initialize();
}  
AlignmentSelector.prototype.Initialize= function ()
{
	var obj = this;
	if(this.MenuButton)
	{
		this.MenuButton.onmouseover = function(){this.className="AlignmentMainButtonOver";}; 
		this.MenuButton.onmouseout = function(){this.className="AlignmentMainButton";};	
		this.MenuButton.onclick = function(){obj.Toggle();return false;};
		this.MenuButton.onfocus = function(){this.blur();};
	}
	this.CreateDropDownMenuInnerHTML();
}
AlignmentSelector.prototype.CreateDropDownMenuInnerHTML = function ()
{
	var table = this.Document.getElementById(this.Id + "Menu_Element_Table"); 
	if (!table)return; 
	var alignmentTableRowLength=table.rows.length; 
	for (var i=0; i<alignmentTableRowLength; i++)
	{
		table.deleteRow(0); 
	}	
	var alignmentTableRow=null; 
	var cellIndex=0; 
	var obj = this;
	for (var i=0; i<this.AlignmentTableArray.length; i++)
	{
		if (0 == i%this.AlignmentCellLength)
		{
			alignmentTableRow=table.insertRow(table.rows.length); 
			cellIndex=0; 
		}
		cellIndex++;
		var cell= alignmentTableRow.insertCell(alignmentTableRow.cells.length); 
		var button = this.Document.createElement("BUTTON");
		button.setAttribute("type","button"); 
		button.Index = i;
		button.onmouseover = function(){this.className = "Over";};
		button.onmouseout = function(){this.className = "";} 
		button.onclick = function(){obj.SelectAlignmentByIndex(this.Index)}
		var img = this.Document.createElement("IMG");
		img.align = "absMiddle";
		img.src = this.ImagePath + AlignmentSelectorImagesArray[i];
		button.appendChild(img);
		cell.appendChild(button);
	} 
} ; 
AlignmentSelector.prototype.SetMode= function (state)
{ 
	this.AlignmentForHtmlElement=state; 
	this.AlignmentTableArray=this.GetAlignmentTableArray(this.AlignmentForHtmlElement); 
	this.SelectAlignmentByIndex(this.SelectIndex);
} ;	 
AlignmentSelector.prototype.SelectAlignmentByIndex= function (index)
{						 
	if (index == this.SelectIndex)
	{ 
		this.SelectAlignmentTableArrayItem=""; 
		this.SetMenuButtonImagePath("x.gif");
	}
	else 
	{
		if (this.AlignmentTableArray&&0<=index&&index<this.AlignmentTableArray.length)
		{ 
			this.SelectAlignmentTableArrayItem=this.AlignmentTableArray[index]; 
			this.SetMenuButtonImagePath(AlignmentSelectorImagesArray[index]); 			
		}
	}
} ; 
var AlignmentSelectorForImageElementImagesArray=
[
	["",""],["none",""],["",""],
	["",""],["top",""],["",""],
	["left",""],["absmiddle",""],["right",""],
	["",""],["bottom",""],["",""],
	["",""],["",""],["",""]
]; 
var AlignmentSelectorForTDElementImagesArray=
[
	["",""],["none",""],["",""],
	["left","top"],["center","top"],["right","top"],
	["left","middle"],["center","middle"],["right","middle"],
	["left","bottom"],["center","bottom"],["right","bottom"],
	["",""],["",""],["",""]
]; 
var AlignmentSelectorForTableElementImagesArray=
[
	["",""],["none",""],["",""],
	["left",""],["center",""],["right",""],
	["",""],["",""],["",""],
	["",""],["",""],["",""],
	["",""],["",""],["",""]
]; 
var AlignmentSelectorForCaptionImagesArrayIE=
[
	["",""],["none",""],["",""],
	["left","top"],["center","top"],["right","top"],
	["",""],["",""],["",""],
	["left","bottom"],["center","bottom"],["right","bottom"],
	["",""],["",""],["",""]
]; 
var AlignmentSelectorForCaptionImagesArrayM=
[
	["",""],["none",""],["",""],
	["",""],["","top"],["",""],
	["",""],["",""],["",""],
	["",""],["","bottom"],["",""],
	["",""],["",""],["",""]
]; 
var AlignmentSelectorImagesArray=
[
	"x.gif","x.gif","x.gif",
	"AlignTopLeft.gif","AlignTopCenter.gif","AlignTopRight.gif",
	"AlignMiddleLeft.gif","AlignMiddleCenter.gif","AlignMiddleRight.gif",
	"AlignBottomLeft.gif","AlignBottomCenter.gif","AlignBottomRight.gif",
	"x.gif","x.gif","x.gif"
]; 
AlignmentSelector.prototype.GetAlignmentTableArray= function (state)
{
	switch (state.toUpperCase())
	{
		case "IMG":
			return AlignmentSelectorForImageElementImagesArray; 
		case "TABLE":
			return AlignmentSelectorForTableElementImagesArray; 
		case "TD":
			return AlignmentSelectorForTDElementImagesArray; 
		case "CAPTION":
			return (this.IsIE?AlignmentSelectorForCaptionImagesArrayIE:AlignmentSelectorForCaptionImagesArrayM); 
		default:
			return null; 
	}
} ; 
AlignmentSelector.prototype.SetAlignmentVisible= function (visible)
{ 
	this.SetVisible(this.AlignmentForHtmlElement,visible);
} ; 
AlignmentSelector.prototype.SetVisible= function (state,visible)
{
	var table=this.Document.getElementById(this.Id + "Menu_Element_Table"); 
	var count=0; 
	for (var i=0; i<table.rows.length; i++)
	{
		var flag= false; 
		for (var j=0; j<table.rows[i].cells.length; j++)
		{
			var cell=table.rows[i].cells[j]; 
			var flag2=visible&&this.CheckArrayItem(count++); 
			cell.style.visibility=flag2?"visible": "hidden"; 
			flag |= flag2;
		}
		if (null != this.Document.all)
		{
			table.rows[i].style.display=flag?"": "none";
		}
	}
} ; 
AlignmentSelector.prototype.CheckArrayItem= function (index)
{
	var flag= false; 
	if (this.AlignmentTableArray)
	{
		var item=this.AlignmentTableArray[index]; 
		flag=((null != item)&&("" != item[0]||"" != item[1])); 
	}
	return flag; 
} ; 
AlignmentSelector.prototype.O7i= function ()
{
	var index=-1; 
	if (this.AlignmentTableArray)
	{
		for (var i=0; i<this.AlignmentTableArray.length; i++)
		{
			if (this.CheckArrayItem(i))
			{
				index=i; 
				break; 
			}
		}
	}
	return index;
} ; 
AlignmentSelector.prototype.SetMenuButtonImagePath= function (fileName)
{ 
	this.MenuButtonImage.src=this.ImagePath+fileName; 
	if ("x.gif" == fileName)
	{ 
		this.MenuButtonImage.style.marginLeft="0px";
	}
	else 
	{ 
		this.MenuButtonImage.style.marginLeft="-2px";
	}	  
} ; 
AlignmentSelector.prototype.SetValue= function (align,vAlign)
{
	if ("" == align)
	{
		align="none"; 
	}
	if (!vAlign){vAlign=""; }
	if (this.AlignmentTableArray)
	{
		align=align.toUpperCase(); 
		vAlign=vAlign.toUpperCase(); 
		var index=-1; 
		for (var i=0; i<this.AlignmentTableArray.length; i++)
		{
			if (this.CheckArrayItem(i))
			{
				var item0=this.AlignmentTableArray[i][0].toUpperCase(); 
				var item1=this.AlignmentTableArray[i][1].toUpperCase(); 
				if (-1 == index)
				{
					index=i; 
				}
				if ((align == item0||align == item1)&&(vAlign == item0||vAlign == item1))
				{
					this.SelectAlignmentByIndex(i); 
					return;
				}
			}
		}
		this.SelectAlignmentByIndex(index);
	}
} ; 
AlignmentSelector.prototype.GetSelectItemAlign= function ()
{
	var value=(this.SelectAlignmentTableArrayItem?this.SelectAlignmentTableArrayItem[0]: ""); 
	if ("none" == value)
	{
		value=""; 
	}
	return value; 
} ; 
AlignmentSelector.prototype.GetSelectItemValign= function ()
{
	var value=(this.SelectAlignmentTableArrayItem?this.SelectAlignmentTableArrayItem[1]: "");
	if ("none" == value)
	{
		value=""; 
	}
	return value;
} ; 
AlignmentSelector.prototype.Toggle= function ()
{
	if (null != this.DropDownMenu)
	{ 
		this.DropDownMenu.Toggle(); 
		if (window.event)
		{
			window.event.cancelBubble= true; 
		}
	}
} ; 
AlignmentSelector.prototype.SetDisabled= function (flag)
{
	if (null != this.DropDownMenu)
	{ 
		this.DropDownMenu.SetDisabled(flag); 
	}
} ;

 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -