📄 editor.js
字号:
{
sHTMLDropMenus+="<tr><td onclick=\""+this.oName+".insertCustomTag('"+this.arrCustomTag[j][1]+"')\" "+
"style=\"padding:1px;padding-left:5px;padding-right:5px;font-family:tahoma;font-size:11px;color:black;\" "+
"onmouseover=\"this.style.backgroundColor='#708090';this.style.color='#FFFFFF';\" "+
"onmouseout=\"this.style.backgroundColor='';this.style.color='#000000';\" unselectable=on align=center>"+
this.arrCustomTag[j][0]+"</td></tr>";
if(j==14||j==29||j==44||j==59||j==74||j==89||j==104)
{
if(j!=this.arrCustomTag.length-1)
{
sHTMLDropMenus+="</table>";
sHTMLDropMenus+="</td><td valign=top style='border-left:#716f64 1 solid'>";//main
sHTMLDropMenus+="<table cellpadding=0 cellspacing=0>";
}
}
}
sHTMLDropMenus+="</table>";
//~~~~
sHTMLDropMenus+="</td></tr></table>";
sHTMLIcons+=this.writeDropDown("btnCustomTag"+this.oName,this.oName+".dropShow(this,dropCustomTag"+this.oName+")","btnCustomTag.gif",getText("Tags"),60);
}
break;
case "Image":
if(this.btnImage)sHTMLIcons+=this.writeIconStandard("btnImage"+this.oName,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"image.htm',440,351)","btnImage.gif",getText("Image"));
break;
case "Flash":
if(this.btnFlash)sHTMLIcons+=this.writeIconStandard("btnFlash"+this.oName,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"flash.htm',340,275)","btnFlash.gif",getText("Flash"));
break;
case "Media":
if(this.btnMedia)sHTMLIcons+=this.writeIconStandard("btnMedia"+this.oName,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"media.htm',340,272)","btnMedia.gif",getText("Media"));
break;
case "ContentBlock":
if(this.btnContentBlock)sHTMLIcons+=this.writeIconStandard("btnContentBlock"+this.oName,this.oName+".hide();"+this.cmdContentBlock,"btnContentBlock.gif",getText("Content Block"));
break;
case "InternalLink":
if(this.btnInternalLink)sHTMLIcons+=this.writeIconStandard("btnInternalLink"+this.oName,this.oName+".hide();"+this.cmdInternalLink,"btnInternalLink.gif",getText("Internal Link"));
break;
case "CustomObject":
if(this.btnCustomObject)sHTMLIcons+=this.writeIconStandard("btnCustomObject"+this.oName,this.oName+".hide();"+this.cmdCustomObject,"btnCustomObject.gif",getText("Object"));
break;
case "Table":
if(this.btnTable)
{
sHTMLDropMenus+="<table id=dropTable"+this.oName+" cellpadding=0 cellspacing=0 "+
"style='z-index:1;display:none;position:absolute;border:#716F64 1px solid;"+
"cursor:default;background-color:#fdfdfd;' unselectable=on>"+
"<tr><td id=\"mnuTableSize"+this.oName+"\" onclick=\"if(this.style.color!='gray'){modelessDialogShow('"+this.scriptPath+"table_size.htm',240,262);"+
" dropTable"+this.oName+".style.display='none'}\""+
" style=\"padding:2px;padding-top:1px;font-family:Tahoma;font-size:11px;color:black\""+
" onmouseover=\"if(this.style.color!='gray'){this.style.backgroundColor='#708090';this.style.color='#FFFFFF';}\""+
" onmouseout=\"if(this.style.color!='gray'){this.style.backgroundColor='';this.style.color='#000000';}\" unselectable=on>"+getText("Table Size")+" </td></tr>"+
"<tr><td id=\"mnuTableEdit"+this.oName+"\" onclick=\"if(this.style.color!='gray'){modelessDialogShow('"+this.scriptPath+"table_edit.htm',358,360);"+
" dropTable"+this.oName+".style.display='none'}\""+
" style=\"padding:2px;padding-top:1px;font-family:Tahoma;font-size:11px;color:black\""+
" onmouseover=\"if(this.style.color!='gray'){this.style.backgroundColor='#708090';this.style.color='#FFFFFF';}\""+
" onmouseout=\"if(this.style.color!='gray'){this.style.backgroundColor='';this.style.color='#000000';}\" unselectable=on>"+getText("Edit Table")+" </td></tr>"+
"<tr><td id=\"mnuCellEdit"+this.oName+"\" onclick=\"if(this.style.color!='gray'){modelessDialogShow('"+this.scriptPath+"table_editCell.htm',427,440);"+
" dropTable"+this.oName+".style.display='none'}\""+
" style=\"padding:2px;padding-top:1px;font-family:Tahoma;font-size:11px;color:black\""+
" onmouseover=\"if(this.style.color!='gray'){this.style.backgroundColor='#708090';this.style.color='#FFFFFF';}\""+
" onmouseout=\"if(this.style.color!='gray'){this.style.backgroundColor='';this.style.color='#000000';}\" unselectable=on>"+getText("Edit Cell")+" </td></tr>"+
"</table>";
sHTMLDropMenus+="<table width=195 id=dropTableCreate"+this.oName+" onmouseout='doOut_TabCreate();event.cancelBubble=true' style='position:absolute;display:none;cursor:default;background:#f3f3f3;border:#8a867a 1px solid;' cellpadding=0 cellspacing=2 border=0 unselectable=on>";
for(var m=0;m<8;m++)
{
sHTMLDropMenus+="<tr>";
for(var n=0;n<8;n++)
{
sHTMLDropMenus+="<td onclick='"+this.oName+".doClick_TabCreate()' onmouseover='doOver_TabCreate()' style='background:#ffffff;font-size:1px;border:#8a867a 1px solid;width:20px;height:20px;' unselectable=on> </td>";
}
sHTMLDropMenus+="</tr>";
}
sHTMLDropMenus+="<tr><td colspan=8 onclick=\""+this.oName+".hide();modelessDialogShow('"+this.scriptPath+"table_insert.htm',300,322);\" onmouseover=\"this.innerText='"+getText("Advanced Table Insert")+"';this.style.border='#777777 1px solid';this.style.backgroundColor='#8d9aa7';this.style.color='#ffffff'\" onmouseout=\"this.style.border='#f3f3f3 1px solid';this.style.backgroundColor='#f3f3f3';this.style.color='#000000'\" align=center style='font-family:verdana;font-size:10px;font-color:black;border:#f3f3f3 1px solid;' unselectable=on>"+getText("Advanced Table Insert")+"</td></tr>";
sHTMLDropMenus+="</table>";
sHTMLIcons+=this.writeIconStandard("btnTable"+this.oName,this.oName+".dropShow(this,dropTableCreate"+this.oName+")","btnTable.gif",getText("Insert Table"));
sHTMLIcons+=this.writeIconStandard("btnTableEdit"+this.oName,this.oName+".dropShow(this,dropTable"+this.oName+")","btnTableEdit.gif",getText("Edit Table/Cell"));
}
break;
case "Guidelines":
if(this.btnGuidelines)sHTMLIcons+=this.writeIconStandard("btnGuidelines"+this.oName,this.oName+".runtimeBorder(true)","btnGuideline.gif",getText("Show/Hide Guidelines"));
break;
case "Absolute":
if(this.btnAbsolute)sHTMLIcons+=this.writeIconStandard("btnAbsolute"+this.oName,this.oName+".makeAbsolute()","btnAbsolute.gif",getText("Absolute"));
break;
case "Characters":
if(this.btnCharacters)sHTMLIcons+=this.writeIconStandard("btnCharacters"+this.oName,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"characters.htm',495,162)","btnSymbol.gif",getText("Special Characters"));
break;
case "Line":
if(this.btnLine)sHTMLIcons+=this.writeIconStandard("btnLine"+this.oName,this.oName+".doCmd('InsertHorizontalRule')","btnLine.gif",getText("Line"));
break;
case "Form":
if(this.btnForm)
{
var arrFormMenu = [[getText("Form"),"form_form.htm","280","177"],
[getText("Text Field"),"form_text.htm","285","289"],
[getText("List"),"form_list.htm","295","332"],
[getText("Checkbox"),"form_check.htm","235","174"],
[getText("Radio Button"),"form_radio.htm","235","177"],
[getText("Hidden Field"),"form_hidden.htm","235","152"],
[getText("File Field"),"form_file.htm","235","132"],
[getText("Button"),"form_button.htm","235","174"]];
sHTMLIcons+=this.writeIconStandard("btnForm"+this.oName,this.oName+".dropShow(this,dropForm"+this.oName+")","btnForm.gif",getText("Form Editor"));
sHTMLDropMenus+="<table id=dropForm"+this.oName+" cellpadding=0 cellspacing=0 "+
"style='z-index:1;display:none;position:absolute;border:#716F64 1px solid;"+
"cursor:default;background-color:#fdfdfd;' unselectable=on>";
for(var j=0;j<arrFormMenu.length;j++)
{
sHTMLDropMenus+="<tr><td onclick=\"modelessDialogShow('"+this.scriptPath + arrFormMenu[j][1]+"',"+arrFormMenu[j][2]+","+arrFormMenu[j][3]+");"+
"dropForm"+this.oName+".style.display='none'\""+
" style=\"padding:2px;padding-top:1px;font-family:Tahoma;font-size:11px;color:black;\" "+
"onmouseover=\"this.style.backgroundColor='#708090';this.style.color='#FFFFFF';\" "+
"onmouseout=\"this.style.backgroundColor='';this.style.color='#000000';\" unselectable=on>"+arrFormMenu[j][0]+"</td></tr>";
}
sHTMLDropMenus+="</table>";
}
break;
case "Clean":
if(this.btnClean)sHTMLIcons+=this.writeIconStandard("btnClean"+this.oName,this.oName+".doClean()","btnRemoveFormat.gif",getText("Clean"));
break;
case "HTMLFullSource":
if(this.btnHTMLFullSource)sHTMLIcons+=this.writeIconStandard("btnHTMLFullSource"+this.oName,"setActiveEditor('"+this.oName+"');"+this.oName+".hide();modalDialogShow('"+this.scriptPath+"source_html_full.htm',800,600);","btnSource.gif",getText("View/Edit Source"));
break;
case "HTMLSource":
if(this.btnHTMLSource)sHTMLIcons+=this.writeIconStandard("btnHTMLSource"+this.oName,"setActiveEditor('"+this.oName+"');"+this.oName+".hide();modalDialogShow('"+this.scriptPath+"source_html.htm',800,600);","btnSource.gif",getText("View/Edit Source"));
break;
case "XHTMLFullSource":
if(this.btnXHTMLFullSource)sHTMLIcons+=this.writeIconStandard("btnXHTMLFullSource"+this.oName,"setActiveEditor('"+this.oName+"');"+this.oName+".hide();modalDialogShow('"+this.scriptPath+"source_xhtml_full.htm',800,600);","btnSource.gif",getText("View/Edit Source"));
break;
case "XHTMLSource":
if(this.btnXHTMLSource)sHTMLIcons+=this.writeIconStandard("btnXHTMLSource"+this.oName,"setActiveEditor('"+this.oName+"');"+this.oName+".hide();modalDialogShow('"+this.scriptPath+"source_xhtml.htm',800,600);","btnSource.gif",getText("View/Edit Source"));
break;
case "ClearAll":
if(this.btnClearAll)sHTMLIcons+=this.writeIconStandard("btnClearAll"+this.oName,this.oName+".clearAll()","btnDelete.gif",getText("Clear All"));
break;
default:
for(j=0;j<this.arrCustomButtons.length;j++)
{
if(sButtonName==this.arrCustomButtons[j][0])
{
sCbName=this.arrCustomButtons[j][0];
//sCbCommand=this.arrCustomButtons[j][1];
sCbCaption=this.arrCustomButtons[j][2];
sCbImage=this.arrCustomButtons[j][3];
sHTMLIcons+=this.writeIconStandard("btn"+sCbName+this.oName,"eval("+this.oName+".arrCustomButtons["+j+"][1])",sCbImage,sCbCaption);
}
}
break;
}
}
var sHTML="";
if(!document.getElementById("id_refresh_z_index"))
sHTML+="<div id=id_refresh_z_index style='margin:0'></div>";
sHTML+="<table id=idArea"+this.oName+" name=idArea"+this.oName+" border=0 "+
"cellpadding=0 cellspacing=0 width='"+this.width+"' height='"+this.height+"'>"+
//"<tr><td colspan=2 bgcolor=#ffffff style=\"padding:1px;border:#cfcfcf 1px solid;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ebebeb);\">"+
"<tr><td colspan=2 style=\"padding:1px;border:#cfcfcf 1px solid;background:url('"+this.scriptPath+"icons/bg.gif')\">"+
"<table cellpadding=0 cellspacing=0><tr><td dir=ltr>"+
sHTMLIcons+
"</td></tr></table>"+
"</td></tr>"+
"<tr id=idTagSelTopRow"+this.oName+"><td colspan=2 id=idTagSelTop"+this.oName+" height=0></td></tr>";
sHTML+="<tr><td colspan=2 valign=top height=100% style='background:white'>";
if(this.IsSecurityRestricted)
sHTML+="<iframe security='restricted' style='width:100%;height:100%;margin-top:1px;' src='"+this.scriptPath+"blank.gif'"+
" name=idContent"+ this.oName + " id=idContent"+this.oName+
" contentEditable=true></iframe>";//prohibit running ActiveX controls
else
sHTML+="<iframe style='width:100%;height:100%;margin-top:1px;' src='"+this.scriptPath+"blank.gif'"+
" name=idContent"+ this.oName + " id=idContent"+this.oName+
" contentEditable=true></iframe>";
//Paste From Word
sHTML+="<iframe style='width:1px;height:1px;overflow:auto;' src='"+this.scriptPath+"blank.gif'"+
" name=idContentWord"+ this.oName +" id=idContentWord"+ this.oName+
" contentEditable=true onfocus='"+this.oName+".hide()'></iframe>";
if(this.css!="")
{
document.write("<iframe id=\"myStyle"+this.oName+"\" name=\"myStyle"+this.oName+"\" src='"+this.scriptPath+"blank.gif' style=\"display:none\"></iframe>");
}
sHTML+="</td></tr>";
sHTML+="<tr id=idTagSelBottomRow"+this.oName+"><td colspan=2 id=idTagSelBottom"+this.oName+"></td></tr>";
sHTML+="</table>";
sHTML+=sHTMLDropMenus;//dropdown
document.write(sHTML);
//Render Color Picker (forecolor)
this.oColor1.url=this.scriptPath+"color_picker_fg.htm";
this.oColor1.onShow = new Function(this.oName+".hide()");
this.oColor1.onMoreColor = new Function(this.oName+".hide()");
this.oColor1.onPickColor = new Function(this.oName+".applyColor('ForeColor',eval('"+this.oName+"').oColor1.color)");
this.oColor1.onRemoveColor = new Function(this.oName+".applyColor('ForeColor','')");
this.oColor1.txtCustomColors=getText("Custom Colors");
this.oColor1.txtMoreColors=getText("More Colors...");
this.oColor1.RENDER();
//Render Color Picker (backcolor)
this.oColor2.url=this.scriptPath+"color_picker_bg.htm";
this.oColor2.onShow = new Function(this.oName+".hide()");
this.oColor2.onMoreColor = new Function(this.oName+".hide()");
this.oColor2.onPickColor = new Function(this.oName+".applyColor('BackColor',eval('"+this.oName+"').oColor2.color)");
this.oColor2.onRemoveColor = new Function(this.oName+".applyColor('BackColor','')");
this.oColor2.txtCustomColors=getText("Custom Colors");
this.oColor2.txtMoreColors=getText("More Colors...");
this.oColor2.RENDER();
if(this.useTagSelector)
{
if(this.TagSelectorPosition=="bottom")this.TagSelectorPosition="top";
else this.TagSelectorPosition="bottom";
this.moveTagSelector()
}
//paste from word temp storage
var oWord=eval("idContentWord"+this.oName);
oWord.document.designMode="on";
oWord.document.open("text/html","replace");
oWord.document.write("<html><head></head><body></body></html>");
oWord.document.close();
oWord.document.body.contentEditable=true;
oUtil.oName=this.oName;//default active editor
oUtil.oEditor=eval("idContent"+this.oName);
oUtil.obj=eval(this.oName);
oUtil.arrEditor.push(this.oName);
var arrA = String(this.preloadHTML).match(/<HTML[^>]*>/ig);
if(arrA)
{//full html
this.loadHTML("");
//this.preloadHTML is required here. Can't use sPreloadHTML as in:
//window.setTimeout(this.oName+".putHTML("+sPreloadHTML+")",0);
window.setTimeout(this.oName+".putHTML("+this.oName+".preloadHTML)",0);
//window.setTimeout utk fix swf loading.
//Utk loadHTML & putHTML yg di SourceEditor tdk masalah
}
else
{
this.loadHTML(sPreloadHTML)
}
if(this.btnTable)
{
this.arrElm[0]=this.getElm("btnTableEdit");
this.arrElm[1]=this.getElm("mnuTableSize");
this.arrElm[2]=this.getElm("mnuTableEdit");
this.arrElm[3]=this.getElm("mnuCellEdit");
}
if(this.btnParagraph)this.arrElm[4]=this.getElm("btnParagraph");
if(this.btnFontName)this.arrElm[5]=this.getElm("btnFontName");
if(this.btnFontSize)this.arrElm[6]=this.getElm("btnFontSize");
if(this.btnCut)this.arrElm[7]=this.getElm("btnCut");
if(this.btnCopy)this.arrElm[8]=this.getElm("btnCopy");
if(this.btnPaste)this.arrElm[9]=this.getElm("btnPaste");
if(this.btnPasteWord)this.arrElm[10]=this.getElm("btnPasteWord");
if(this.btnPasteText)this.arrElm[11]=this.getElm("btnPasteText");
if(this.btnUndo)this.arrElm[12]=this.getElm("btnUndo");
if(this.btnRedo)this.arrElm[13]=this.getElm("btnRedo");
if(this.btnBold)this.arrElm[14]=this.getElm("btnBold");
if(this.btnItalic)this.arrElm[15]=this.getElm("btnItalic");
if(this.btnUnderline)this.arrElm[16]=this.getElm("btnUnderline");
if(this.btnStrikethrough)this.arrElm[17]=this.getElm("btnStrikethrough");
if(this.btnSuperscript)this.arrElm[18]=this.getElm("btnSuperscript");
if(this.btnSubscript)this.arrElm[19]=this.getElm("btnSubscript");
if(this.btnNumbering)this.arrElm[20]=this.getElm("btnNumbering");
if(this.btnBullets)this.arrElm[21]=this.getElm("btnBullets");
if(this.btnJustifyLeft)this.arrElm[22]=this.getElm("btnJustifyLeft");
if(this.btnJustifyCenter)this.arrElm[23]=this.getElm("btnJustifyCenter");
if(this.btnJustifyRight)this.arrElm[24]=this.getElm("btnJustifyRight");
if(this.btnJustifyFull)this.arrElm[25]=this.getElm("btnJustifyFull");
if(this.btnIndent)this.arrElm[26]=this.getElm("btnIndent");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -