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

📄 webhtmleditordialog.txt.exclude

📁 毕业设计的源码
💻 EXCLUDE
📖 第 1 页 / 共 5 页
字号:
	}
	else 
	{ 
		this.TableToModify.removeAttribute("cellPadding", false); 
	}
	var bgColor=this.TableBgColorPicker.ColorPickerSelectColor; 
	if (bgColor)
	{ 
		this.TableToModify.bgColor=this.TableBgColorPicker.ColorPickerSelectColor; 
	}
	else 
	{ 
		this.TableToModify.removeAttribute("bgColor", false); 
	} 
	this.TableBorderControl.oam(); 
	
	if (this.TableBgImageDialogCaller&&this.TableToModify)
	{
		var imagePath=this.TableBgImageDialogCaller.GetValue(); 
		if (imagePath == "")
		{ 
			this.TableToModify.removeAttribute("background", false); 
		}
		else 
		{ 
			this.TableToModify.setAttribute("background",imagePath); 
		}
	}
	return true;
} ; 
TablePropertiesControl.prototype.GetStartString= function (name)
{
	var nameArray=name.split("-"); 
	name=nameArray[0]; 
	for (var i=1; i<nameArray.length; i++)
	{
		name+=nameArray[i].substr(0,1).toUpperCase()+nameArray[i].substr(1); 
	}
	return name;
} ; 
TablePropertiesControl.prototype.ValidateUnit= function (value)
{
	if (!e)
	{
	    var e=window.event; 
	}
	var match=value.match(/(1|2|3|4|5|6|7|8|9)d*%?$/ig); 
	e.returnValue=match; 
	return match; 
} ;

function CellPropertiesControl(doc, Id, cellAlignmentSelector, cellBackgroundColorPicker, bgImageDialogCaller)
{ 
	this.Document = doc;
	this.Id = Id; 
	this.CellAlignmentSelector = cellAlignmentSelector; 
	this.CellBackgroundColorPicker = cellBackgroundColorPicker; 
	this.BgImageDialogCaller = bgImageDialogCaller;
	this.CellHeight = this.Document.getElementById(this.Id+"CellHeight"); 
	this.CellWidth = this.Document.getElementById(this.Id+"CellWidth");
	this.CellWidthValid=new NumValidControl(this.Document, this.CellWidth.id, "DIMENSION", LR["InvalidCellWidth"]); 
	this.CellHeightValid=new NumValidControl(this.Document, this.CellHeight.id, "DIMENSION", LR["InvalidCellHeight"]); 
	this.CellWrap = this.Document.getElementById(this.Id+"CellWrap"); 
	this.CellId = this.Document.getElementById(this.Id+"CellId");  
	this.CellWrap = this.Document.getElementById(this.Id+"CellWrap");  
	this.Editor=null; 
	this.IsInitialize= false; 
}						  
CellPropertiesControl.prototype.Initialize= function (selectCell, editor,ColorsArray)
{
	if (!this.IsInitialize)
	{ 
		this.Editor=editor; 
		this.BgImageDialogCaller.Initialize(this.Editor); 
		if (ColorsArray)
		{
		    this.CellBackgroundColorPicker.SetColorsArray(ColorsArray); 
		}
		this.IsInitialize= true; 
	} 
	this.SetCellProperty(selectCell); 
} ; 
CellPropertiesControl.prototype.SetCellProperty= function (cellToModify)
{ 
	this.SelectCell=cellToModify; 
	if (this.SelectCell.style.width == "")
	{ 
		this.CellWidth.value=this.SelectCell.width; 
	}
	else 
	{ 
		this.CellWidth.value=this.SelectCell.style.width; 
	}
	if (this.SelectCell.style.height == "")
	{ 
		this.CellHeight.value=this.SelectCell.height; 
	}
	else 
	{ 
		this.CellHeight.value=this.SelectCell.style.height; 
	} 
	this.CellId.value=this.SelectCell.getAttribute("id"); 
	this.CellAlignmentSelector.SetValue(this.SelectCell.align,this.SelectCell.vAlign);
	this.CellWrap.checked=this.SelectCell.noWrap;
	this.CellBackgroundColorPicker.SelectColor(this.SelectCell.bgColor); 
	if (this.BgImageDialogCaller&&this.SelectCell)
	{
		var imagePath=this.SelectCell.getAttribute("background"); 
		if (!imagePath)
		{
		    imagePath=""; 
		}
		this.BgImageDialogCaller.SetCallBackValue(imagePath); 
	}
} ;
CellPropertiesControl.prototype.Update= function ()
{
	if (!this.CellWidthValid.Valid())
	{
		return false; 
	}
	var widthValue=this.CellWidthValid.RexBlank(); 
	if (widthValue == "")
	{ 
		this.SelectCell.removeAttribute("width", false); 
		if (this.SelectCell.style.removeAttribute)
		{ 
			this.SelectCell.style.removeAttribute("width", false); 
		}
		else 
		{ 
			this.SelectCell.style.width=null; 
		}
	}
	else 
	{
		if (this.SelectCell.style.width == ""&&widthValue != 0)
		{ 
			this.SelectCell.width=widthValue; 
		}
		else 
		{ 
			this.SelectCell.removeAttribute("width", false); 
			this.SelectCell.style.width=widthValue; 
		}
	}
	if (!this.CellHeightValid.Valid())
	{
		return false; 
	}
	var heightValue=this.CellHeightValid.RexBlank(); 
	if (heightValue == "")
	{ 
		this.SelectCell.removeAttribute("height", false); 
		if (this.SelectCell.style.removeAttribute)
		{ 
			this.SelectCell.style.removeAttribute("height", false); 
		}
		else
		{ 
			this.SelectCell.style.height=null; 
		}
	}
	else 
	{
		if (this.SelectCell.style.height == ""&&heightValue != 0)
		{ 
			this.SelectCell.height=heightValue; 
		}
		else 
		{ 
			this.SelectCell.removeAttribute("height", false); 
			this.SelectCell.style.height=heightValue;
		}
	}
	if (this.CellId.value)
	{ 
		this.SelectCell.setAttribute("id",this.CellId.value); 
	}
	else 
	{
		this.SelectCell.removeAttribute("id", false);
	}
	var align=this.CellAlignmentSelector.GetSelectItemAlign(); 
	if (align)
	{ 
		this.SelectCell.align=align; 
	}
	else 
	{ 
		this.SelectCell.removeAttribute("align", false); 
	}
	var vAlign=this.CellAlignmentSelector.GetSelectItemValign(); 
	if (vAlign)
	{ 
		this.SelectCell.vAlign=vAlign; 
	}
	else 
	{ 
		this.SelectCell.removeAttribute("vAlign", false); 
	} 
	this.SelectCell.noWrap=this.CellWrap.checked;
	var bgColor=this.CellBackgroundColorPicker.ColorPickerSelectColor;    
	if (bgColor)
	{ 
		this.SelectCell.bgColor=bgColor;
	}
	else 
	{ 
		this.SelectCell.removeAttribute("bgColor", false);
	}  	
	if (this.BgImageDialogCaller&&this.SelectCell)
	{
		var imagePath=this.BgImageDialogCaller.GetValue(); 
		if (imagePath == "")
		{ 
			this.SelectCell.removeAttribute("background", false); 
		}
		else 
		{ 
			this.SelectCell.setAttribute("background",imagePath);
		}
	}
	return true; 
} ; 
CellPropertiesControl.prototype.GetStartString= function (name)
{
	var nameArray=name.split("-"); 
	name=nameArray[0]; 
	for (var i=1; i<nameArray.length; i++)
	{
		name+=nameArray[i].substr(0,1).toUpperCase()+nameArray[i].substr(1);
	}
	return name; 
} ;


function ImageDialogCaller(doc, id, themePath, command, currentCulture)
{ 
	this.Document = doc;
	this.Id = id; 
	this.ThemePath = themePath;
	this.ImageCommand = command;
	this.ResultTextBox = this.Document.getElementById(this.Id+"ResultTextBox"); 
	this.DialogOpenerButton = this.Document.getElementById(this.Id+"DialogOpenerButton"); 
	this.Editor = null; 
	this.InitializeEvent();
	this.CurrentCulture = currentCulture;
}  
ImageDialogCaller.prototype.InitializeEvent= function ()
{ 
	var obj = this;
	if(this.DialogOpenerButton)
	{
		this.DialogOpenerButton.onclick = function(){return obj.CallImageDialog();};
		this.onfocus = function(){this.blur();};
	}
} ; 
ImageDialogCaller.prototype.Initialize= function (editor, resultTextBoxSize)
{ 
	this.Editor = editor; 
	if (resultTextBoxSize)
	{ 
		this.ResultTextBox.size=resultTextBoxSize; 
	}
} ; 
ImageDialogCaller.prototype.SetCallBackValue= function (imagePath)
{ 
	if(!imagePath || imagePath=="undefined")
	{
	    imagePath = "";
	}
	this.ResultTextBox.value=this.Editor.FiltersManager.GetHtmlContent(imagePath); 
} ; 
ImageDialogCaller.prototype.GetValue = function ()
{
	return this.ResultTextBox.value;
} ; 
ImageDialogCaller.prototype.CallImageDialog= function ()
{
	var ParamObject= new Object();
	ParamObject.ImageCaller = this;	
	var arg = GetDialogArguments();
	var Argument = new Object();
	Argument.Command = arg.Command;
	Argument.Editor = arg.Editor;
	this.Editor.ShowDialog((this.ThemePath + "IHttpHandler.ashx?Command=" + this.ImageCommand + "&CurrentCulture=" + this.CurrentCulture),Argument,10,10,this.CallBackFunction,ParamObject);  
	return false; 
} ;

ImageDialogCaller.prototype.CallBackFunction= function (returnValue, paramObject)
{
    if (!returnValue|| (returnValue.tagName && returnValue.tagName.toUpperCase() != "IMG") || returnValue.src=="")
		{
		    return;
		}
		paramObject.ImageCaller.SetCallBackValue(returnValue.src);
		window.focus();
}


