📄 ewebeditor.aspx
字号:
<%@ Page language="c#" Codebehind="eWebEditor.aspx.cs" AutoEventWireup="false" Inherits="eWebEditorNet.eWebEditor" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Web1</title>
<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<style> .yToolbar { }
TABLE.Toolbar { BORDER-RIGHT: <%=Toolbar_Border_Right%> 1px solid; }
TABLE.Toolbar TD { BACKGROUND-COLOR: <%=BG_Color%>; BORDER-BOTTOM: <%=Toolbar_Border_Bottom%> 1px solid; BORDER-RIGHT: <%=Toolbar_Border_Bottom%> 1px solid; BORDER-TOP: <%=Toolbar_Border_Right%> 1px solid; HEIGHT: 27px; LEFT: 0px; POSITION: relative; TOP: 0px; }
.Btn { BACKGROUND-COLOR: <%=BG_Color%>; BORDER-BOTTOM: <%=BG_Color%> 1px solid; BORDER-LEFT: <%=BG_Color%> 1px solid; BORDER-RIGHT: <%=BG_Color%> 1px solid; BORDER-TOP: <%=BG_Color%> 1px solid; HEIGHT: 21px; POSITION: absolute; TOP: 1px; WIDTH: 21px; }
.TBSep { BORDER-LEFT: <%=TBSep_Border_Left%> 1px solid; BORDER-RIGHT: <%=Toolbar_Border_Right%> 1px solid; FONT-SIZE: 0px; HEIGHT: 20px; POSITION: absolute; TOP: 1px; WIDTH:1px }
.TBGen { FONT: 8pt arial,sans-serif; HEIGHT: 20px; POSITION: absolute; TOP: 2px }
.TBHandle { BACKGROUND-COLOR: <%=BG_Color%>; BORDER-LEFT: <%=Toolbar_Border_Right%> 1px solid; BORDER-RIGHT: <%=Toolbar_Border_Bottom%> 1px solid; BORDER-TOP: <%=Toolbar_Border_Right%> 1px solid; FONT-SIZE: 1px; HEIGHT: 20px; POSITION: absolute; TOP: 1px; WIDTH: 3px }
.Ico { HEIGHT: 20px; LEFT: -1px; POSITION: absolute; TOP: -1px; WIDTH: 20px }
/* ylh add */ .Ico2 { HEIGHT: 20px; LEFT: -1px; POSITION: absolute; TOP: -1px; WIDTH: 80px }
.Btn2 { BACKGROUND-COLOR: <%=BG_Color%>; BORDER-BOTTOM: <%=BG_Color%> 1px solid; BORDER-LEFT: <%=BG_Color%> 1px solid; BORDER-RIGHT: <%=BG_Color%> 1px solid; BORDER-TOP: <%=BG_Color%> 1px solid; HEIGHT: 21px; POSITION: absolute; TOP: 1px; WIDTH: 81px; }
.BtnMouseOverUp2 { BACKGROUND-COLOR: <%=BtnMouseOverUp_BG_Color%>; BORDER-BOTTOM: <%=Btn_Border_Color%> 1px solid; BORDER-LEFT: <%=Btn_Border_Color%> 1px solid; BORDER-RIGHT: <%=Btn_Border_Color%> 1px solid; BORDER-TOP: <%=Btn_Border_Color%> 1px solid; HEIGHT: 21px; POSITION: absolute; TOP: 1px; WIDTH: 81px }
.BtnMouseOverDown2 { BACKGROUND-COLOR: <%=BtnMouseOverDown_BG_Color%> ; BORDER-BOTTOM: <%=Btn_Border_Color%> 1px solid; BORDER-LEFT: <%=Btn_Border_Color%> 1px solid; BORDER-RIGHT: <%=Btn_Border_Color%> 1px solid; BORDER-TOP: <%=Btn_Border_Color%> 1px solid; HEIGHT: 21px; POSITION: absolute; TOP: 1px; WIDTH: 81px }
.BtnDown2 { BACKGROUND-COLOR: <%=BtnDown_BG_Color%>; BORDER-BOTTOM: <%=Toolbar_Border_Right%> 1px solid; BORDER-LEFT: <%=Toolbar_Border_Bottom%> 1px solid; BORDER-RIGHT: <%=Toolbar_Border_Right%> 1px solid; BORDER-TOP: <%=Toolbar_Border_Bottom%> 1px solid; HEIGHT: 21px; POSITION: absolute; TOP: 1px; WIDTH: 81px }
.IcoDown2 { HEIGHT: 21px; LEFT: 0px; POSITION: absolute; TOP: 0px; WIDTH: 81px }
/* *********************************************************************************************************************************** */ .BtnMouseOverUp { BACKGROUND-COLOR: <%=BtnMouseOverUp_BG_Color%>; BORDER-BOTTOM: <%=Btn_Border_Color%> 1px solid; BORDER-LEFT: <%=Btn_Border_Color%> 1px solid; BORDER-RIGHT: <%=Btn_Border_Color%> 1px solid; BORDER-TOP: <%=Btn_Border_Color%> 1px solid; HEIGHT: 21px; POSITION: absolute; TOP: 1px; WIDTH: 21px }
.BtnMouseOverDown { BACKGROUND-COLOR: <%=BtnMouseOverDown_BG_Color%> ; BORDER-BOTTOM: <%=Btn_Border_Color%> 1px solid; BORDER-LEFT: <%=Btn_Border_Color%> 1px solid; BORDER-RIGHT: <%=Btn_Border_Color%> 1px solid; BORDER-TOP: <%=Btn_Border_Color%> 1px solid; HEIGHT: 21px; POSITION: absolute; TOP: 1px; WIDTH: 21px }
.BtnDown { BACKGROUND-COLOR: <%=BtnDown_BG_Color%>; BORDER-BOTTOM: <%=Toolbar_Border_Right%> 1px solid; BORDER-LEFT: <%=Toolbar_Border_Bottom%> 1px solid; BORDER-RIGHT: <%=Toolbar_Border_Right%> 1px solid; BORDER-TOP: <%=Toolbar_Border_Bottom%> 1px solid; HEIGHT: 21px; POSITION: absolute; TOP: 1px; WIDTH: 21px }
.IcoDown { HEIGHT: 21px; LEFT: 0px; POSITION: absolute; TOP: 0px; WIDTH: 21px }
.IcoDownPressed { LEFT: 1px; POSITION: absolute; TOP: 1px }
BODY { BACKGROUND-COLOR:#FFFFFF; MARGIN: 0px; PADDING: 0px; }
SELECT { BACKGROUND: <%=Select_BG_Color%>; FONT: 8pt verdana,arial,sans-serif }
TABLE { POSITION: relative }
.Composition { BACKGROUND-COLOR: #cccccc; POSITION: relative }
.ContextMenuDiv { border-top:buttonface 1px solid;border-left:buttonface 1px solid;border-bottom:windowframe 1px solid;border-right:windowframe 1px solid;}
.ContextMenuTable { border-top:window 1px solid;border-left:window 1px solid;border-bottom:buttonshadow 1px solid;border-right:buttonshadow 1px solid;}
.ContextMenuMouseOver {background-color:highlight;color:highlighttext;font-size: 12px;cursor:default;font-size: 12px;}
.ContextMenuMouseOut {background-color:buttonface;color:buttontext;font-size: 12px;cursor:default;font-size: 12px;}
.ContextMenuLeftBg {background-color:#0072BC}
TABLE.StatusBar { BORDER-RIGHT: <%=Toolbar_Border_Bottom%> 1px solid; BORDER-BOTTOM: <%=Toolbar_Border_Bottom%> 1px solid; BACKGROUND-COLOR: <%=BG_Color%>; }
TD.StatusBarBtnOff {padding:1px 5px;border:1px outset;cursor:pointer;}
TD.StatusBarBtnOn {padding:1px 5px;border:1px inset;background-color: #EEEEEE;}
</style>
<%=sScript%>
<script language="javascript">
/*
*☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
eWebEditor -在线文本编辑器
版权所有: http;//eqccd.com
程序制作: 广州全程--研发部
*☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
*/
// 当前模式
var sCurrMode = null;
var bEditMode = null;
// 连接对象
var oLinkField = null;
var sBaseUrl = document.location.protocol + '//' + document.location.host ;
// 浏览器版本检测
var BrowserInfo = new Object() ;
BrowserInfo.MajorVer = navigator.appVersion.match(/MSIE (.)/)[1] ;
BrowserInfo.MinorVer = navigator.appVersion.match(/MSIE .\.(.)/)[1] ;
BrowserInfo.IsIE55OrMore = BrowserInfo.MajorVer >= 6 || ( BrowserInfo.MajorVer >= 5 && BrowserInfo.MinorVer >= 5 ) ;
var yToolbars = new Array(); // 工具栏数组
// 当文档完全调入时,进行初始化
var bInitialized = false;
function document.onreadystatechange()
{
if (document.readyState!="complete") return;
if (bInitialized) return;
bInitialized = true;
var i, s, curr;
// 初始每个工具栏
for (i=0; i<document.body.all.length;i++){
curr=document.body.all[i];
if (curr.className == "yToolbar"){
InitTB(curr);
yToolbars[yToolbars.length] = curr;
}
}
oLinkField = parent.document.getElementsByName(sLinkFieldName)[0];
//oLinkField =document.getElementsByName(sLinkFieldName)[0];
if (ContentFlag.value=="0") {
ContentEdit.value = oLinkField.value;
ContentLoad.value = oLinkField.value;
ContentFlag.value = "1";
}
setMode(config.InitMode);
setLinkedField() ;
eWebEditor.document.body.onpaste = onPaste ;
eWebEditor.focus();
}
// 初始化一个工具栏上的按钮
function InitBtn(btn) {
if (btn.className == "Btn")
{
btn.onmouseover = BtnMouseOver;
btn.onmouseout = BtnMouseOut;
btn.onmousedown = BtnMouseDown;
btn.onmouseup = BtnMouseUp;
btn.ondragstart = YCancelEvent;
btn.onselectstart = YCancelEvent;
btn.onselect = YCancelEvent;
btn.YUSERONCLICK = btn.onclick;
btn.onclick = YCancelEvent;
btn.YINITIALIZED = true;
return true;
}
else
{
btn.onmouseover = BtnMouseOver2;
btn.onmouseout = BtnMouseOut2;
btn.onmousedown = BtnMouseDown2;
btn.onmouseup = BtnMouseUp2;
btn.ondragstart = YCancelEvent;
btn.onselectstart = YCancelEvent;
btn.onselect = YCancelEvent;
btn.YUSERONCLICK = btn.onclick;
btn.onclick = YCancelEvent;
btn.YINITIALIZED = true;
return true;
}
}
//Initialize a toolbar.
function InitTB(y) {
// Set initial size of toolbar to that of the handle
y.TBWidth = 0;
// Populate the toolbar with its contents
if (! PopulateTB(y)) return false;
// Set the toolbar width and put in the handle
y.style.posWidth = y.TBWidth;
return true;
}
// Hander that simply cancels an event
function YCancelEvent() {
event.returnValue=false;
event.cancelBubble=true;
return false;
}
// Toolbar button onmouseover handler
function BtnMouseOver() {
if (event.srcElement.tagName != "IMG") return false;
var image = event.srcElement;
var element = image.parentElement;
// Change button look based on current state of image.
if (image.className == "Ico") element.className = "BtnMouseOverUp";
else if (image.className == "IcoDown") element.className = "BtnMouseOverDown";
event.cancelBubble = true;
}
// Toolbar button onmouseout handler
function BtnMouseOut() {
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
yRaisedElement = null;
element.className = "Btn";
image.className = "Ico";
event.cancelBubble = true;
}
// Toolbar button onmousedown handler
function BtnMouseDown() {
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
event.returnValue=false;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
element.className = "BtnMouseOverDown";
image.className = "IcoDown";
event.cancelBubble = true;
event.returnValue=false;
return false;
}
// Toolbar button onmouseup handler
function BtnMouseUp() {
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");
element.className = "BtnMouseOverUp";
image.className = "Ico";
event.cancelBubble = true;
return false;
}
//***************************************************************************
// ylh add
//***************************************************************************
// Toolbar button onmouseover handler
function BtnMouseOver2() {
if (event.srcElement.tagName != "IMG") return false;
var image = event.srcElement;
var element = image.parentElement;
// Change button look based on current state of image.
if (image.className == "Ico2") element.className = "BtnMouseOverUp2";
else if (image.className == "IcoDown2") element.className = "BtnMouseOverDown2";
event.cancelBubble = true;
}
// Toolbar button onmouseout handler
function BtnMouseOut2() {
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
yRaisedElement = null;
element.className = "Btn2";
image.className = "Ico2";
event.cancelBubble = true;
}
// Toolbar button onmousedown handler
function BtnMouseDown2() {
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
event.returnValue=false;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
element.className = "BtnMouseOverDown2";
image.className = "IcoDown2";
event.cancelBubble = true;
event.returnValue=false;
return false;
}
// Toolbar button onmouseup handler
function BtnMouseUp2() {
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");
element.className = "BtnMouseOverUp2";
image.className = "Ico2";
event.cancelBubble = true;
return false;
}
//***************************************************************************
//---------------------------------------------------------------------------
//***************************************************************************
// Populate a toolbar with the elements within it
function PopulateTB(y) {
var i, elements, element;
// Iterate through all the top-level elements in the toolbar
elements = y.children;
for (i=0; i<elements.length; i++) {
element = elements[i];
if (element.tagName == "SCRIPT" || element.tagName == "!") continue;
switch (element.className) {
case "Btn":
if (element.YINITIALIZED == null) {
if (! InitBtn(element)) {
alert("Problem initializing:" + element.id);
return false;
}
}
element.style.posLeft = y.TBWidth;
y.TBWidth += element.offsetWidth + 1;
break;
//
case "Btn2":
if (element.YINITIALIZED == null) {
if (! InitBtn(element)) {
alert("Problem initializing:" + element.id);
return false;
}
}
element.style.posLeft = y.TBWidth;
y.TBWidth += element.offsetWidth + 1;
break;
//
case "TBGen":
element.style.posLeft = y.TBWidth;
y.TBWidth += element.offsetWidth + 1;
break;
case "TBSep":
element.style.posLeft = y.TBWidth + 2;
y.TBWidth += 5;
break;
case "TBHandle":
element.style.posLeft = 2;
y.TBWidth += element.offsetWidth + 7;
break;
default:
alert("Invalid class: " + element.className + " on Element: " + element.id + " <" + element.tagName + ">");
return false;
}
}
y.TBWidth += 1;
return true;
}
// 设置所属表单的提交或reset事件
function setLinkedField() {
if (! oLinkField) return ;
var oForm = oLinkField.form ;
if (!oForm) return ;
// 附加submit事件
oForm.attachEvent("onsubmit", AttachSubmit) ;
if (! oForm.submitEditor) oForm.submitEditor = new Array() ;
oForm.submitEditor[oForm.submitEditor.length] = AttachSubmit ;
if (! oForm.originalSubmit) {
oForm.originalSubmit = oForm.submit ;
oForm.submit = function() {
if (this.submitEditor) {
for (var i = 0 ; i < this.submitEditor.length ; i++) {
this.submitEditor[i]() ;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -