123.45.150.53:88/baoming.bjcz.gov.cn

eWebEditor
bg_footer1.gif
bg_form1.gif
bg_lefttitle.gif
bg_menu.gif
c_dian1.gif
c_dian2.gif
c_dian3.gif
c_dian4.gif
c_webasp.gif
login_c2.gif
login_c3.gif
login_c4.gif
login_c5.gif
submit.gif
ButtonImage
abspos.gif
anchor.gif
BackColor.gif
backward.gif
bgcolor.gif
checked.gif
componentmenu.gif
createlink.gif
delete.gif
editmenu.gif
fieldset.gif
filemenu.gif
findreplace.gif
fontmenu.gif
forecolor.gif
formbutton.gif
formcheckbox.gif
formdropdown.gif
formmenu.gif
formradio.gif
formtext.gif
formtextarea.gif
forward.gif
iframe.gif
indent.gif
inserthorizontalrule.gif
insertorderedlist.gif
insertparagraph.gif
insertunorderedlist.gif
italic.gif
justifycenter.gif
justifyfull.gif
justifyleft.gif
justifyright.gif
marquee.gif
maximize.gif
minimize.gif
modecode.gif
modecodebtn.gif
modeedit.gif
modeeditbtn.gif
modepreview.gif
modetext.gif
modetextbtn.gif
modeviewbtn.gif
objectmenu.gif
outdent.gif
paragraphmenu.gif
pastetext.gif
pasteword.gif
refresh.gif
remoteupload.gif
removeformat.gif
selectall.gif
showborders.gif
showdetails.gif
sizeminus.gif
sizeplus.gif
spellcheck.gif
strikethrough.gif
subscript.gif
superscript.gif
symbol.gif
tablecellprop.gif
tablecellsplit.gif
tablecoldelete.gif
tablecolinsertleft.gif
tablecolinsertright.gif
tablecolmerge.gif
tablecolsplit.gif
tableinsert.gif
tablemenu.gif
tableprop.gif
tablerowdelete.gif
tablerowinsertabove.gif
tablerowinsertbelow.gif
tablerowmerge.gif
tablerowprop.gif
tablerowsplit.gif
toolmenu.gif
tosmall.gif
underline.gif
unlink.gif
unselect.gif
zoommenu.gif
Editor.css
EditorArea.css
MenuArea.css
Editor.css
EditorArea.css
MenuArea.css
TBHandle.gif
ToolbarBg.gif
ToolbarLeft.gif
ToolbarRight.gif
Editor.css
EditorArea.css
MenuArea.css
Editor.css
EditorArea.css
MenuArea.css
Editor.css
EditorArea.css
MenuArea.css
Editor.css
EditorArea.css
MenuArea.css
Editor.css
EditorArea.css
MenuArea.css
Editor.css
EditorArea.css
MenuArea.css
Editor.css
EditorArea.css
MenuArea.css
ewebeditor.mdb
ewebeditor.gif
anchor.htm
backimage.htm
fieldset.htm
findreplace.htm
fullscreen.htm
hyperlink.htm
iframe.htm
marquee.htm
selcolor.htm
symbol.htm
tablecell.htm
tablecellsplit.htm
NewsSystem
readme.txt
Birthday.gif
christmas.gif
Citrus.gif
Fiesta.jpg
Flower.gif
Gathering.jpg
Glacier.jpg
Hearts.gif
Nature.jpg
folder.gif
folderback.gif
unknow.gif
contextmenu.gif
ewebeditor.gif
RectImg.gif
webasp.gif
UploadFile
Backup_311.jpg
zynopic.jpg
l_top1.gif
l_top2.gif
l_top3.gif
l_top4.gif
main_bg_top.gif
main_left_btm.gif
main_left_top.gif
main_right_btm.gif
main_right_top.gif
open_folder.gif
refresh.gif
title_bg_admin.gif
title_bg_hide.gif
title_bg_show.gif
topBar_bg.gif
admin_style.css
sq_xikeedu.mdb
sq_xikeedu.mdbaa
sq_xikeedu.mdb_now
sq_xikeedu_backup.mdb
复件 sq_xikeedu.mdb
face10.gif
face11.gif
face12.gif
face13.gif
face14.gif
face15.gif
face16.gif
face17.gif
face18.gif
face19.gif
face20.gif
admin1.gif
admin2.gif
admin3.gif
newanc.gif
ad1.jpg.mno
ad3.jpg.mno
bg.jpg.mno
btbg.jpg.mno
btcbg.jpg.mno
bt_l.jpg.mno
bt_r.jpg.mno
c2.jpg.mno
c3.jpg.mno
c4.jpg.mno
cl.jpg.mno
cr.jpg.mno
crt.jpg.mno
ctoptbg.jpg.mno
dhbg.jpg.mno
dhline.jpg.mno
dhxm.jpg.mno
dh_left.jpg.mno
left.jpg.mno
left1.jpg.mno
left1bg.jpg.mno
left2.jpg.mno
left2bg.jpg.mno
left3bg.jpg.mno
leftbg.jpg.mno
lianxizs.jpg.mno
logo.jpg.mno
logoxm.jpg.mno
r1.jpg.mno
shouyebg.jpg.mno
top_bg.jpg.mno
top_l.jpg.mno
zy.jpg.mno
admin2.gif
banner_03.jpg
ctoptbg.jpg
dhline.jpg
dh_left.jpg
into_30.gif
left1bg.jpg
left2bg.jpg
left3bg.jpg
left3bg1.jpg
leftbg.jpg
lianxizs.jpg
logoxm.jpg
newanc.gif
newlst.jpg
pic-039.jpg
shouyebg.jpg
Sm_MainDayIcon.gif
Sm_Nr_BTBnDBg.jpg
top_bg.jpg
wenhao.gif
zhanneixinwen
index.html
index_10.html
index_11.html
index_12.html
index_13.html
index_14.html
index_15.html
index_16.html
index_17.html
index_18.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
index_9.html
zhanwaixinwen
index.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
index.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
zhanneixinwen
index.html
index_10.html
index_11.html
index_12.html
index_13.html
index_14.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
index_9.html
zhanwaixinwen
index.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
zhanneixinwen
index.html
index_10.html
index_11.html
index_12.html
index_13.html
index_14.html
index_15.html
index_16.html
index_17.html
index_18.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
index_9.html
zhanwaixinwen
index.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
zhanneixinwen
index.html
index_10.html
index_11.html
index_12.html
index_13.html
index_14.html
index_15.html
index_16.html
index_17.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
index_9.html
zhanwaixinwen
index.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
zhanneixinwen
index.html
index_10.html
index_11.html
index_12.html
index_13.html
index_14.html
index_15.html
index_16.html
index_17.html
index_18.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
index_9.html
zhanwaixinwen
index.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
zhanneixinwen
index.html
index_10.html
index_11.html
index_12.html
index_13.html
index_14.html
index_15.html
index_16.html
index_17.html
index_18.html
index_19.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
index_9.html
zhanwaixinwen
index.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
zhanneixinwen
index.html
index_10.html
index_11.html
index_12.html
index_13.html
index_14.html
index_15.html
index_16.html
index_17.html
index_18.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
index_9.html
zhanwaixinwen
index.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
zhanneixinwen
index.html
index_10.html
index_11.html
index_12.html
index_13.html
index_14.html
index_15.html
index_16.html
index_2.html
index_3.html
index_4.html
index_5.html
index_7.html
index_8.html
index_9.html
zhanwaixinwen
index.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
zhanneixinwen
index.html
index_10.html
index_11.html
index_12.html
index_13.html
index_14.html
index_15.html
index_16.html
index_2.html
index_3.html
index_4.html
index_5.html
index_6.html
index_7.html
index_8.html
index_9.html
zhanwaixinwen
index.html
index_2.html
index_3.html
index_4.html
index_5.html
ASP调试工具.exe
使用说明.txt
*☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
eWebEditor - eWebSoft在线编辑器
程序制作: eWeb开发团队
相关网址: [产品介绍]/Product/eWebEditor/ ☆
[支持论坛]/
主页地址: /
eWebSoft团队及产品
http://www.webasp.net/
WEB技术及应用资源网站
http://bbs.webasp.net/
WEB技术交流论坛
*☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
// 当前模式
var sCurrMode =
var bEditMode =
// 连接对象
var oLinkField =
// 浏览器版本检测
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 =
function document.onreadystatechange(){
if (document.readyState!=&complete&)
if (bInitialized)
bInitialized =
// 初始每个工具栏
for (i=0; i&document.body.all.i++){
curr=document.body.all[i];
if (curr.className == &yToolbar&){
InitTB(curr);
yToolbars[yToolbars.length] =
oLinkField = parent.document.getElementsByName(sLinkFieldName)[0];
if (!config.License){
eWebEditor_License.innerHTML = && &a href='' target='_blank'&&font color=#000000&&/font&&/a&&;
// IE5.5以下版本只能使用纯文本模式
if (!BrowserInfo.IsIE55OrMore){
config.InitMode = &TEXT&;
if (ContentFlag.value==&0&) {
ContentEdit.value = oLinkField.
ContentLoad.value = oLinkField.
ModeEdit.value = config.InitM
ContentFlag.value = &1&;
setMode(ModeEdit.value);
setLinkedField() ;
// 初始化一个工具栏上的按钮
function InitBtn(btn) {
btn.onmouseover = BtnMouseO
btn.onmouseout = BtnMouseO
btn.onmousedown = BtnMouseD
btn.onmouseup = BtnMouseUp;
btn.ondragstart = YCancelE
btn.onselectstart = YCancelE
btn.onselect = YCancelE
btn.YUSERONCLICK = btn.
btn.onclick = YCancelE
btn.YINITIALIZED =
//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))
// Set the toolbar width and put in the handle
y.style.posWidth = y.TBW
// Hander that simply cancels an event
function YCancelEvent() {
event.returnValue=
event.cancelBubble=
// Toolbar button onmouseover handler
function BtnMouseOver() {
if (event.srcElement.tagName != &IMG&)
var image = event.srcE
var element = image.parentE
// 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 =
// Toolbar button onmouseout handler
function BtnMouseOut() {
if (event.srcElement.tagName != &IMG&) {
event.cancelBubble =
var image = event.srcE
var element = image.parentE
yRaisedElement =
element.className = &Btn&;
image.className = &Ico&;
event.cancelBubble =
// Toolbar button onmousedown handler
function BtnMouseDown() {
if (event.srcElement.tagName != &IMG&) {
event.cancelBubble =
event.returnValue=
var image = event.srcE
var element = image.parentE
element.className = &BtnMouseOverDown&;
image.className = &IcoDown&;
event.cancelBubble =
event.returnValue=
// Toolbar button onmouseup handler
function BtnMouseUp() {
if (event.srcElement.tagName != &IMG&) {
event.cancelBubble =
var image = event.srcE
var element = image.parentE
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + &anonymous()&);
element.className = &BtnMouseOverUp&;
image.className = &Ico&;
event.cancelBubble =
// Populate a toolbar with the elements within it
function PopulateTB(y) {
var i, elements,
// Iterate through all the top-level elements in the toolbar
elements = y.
for (i=0; i&elements. i++) {
element = elements[i];
if (element.tagName == &SCRIPT& || element.tagName == &!&)
switch (element.className) {
case &Btn&:
if (element.YINITIALIZED == null) {
if (! InitBtn(element)) {
alert(&Problem initializing:& + element.id);
element.style.posLeft = y.TBW
y.TBWidth += element.offsetWidth + 1;
case &TBGen&:
element.style.posLeft = y.TBW
y.TBWidth += element.offsetWidth + 1;
case &TBSep&:
element.style.posLeft = y.TBWidth + 2;
y.TBWidth += 5;
case &TBHandle&:
element.style.posLeft = 2;
y.TBWidth += element.offsetWidth + 7;
alert(&Invalid class: & + element.className + & on Element: & + element.id + & && + element.tagName + &&&);
y.TBWidth += 1;
// 设置所属表单的提交或reset事件
function setLinkedField() {
if (! oLinkField)
var oForm = oLinkField.
if (!oForm)
// 附加submit事件
oForm.attachEvent(&onsubmit&, AttachSubmit) ;
if (! oForm.submitEditor) oForm.submitEditor = new Array() ;
oForm.submitEditor[oForm.submitEditor.length] = AttachS
if (! oForm.originalSubmit) {
oForm.originalSubmit = oForm.
oForm.submit = function() {
if (this.submitEditor) {
for (var i = 0 ; i & this.submitEditor. i++) {
this.submitEditor[i]() ;
this.originalSubmit() ;
// 附加reset事件
oForm.attachEvent(&onreset&, AttachReset) ;
if (! oForm.resetEditor) oForm.resetEditor = new Array() ;
oForm.resetEditor[oForm.resetEditor.length] = AttachR
if (! oForm.originalReset) {
oForm.originalReset = oForm.
oForm.reset = function() {
if (this.resetEditor) {
for (var i = 0 ; i & this.resetEditor. i++) {
this.resetEditor[i]() ;
this.originalReset() ;
// 附加submit提交事件,大表单数据提交,保存eWebEditor中的内容
function AttachSubmit() {
var oForm = oLinkField.
if (!oForm)
var html = getHTML();
ContentEdit.value =
if (sCurrMode==&TEXT&){
html = HTMLEncode(html);
splitTextField(oLinkField, html);
// 表单提交
function doSubmit(){
var oForm = oLinkField.
if (!oForm)
oForm.submit();
// 附加Reset事件
function AttachReset() {
if(bEditMode){
eWebEditor.document.body.innerHTML = ContentLoad.
eWebEditor.document.body.innerText = ContentLoad.
// 显示帮助
function onHelp(){
ShowDialog('dialog/help.htm','400','300');
// 粘贴时自动检测是否来源于Word格式
function onPaste() {
if (sCurrMode==&VIEW&)
if (sCurrMode==&EDIT&){
var sHTML = GetClipboardHTML() ;
if (config.AutoDetectPasteFromWord && BrowserInfo.IsIE55OrMore) {
var re = /&\w[^&]* class=&?MsoNormal&?/
if ( re.test(sHTML)){
if ( confirm( &你要粘贴的内容好象是从Word中拷出来的,是否要先清除Word格式再粘贴?& ) ){
cleanAndPaste( sHTML ) ;
eWebEditor.document.selection.createRange().pasteHTML(sHTML) ;
eWebEditor.document.selection.createRange().pasteHTML(HTMLEncode( clipboardData.getData(&Text&))) ;
function onKeyDown(event){
var key = String.fromCharCode(event.keyCode).toUpperCase();
// F2:显示或隐藏指导方针
if (event.keyCode==113){
showBorders();
if (event.ctrlKey){
// Ctrl+Enter:提交
if (event.keyCode==10){
doSubmit();
// Ctrl++:增加编辑区
if (key==&+&){
sizeChange(300);
// Ctrl+-:减小编辑区
if (key==&-&){
sizeChange(-300);
// Ctrl+1:代码模式
if (key==&1&){
setMode(&CODE&);
// Ctrl+2:设计模式
if (key==&2&){
setMode(&EDIT&);
// Ctrl+3:纯文本
if (key==&3&){
setMode(&TEXT&);
// Ctrl+4:预览
if (key==&4&){
setMode(&VIEW&);
switch(sCurrMode){
case &VIEW&:
case &EDIT&:
if (event.ctrlKey){
// Ctrl+D:从Word粘贴
if (key == &D&){
PasteWord();
// Ctrl+R:查找替换
if (key == &R&){
findReplace();
// Ctrl+Z:Undo
if (key == &Z&){
goHistory(-1);
// Ctrl+Y:Redo
if (key == &Y&){
goHistory(1);
if(!event.ctrlKey && event.keyCode != 90 && event.keyCode != 89) {
if (event.keyCode == 32 || event.keyCode == 13){
saveHistory()
if (event.keyCode==13){
var sel = eWebEditor.document.selection.createRange();
sel.pasteHTML(&&BR&&);
event.cancelBubble =
event.returnValue =
sel.select();
sel.moveEnd(&character&, 1);
sel.moveStart(&character&, 1);
sel.collapse(false);
// 屏蔽事件
if (event.ctrlKey){
// Ctrl+B,I,U
if ((key == &B&)||(key == &I&)||(key == &U&)){
// 取剪粘板中的HTML格式数据
function GetClipboardHTML() {
var oDiv = document.getElementById(&eWebEditor_Temp_HTML&)
oDiv.innerHTML = && ;
var oTextRange = document.body.createTextRange() ;
oTextRange.moveToElementText(oDiv) ;
oTextRange.execCommand(&Paste&) ;
var sData = oDiv.innerHTML ;
oDiv.innerHTML = && ;
// 清除WORD冗余格式并粘贴
function cleanAndPaste( html ) {
// Remove all SPAN tags
html = html.replace(/&\/?SPAN[^&]*&/gi, && );
// Remove Class attributes
html = html.replace(/&(\w[^&]*) class=([^ |&]*)([^&]*)/gi, &&$1$3&) ;
// Remove Style attributes
html = html.replace(/&(\w[^&]*) style=&([^&]*)&([^&]*)/gi, &&$1$3&) ;
// Remove Lang attributes
html = html.replace(/&(\w[^&]*) lang=([^ |&]*)([^&]*)/gi, &&$1$3&) ;
// Remove XML elements and declarations
html = html.replace(/&\\?\?xml[^&]*&/gi, &&) ;
// Remove Tags with XML namespace declarations: &o:p&&/o:p&
html = html.replace(/&\/?\w+:[^&]*&/gi, &&) ;
// Replace the &
html = html.replace(/&/, & & );
// Transform &P& to &DIV&
var re = new RegExp(&(&P)([^&]*&.*?)(&\/P&)&,&gi&) ; // Different because of a IE 5.0 error
html = html.replace( re, &&div$2&/div&& ) ;
insertHTML( html ) ;
// 在当前文档位置插入.
function insertHTML(html) {
if (isModeView())
if (eWebEditor.document.selection.type.toLowerCase() != &none&){
eWebEditor.document.selection.clear() ;
if (sCurrMode!=&EDIT&){
html=HTMLEncode(html);
eWebEditor.document.selection.createRange().pasteHTML(html) ;
// 设置编辑器的内容
function setHTML(html) {
ContentEdit.value =
switch (sCurrMode){
case &CODE&:
eWebEditor.document.designMode=&On&;
eWebEditor.document.open();
eWebEditor.document.write(config.StyleEditorHeader);
eWebEditor.document.body.innerText=
eWebEditor.document.body.contentEditable=&true&;
eWebEditor.document.close();
bEditMode=
case &EDIT&:
eWebEditor.document.designMode=&On&;
eWebEditor.document.open();
eWebEditor.document.write(config.StyleEditorHeader+html);
eWebEditor.document.body.contentEditable=&true&;
eWebEditor.document.execCommand(&2D-Position&,true,true);
eWebEditor.document.execCommand(&MultipleSelection&, true, true);
eWebEditor.document.execCommand(&LiveResize&, true, true);
eWebEditor.document.close();
doZoom(nCurrZoomSize);
bEditMode=
eWebEditor.document.onselectionchange = function () { doToolbar();}
case &TEXT&:
eWebEditor.document.designMode=&On&;
eWebEditor.document.open();
eWebEditor.document.write(config.StyleEditorHeader);
eWebEditor.document.body.innerText=
eWebEditor.document.body.contentEditable=&true&;
eWebEditor.document.close();
bEditMode=
case &VIEW&:
eWebEditor.document.designMode=&off&;
eWebEditor.document.open();
eWebEditor.document.write(config.StyleEditorHeader+html);
eWebEditor.document.body.contentEditable=&false&;
eWebEditor.document.close();
bEditMode=
eWebEditor.document.body.onpaste = onP
eWebEditor.document.body.onhelp = onH
eWebEditor.document.onkeydown = new Function(&return onKeyDown(eWebEditor.event);&);
eWebEditor.document.oncontextmenu=new Function(&return showContextMenu(eWebEditor.event);&);
if ((borderShown != &0&)&&bEditMode) {
borderShown = &0&;
showBorders();
initHistory();
// 取编辑器的内容
function getHTML() {
if((sCurrMode==&EDIT&)||(sCurrMode==&VIEW&)){
html = eWebEditor.document.body.innerHTML;
html = eWebEditor.document.body.innerT
if (sCurrMode!=&TEXT&){
if ((html.toLowerCase()==&&p&&&/p&&)||(html.toLowerCase()==&&p&&/p&&)){
html = &&;
// 在尾部追加内容
function appendHTML(html) {
if (isModeView())
if(sCurrMode==&EDIT&){
eWebEditor.document.body.innerHTML +=
eWebEditor.document.body.innerText +=
// 从Word中粘贴,去除格式
function PasteWord(){
if (!validateMode())
eWebEditor.focus();
if (BrowserInfo.IsIE55OrMore)
cleanAndPaste( GetClipboardHTML() ) ;
else if ( confirm( &此功能要求IE5.5版本以上,你当前的浏览器不支持,是否按常规粘贴进行?& ) )
format(&paste&) ;
eWebEditor.focus();
// 粘贴纯文本
function PasteText(){
if (!validateMode())
eWebEditor.focus();
var sText = HTMLEncode( clipboardData.getData(&Text&) ) ;
insertHTML(sText);
eWebEditor.focus();
// 检测当前是否允许编辑
function validateMode() {
if (sCurrMode==&EDIT&)
alert(&需转换为编辑状态后才能使用编辑功能!&);
eWebEditor.focus();
// 检测当前是否在预览模式
function isModeView(){
if (sCurrMode==&VIEW&){
alert(&预览时不允许设置编辑区内容。&);
// 格式化编辑器中的内容
function format(what,opt) {
if (!validateMode())
eWebEditor.focus();
if (opt==&RemoveFormat&) {
if (opt==null) eWebEditor.document.execCommand(what);
else eWebEditor.document.execCommand(what,&&,opt);
eWebEditor.focus();
// 确保焦点在 eWebEditor 内
function VerifyFocus() {
if ( eWebEditor )
eWebEditor.focus();
// 改变模式:代码、编辑、文本、预览
function setMode(NewMode){
if (NewMode!=sCurrMode){
if (!BrowserInfo.IsIE55OrMore){
if ((NewMode==&CODE&) || (NewMode==&EDIT&) || (NewMode==&VIEW&)){
alert(&HTML编辑模式需要IE5.5版本以上的支持!&);
if (NewMode==&TEXT&){
if (sCurrMode==ModeEdit.value){
if (!confirm(&警告!切换到纯文本模式会丢失您所有的HTML格式,您确认切换吗?&)){
var sBody = &&;
switch(sCurrMode){
case &CODE&:
if (NewMode==&TEXT&){
eWebEditor_Temp_HTML.innerHTML = eWebEditor.document.body.innerT
sBody = eWebEditor_Temp_HTML.innerT
sBody = eWebEditor.document.body.innerT
case &TEXT&:
sBody = eWebEditor.document.body.innerT
sBody = HTMLEncode(sBody);
case &EDIT&:
case &VIEW&:
if (NewMode==&TEXT&){
sBody = eWebEditor.document.body.innerT
sBody = eWebEditor.document.body.innerHTML;
sBody = ContentEdit.
document.all[&eWebEditor_CODE&].className = &StatusBarBtnOff&;
document.all[&eWebEditor_EDIT&].className = &StatusBarBtnOff&;
document.all[&eWebEditor_TEXT&].className = &StatusBarBtnOff&;
document.all[&eWebEditor_VIEW&].className = &StatusBarBtnOff&;
document.all[&eWebEditor_&+NewMode].className = &StatusBarBtnOn&;
sCurrMode = NewM
ModeEdit.value = NewM
setHTML(sBody);
disableChildren(eWebEditor_Toolbar);
// 使工具栏无效
function disableChildren(obj){
obj.disabled=(!bEditMode);
for (var i=0; i&obj.children. i++){
disableChildren(obj.children[i]);
// 显示无模式对话框
function ShowDialog(url, width, height, optValidate) {
if (optValidate) {
if (!validateMode())
eWebEditor.focus();
var arr = showModalDialog(url, window, &dialogWidth:& + width + &dialogHeight:& + height + &help:scroll:status:no&);
eWebEditor.focus();
// 全屏编辑
function Maximize() {
if (!validateMode())
window.open(&dialog/fullscreen.htm?style=&+config.StyleName, 'FullScreen'+sLinkFieldName, 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,fullscreen=yes');
// 创建或修改超级链接
function createLink(){
if (!validateMode())
if (eWebEditor.document.selection.type == &Control&) {
var oControlRange = eWebEditor.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() != &IMG&) {
alert(&链接只能是图片或文本&);
ShowDialog(&dialog/hyperlink.htm&, 350, 170, true);
// 替换特殊字符
function HTMLEncode(text){
text = text.replace(/&/g, &&&) ;
text = text.replace(/&/g, &&&) ;
text = text.replace(/&/g, &&&) ;
text = text.replace(/&/g, &&&) ;
text = text.replace(/'/g, &’&) ;
text = text.replace(/\ /g,&&&);
text = text.replace(/\n/g,&&br&&);
text = text.replace(/\t/g,&&&&&&);
// 插入特殊对象
function insert(what) {
if (!validateMode())
eWebEditor.focus();
var sel = eWebEditor.document.selection.createRange();
switch(what){
case &excel&:
// 插入EXCEL表格
insertHTML(&&object classid='clsid:0-' id='Spreadsheet1' codebase='file:\\Bob\software\office2000\msowc.cab' width='100%' height='250'&&param name='HTMLURL' value&&param name='HTMLData' value='&html xmlns:x=&urn:schemas-microsoft-com:office:excel&xmlns=&http://www.w3.org/TR/REC-html40&&&head&&style type=&text/css&&&!--tr{mso-height-source:}td{black-space:}.wc4590F88{black-space:font-family:宋体;mso-number-format:Gfont-size:font-weight:font-style:text-decoration:mso-background-source:mso-pattern:mso-color-source:text-align:vertical-align:border-top:border-left:border-right:border-bottom:mso-protection:}--&&/style&&/head&&body&&!--[if gte mso 9]&&xml&&x:ExcelWorkbook&&x:ExcelWorksheets&&x:ExcelWorksheet&&x:OWCVersion&9.0.0.2710&/x:OWCVersion&&x:Label Style='border-top:solid .5border-left:solid .5border-right:solid .5border-bottom:solid .5pt silver'&&x:Caption&Microsoft Office Spreadsheet&/x:Caption& &/x:Label&&x:Name&Sheet1&/x:Name&&x:WorksheetOptions&&x:Selected/&&x:Height&7620&/x:Height&&x:Width&15240&/x:Width&&x:TopRowVisible&0&/x:TopRowVisible&&x:LeftColumnVisible&0&/x:LeftColumnVisible& &x:ProtectContents&False&/x:ProtectContents& &x:DefaultRowHeight&210&/x:DefaultRowHeight& &x:StandardWidth&2389&/x:StandardWidth& &/x:WorksheetOptions& &/x:ExcelWorksheet&&/x:ExcelWorksheets& &x:MaxHeight&80%&/x:MaxHeight&&x:MaxWidth&80%&/x:MaxWidth&&/x:ExcelWorkbook&&/xml&&![endif]--&&table class=wc4590F88 x:str&&col width=&56&&&tr height=&14&&&td&&/td&&/tr&&/table&&/body&&/html&'& &param name='DataType' value='HTMLDATA'& &param name='AutoFit' value='0'&&param name='DisplayColHeaders' value='-1'&&param name='DisplayGridlines' value='-1'&&param name='DisplayHorizontalScrollBar' value='-1'&&param name='DisplayRowHeaders' value='-1'&&param name='DisplayTitleBar' value='-1'&&param name='DisplayToolbar' value='-1'&&param name='DisplayVerticalScrollBar' value='-1'& &param name='EnableAutoCalculate' value='-1'& &param name='EnableEvents' value='-1'&&param name='MoveAfterReturn' value='-1'&&param name='MoveAfterReturnDirection' value='0'&&param name='RightToLeft' value='0'&&param name='ViewableRange' value='1:65536'&&/object&&);
case &nowdate&:
// 插入当前系统日期
var d = new Date();
insertHTML(d.toLocaleDateString());
case &nowtime&:
// 插入当前系统时间
var d = new Date();
insertHTML(d.toLocaleTimeString());
case &br&:
// 插入换行符
insertHTML(&&br&&)
case &code&:
// 代码片段样式
insertHTML('&table width=95% border=&0& align=&Center& cellpadding=&6& cellspacing=&0& style=&border: 1px Dotted #CCCCCC; TABLE-LAYOUT: fixed&&&tr&&td bgcolor=#FDFDDF style=&WORD-WRAP: break-word&&&font style=&color: #990000;font-weight:bold&&以下是代码片段:&/font&&br&'+HTMLEncode(sel.text)+'&/td&&/tr&&/table&');
case &quote&:
// 引用片段样式
insertHTML('&table width=95% border=&0& align=&Center& cellpadding=&6& cellspacing=&0& style=&border: 1px Dotted #CCCCCC; TABLE-LAYOUT: fixed&&&tr&&td bgcolor=#F3F3F3 style=&WORD-WRAP: break-word&&&font style=&color: #990000;font-weight:bold&&以下是引用片段:&/font&&br&'+HTMLEncode(sel.text)+'&/td&&/tr&&/table&');
case &big&:
// 字体变大
insertHTML(&&big&& + sel.text + &&/big&&);
case &small&:
// 字体变小
insertHTML(&&small&& + sel.text + &&/small&&);
alert(&错误参数调用!&);
// 显示或隐藏指导方针
var borderShown = config.ShowB
function showBorders() {
if (!validateMode())
var allForms = eWebEditor.document.body.getElementsByTagName(&FORM&);
var allInputs = eWebEditor.document.body.getElementsByTagName(&INPUT&);
var allTables = eWebEditor.document.body.getElementsByTagName(&TABLE&);
var allLinks = eWebEditor.document.body.getElementsByTagName(&A&);
for (a=0; a & allForms. a++) {
if (borderShown == &0&) {
allForms[a].runtimeStyle.border = &1px dotted #FF0000&
allForms[a].runtimeStyle.cssText = &&
// Input Hidden类
for (b=0; b & allInputs. b++) {
if (borderShown == &0&) {
if (allInputs[b].type.toUpperCase() == &HIDDEN&) {
allInputs[b].runtimeStyle.border = &1px dashed #000000&
allInputs[b].runtimeStyle.width = &15px&
allInputs[b].runtimeStyle.height = &15px&
allInputs[b].runtimeStyle.backgroundColor = &#FDADAD&
allInputs[b].runtimeStyle.color = &#FDADAD&
if (allInputs[b].type.toUpperCase() == &HIDDEN&)
allInputs[b].runtimeStyle.cssText = &&
for (i=0; i & allTables. i++) {
if (borderShown == &0&) {
allTables[i].runtimeStyle.border = &1px dotted #BFBFBF&
allTables[i].runtimeStyle.cssText = &&
allRows = allTables[i].rows
for (y=0; y & allRows. y++) {
allCellsInRow = allRows[y].cells
for (x=0; x & allCellsInRow. x++) {
if (borderShown == &0&) {
allCellsInRow[x].runtimeStyle.border = &1px dotted #BFBFBF&
allCellsInRow[x].runtimeStyle.cssText = &&
for (a=0; a & allLinks. a++) {
if (borderShown == &0&) {
if (allLinks[a].href.toUpperCase() == &&) {
allLinks[a].runtimeStyle.borderBottom = &1px dashed #000000&
allLinks[a].runtimeStyle.cssText = &&
if (borderShown == &0&) {
borderShown = &1&
borderShown = &0&
scrollUp()
// 返回页面最上部
function scrollUp() {
eWebEditor.scrollBy(0,0);
// 缩放操作
var nCurrZoomSize = 100;
var aZoomSize = new Array(10, 25, 50, 75, 100, 150, 200, 500);
function doZoom(size) {
eWebEditor.document.body.runtimeStyle.zoom = size + &%&;
nCurrZoomSize =
// 拼写检查
function spellCheck(){
ShowDialog('dialog/spellcheck.htm', 300, 220, true)
// 查找替换
function findReplace(){
ShowDialog('dialog/findreplace.htm', 320, 165, true)
// 相对(absolute)或绝对位置(static)
function absolutePosition(){
var objReference =
var RangeType
= eWebEditor.document.selection.
if (RangeType != &Control&)
var selectedRange = eWebEditor.document.selection.createRange();
for (var i=0; i&selectedRange. i++){
objReference = selectedRange.item(i);
if (objReference.style.position != 'absolute') {
objReference.style.position='absolute';
objReference.style.position='static';
// 上移(forward)或下移(backward)一层
function zIndex(action){
var objReference =
var RangeType
= eWebEditor.document.selection.
if (RangeType != &Control&)
var selectedRange = eWebEditor.document.selection.createRange();
for (var i=0; i&selectedRange. i++){
objReference = selectedRange.item(i);
if (action=='forward'){
objReference.style.zIndex
objReference.style.zIndex
objReference.style.position='absolute';
// 是否选中指定类型的控件
function isControlSelected(tag){
if (eWebEditor.document.selection.type == &Control&) {
var oControlRange = eWebEditor.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == tag) {
// 改变编辑区高度
function sizeChange(size){
if (!BrowserInfo.IsIE55OrMore){
alert(&此功能需要IE5.5版本以上的支持!&);
for (var i=0; i&parent.frames. i++){
if (parent.frames[i].document==self.document){
var obj=parent.frames[i].frameE
var height = parseInt(obj.offsetHeight);
if (height+size&=300){
obj.height=height+
// 热点链接
function mapEdit(){
if (!validateMode())
if (eWebEditor.document.selection.type == &Control&) {
var oControlRange = eWebEditor.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == &IMG&) {
alert(&热点链接只能作用于图片&);
window.open(&dialog/map.htm&, 'mapEdit'+sLinkFieldName, 'toolbar=no,location=no,directories=no,status=not,menubar=no,scrollbars=no,resizable=yes,width=450,height=300');
// 上传文件成功返回原文件名、保存后的文件名、保存后的路径文件名,提供接口
function addUploadFile(originalFileName, saveFileName, savePathFileName){
doInterfaceUpload(sLinkOriginalFileName, originalFileName);
doInterfaceUpload(sLinkSaveFileName, saveFileName);
doInterfaceUpload(sLinkSavePathFileName, savePathFileName);
// 文件上传成功接口操作
function doInterfaceUpload(strLinkName, strValue){
if (strValue==&&)
if (strLinkName){
var objLinkUpload = parent.document.getElementsByName(strLinkName)[0];
if (objLinkUpload){
if (objLinkUpload.value!=&&){
objLinkUpload.value = objLinkUpload.value + &|&;
objLinkUpload.value = objLinkUpload.value + strV
objLinkUpload.fireEvent(&onchange&);
// 大文件内容自动拆分
function splitTextField(objField, html) {
var strFieldName = objField.
var objForm = objField.
var objDocument = objField.
objField.value =
//表单限制值设定,限制值是102399,考虑到中文设为一半
var FormLimit = 50000 ;
// 再次处理时,先赋空值
for (var i=1;i&objDocument.getElementsByName(strFieldName).i++) {
objDocument.getElementsByName(strFieldName)[i].value = &&;
//如果表单值超过限制,拆成多个对象
if (html.length & FormLimit) {
objField.value = html.substr(0, FormLimit) ;
html = html.substr(FormLimit) ;
while (html.length & 0) {
var objTEXTAREA = objDocument.createElement(&TEXTAREA&) ;
objTEXTAREA.name = strFieldN
objTEXTAREA.style.display = &none& ;
objTEXTAREA.value = html.substr(0, FormLimit) ;
objForm.appendChild(objTEXTAREA) ;
html = html.substr(FormLimit) ;
// 远程上传
var sEventUploadA
function remoteUpload(strEventUploadAfter) {
if (config.AutoRemote!=&1&)
if (sCurrMode==&TEXT&)
sEventUploadAfter = strEventUploadA
var objField = document.getElementsByName(&eWebEditor_UploadText&)[0];
splitTextField(objField, getHTML());
divProcessing.style.top = (document.body.clientHeight-parseFloat(divProcessing.style.height))/2;
divProcessing.style.left = (document.body.clientWidth-parseFloat(divProcessing.style.width))/2;
divProcessing.style.display = &&;
eWebEditor_UploadForm.submit();
// 远程上传完成
function remoteUploadOK() {
divProcessing.style.display = &none&;
if (oLinkField){
if (sEventUploadAfter){
eval(&parent.&+sEventUploadAfter);
// 修正Undo/Redo
var history = new O
history.data = [];
history.position = 0;
history.bookmark = [];
// 保存历史
function saveHistory() {
if (bEditMode){
if (history.data[history.position] != eWebEditor.document.body.innerHTML){
var nBeginLen = history.data.
var nPopLen = history.data.length - history.
for (var i=1; i&nPopL i++){
history.data.pop();
history.bookmark.pop();
history.data[history.data.length] = eWebEditor.document.body.innerHTML;
if (eWebEditor.document.selection.type != &Control&){
history.bookmark[history.bookmark.length] = eWebEditor.document.selection.createRange().getBookmark();
var oControl = eWebEditor.document.selection.createRange();
history.bookmark[history.bookmark.length] = oControl[0];
if (nBeginLen!=0){
history.position++;
// 初始历史
function initHistory() {
history.data.length = 0;
history.bookmark.length = 0;
history.position = 0;
// 返回历史
function goHistory(value) {
saveHistory();
if (value == -1){
if (history.position & 0){
eWebEditor.document.body.innerHTML = history.data[--history.position];
setHistoryCursor();
if (history.position & history.data.length -1){
eWebEditor.document.body.innerHTML = history.data[++history.position];
setHistoryCursor();
// 设置当前书签
function setHistoryCursor() {
if (history.bookmark[history.position]){
r = eWebEditor.document.body.createTextRange()
if (history.bookmark[history.position] != &[object]&){
if (r.moveToBookmark(history.bookmark[history.position])){
r.collapse(false);
r.select();
// End Undo / Redo Fix
// 工具栏事件发生
function doToolbar(){
if (bEditMode){
saveHistory();
Copyright(C)
OKBASE.NET All Rights Reserved 好库网 版权所有}

我要回帖

更多关于 gaokaobaoming 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信