function ColorPicker(id, doc, imagePath, dropDownMenuControl, colorsArray)
{ 
	this.Document = doc;
	this.IsIE=this.Document.all? true : false; 
	this.Id = id; 
	this.ImagePath = imagePath; 
	this.DropDownMenu = dropDownMenuControl;
	this.MenuButton = this.Document.getElementById(this.Id + "Menu_Button"); 
	this.MenuButtonSpan = this.Document.getElementById(this.Id + "Menu_Button_Span"); 
	this.ColorsArray=colorsArray; 
	this.ColorTableCellLength=6;
	this.ShowAddCustomColor= true; 
	this.ShowAddHexColor= true; 
	if (null != this.DropDownMenu)
	{ 
		this.CreateDropDownMenuInnerHTML(); 
	} 
	this.ColorPickerSelectColor=""; 
	this.SelectColor(""); 
	this.OnClientClick=null;
	this.Initialize();
}
ColorPicker.prototype.Initialize= function ()
{
	var obj = this;
	if(this.MenuButton)
	{
		this.MenuButton.onmouseover = function(){this.className="ColorPickerMainButtonOver";}; 
		this.MenuButton.onmouseout = function(){this.className="ColorPickerMainButton";};	
		this.MenuButton.onclick = function(){obj.Toggle();return false;};
		this.MenuButton.onfocus = function(){this.blur();};
	}
}
ColorPicker.prototype.SetColorsArray= function (colorsArray)
{ 
	this.ColorsArray = colorsArray; 
	this.CreateDropDownMenuInnerHTML(); 
};
ColorPicker.prototype.SetDisabled= function (flag)
{
	if (null != this.DropDownMenu)
	{ 
		this.DropDownMenu.SetDisabled(flag); 
	}
} ; 
ColorPicker.prototype.Toggle= function ()
{
	if (null != this.DropDownMenu)
	{ 
		this.DropDownMenu.Toggle(); 
	}
} ; 
ColorPicker.prototype.SelectColor = function (color,hide)
{ 
	this.ColorPickerSelectColor=color; 
	if (null == hide)hide= true; 
	if (hide&&null != this.DropDownMenu&&this.DropDownMenu.IsVisible())
	{ 
		this.DropDownMenu.SetVisible( false); 
	} 
	this.SetSpanStyle(); 
} ; 
ColorPicker.prototype.SetSpanStyle= function ()
{
	if (null != this.DropDownMenu&&null != this.MenuButtonSpan)
	{
		if ("" == this.ColorPickerSelectColor)
		{		  
			this.MenuButtonSpan.style.background=this.ColorPickerSelectColor; 
			this.MenuButtonSpan.style.backgroundImage="url("+this.ImagePath+"x.gif)"; 
			this.MenuButtonSpan.style.backgroundPosition="center"; 
			this.MenuButtonSpan.style.backgroundRepeat="no-repeat";
		}
		else 
		{ 
			this.MenuButtonSpan.style.backgroundImage=""; 
			this.MenuButtonSpan.style.background=this.ColorPickerSelectColor; 
		}
		if (this.OnClientClick)
		{ 
			this.OnClientClick(); 
		}
	}
} ;
ColorPicker.prototype.CreateDropDownMenuInnerHTML = function ()
{
	var table = this.Document.getElementById(this.Id + "Color_Table"); 
	if (!table)return; 
	var colorTableRowLength=table.rows.length; 
	for (var i=0; i<colorTableRowLength; i++)
	{
		table.deleteRow(0); 
	}
	var colorTableRow=null; 
	var cellIndex=0; 		
	for (var i=0; i<this.ColorsArray.length; i++)
	{
		if (0 == i%this.ColorTableCellLength)
		{
			colorTableRow=table.insertRow(table.rows.length); 
			cellIndex=0; 
		}
		cellIndex++; 
		var bgColor=this.ColorsArray[i]; 
		this.CreateColorPickerTableCell(colorTableRow,bgColor); 
	}  
	var residualCellIndex=this.ColorTableCellLength-cellIndex-1; 
	if (residualCellIndex>0)
	{
		for (var i=0; i<=residualCellIndex; i++)
		{
			var cell=colorTableRow.insertCell(colorTableRow.cells.length); 
			cell.innerHTML="&nbsp;&nbsp;"; 
		}
	}		 
	if (this.ShowAddCustomColor)
	{
		if (this.IsIE)
		{
			this.CreateAddCustomColorCell_I(table); 
		}
		else
		{
			this.CreateAddCustomColorCell(table, LR["AddCustomColor"]); 
		}
	}
	if (this.IsIE&&this.ShowAddHexColor)
	{ 
		this.CreateAddCustomColorCell(table, LR["AddHexColor"]); 
	}
	if (this.IsIE)
	{
	    this.DropDownMenu.SetDropDownMenuContent(table); 
	}

} ; 
ColorPicker.prototype.CreateAddCustomColorCell_I = function (table)
{
	var html="<span class='Label'>"+LR["AddCustomColor"]+"</span>"+"<object id='"+this.Id+"dlgHelper' CLASSID='clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b' width='0px' height='0px'></object>"; 
	var cell = this.CreateColorPickerCustomTableCell(table, html);
	var obj = this;
	cell.onclick = function(){obj.OnAddCustomColorIE();}; 
} ; 
ColorPicker.prototype.CreateAddCustomColorCell= function (table,label)
{ 
	var html="<span class='Label'>"+label+"</span>"; 
	var cell = this.CreateColorPickerCustomTableCell(table, html); 
	var obj = this;
	cell.onclick = function(){obj.OnAddHexColor();};
} ; 
ColorPicker.prototype.CreateColorPickerCustomTableCell= function (table, html)
{
	var row=table.insertRow(table.rows.length); 
	var cell=row.insertCell(row.cells.length); 
	cell.colSpan=this.ColorTableCellLength; 
	cell.noWrap= true; 	 
	cell.onmouseover = function(){this.className = "Over";};
	cell.onmouseout = function(){this.className = "";} 
	cell.innerHTML=html; 
	return cell;
} ; 
ColorPicker.prototype.OnAddCustomColorIE= function ()
{
	var obj = this.Document.getElementById(this.Id + "dlgHelper"); 
	if (!obj)return; 
	var color=obj.ChooseColorDlg(); 
	color=this.FormatColor(color); 
	this.AddCustomColorCell(color); 
} ; 
ColorPicker.prototype.CheckColor= function (color)
{
	if (null == color)return ""; 
	if (color.charAt(0) != "#")
	{
		color="#"+color; 
	}
	reg=new RegExp("#[0-9a-fA-F]{6}","gi"); 

⌨️ 快捷键说明

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