' +
'
' +
'' +
'' +
' ';
f.document.open("text/html","replace");
f.document.write(html);
f.document.close();
f.document.designMode="on";
if(!gIsIE)
f.document.execCommand("useCSS",false, true);
}catch(exp){}
fixEditor = function(){
try{
parent.MM["compose"].fixEditor( window );
// parent.hideEditorMenu = fHideMenu;
parent.CC.hideMsg();
// parent.EV.observe(parent.document, "click", fHideMenu);
}catch(exp){
window.setTimeout("fixEditor()", 1000);
}
};
fixEditor();
gLoaded = true;
// fSetEditable();
try{
fSetFrmClick();
}catch(exp){}
//調(diào)用父窗口方法,兼容此處生成代碼產(chǎn)生的錯(cuò)誤2015.12.17
try{
parent.InitContent();
}catch(exp){}
}
/**
* 設(shè)置文字顏色
*/
function fSetColor(){
var dvForeColor =$("dvForeColor");
if(dvForeColor.getElementsByTagName("TABLE").length == 1){
dvForeColor.innerHTML = drawCube() + dvForeColor.innerHTML;
}
}
/**
* 設(shè)置mousemove事件
*/
document.onmousemove = function(e){
if(gIsIE) var el = event.srcElement;
else var el = e.target;
var tdView = $("tdView");
var tdColorCode = $("tdColorCode");
if(el.tagName == "IMG"){
try{
if(fInObj(el, "dvForeColor")){
tdView.bgColor = el.parentNode.bgColor;
tdColorCode.innerHTML = el.parentNode.bgColor
}
}catch(e){}
}
}
/**
* 判斷el對(duì)象是否在另一個(gè)節(jié)點(diǎn)里
*/
function fInObj(el, id){
if(el){
if(el.id == id){
return true;
}else{
if(el.parentNode){
return fInObj(el.parentNode, id);
}else{
return false;
}
}
}
}
/**
* 顯示對(duì)象
*/
function fDisplayObj(id){
var o = $(id);
if(o) o.style.display = "";
}
/**
* 設(shè)置onclick事件
*/
document.onclick = function(e){
if(gIsIE) var el = event.srcElement;
else var el = e.target;
var dvForeColor =$("dvForeColor");
var dvPortrait =$("dvPortrait");
if(el.tagName == "IMG"){
try{
if(fInObj(el, "dvForeColor")){
format(gSetColorType, el.parentNode.bgColor);
dvForeColor.style.display = "none";
return;
}
}catch(e){}
try{
if(fInObj(el, "dvPortrait")){
format("InsertImage", el.src);
dvPortrait.style.display = "none";
return;
}
}catch(e){}
}
fHideMenu();
var hideId = "";
if(el.id == "aGetSysSignList"){
hideId = "dvSignList";
parent.$(hideId).style.display = "";
}else if(el.id == "imgStationery"){
try{
parent.LetterPaper.control(window, "show");
}catch(exp){}
}else if(arrMatch[el.id]){
hideId = arrMatch[el.id];
fDisplayObj(hideId);
}
}
var arrMatch = {
imgFontface:"fontface",
imgFontsize:"fontsize",
imgFontColor:"dvForeColor",
imgBackColor:"dvForeColor",
imgFace:"dvPortrait",
imgAlign:"divAlign",
imgList:"divList",
imgSign:"dvSign",
aGetSysSignList:"dvSignList",
imgInOut:"divInOut"
}
/**
* 執(zhí)行格式化顯示
*/
function format(type, para){
var f = window.frames["HtmlEditor"];
var sAlert = "";
if(!gIsIE){
switch(type){
case "Cut":
sAlert = "您的瀏覽器安全設(shè)置不允許編輯器自動(dòng)執(zhí)行剪切操作,請(qǐng)使用鍵盤(pán)快捷鍵(Ctrl+X)來(lái)完成";
break;
case "Copy":
sAlert = "您的瀏覽器安全設(shè)置不允許編輯器自動(dòng)執(zhí)行拷貝操作,請(qǐng)使用鍵盤(pán)快捷鍵(Ctrl+C)來(lái)完成";
break;
case "Paste":
sAlert = "您的瀏覽器安全設(shè)置不允許編輯器自動(dòng)執(zhí)行粘貼操作,請(qǐng)使用鍵盤(pán)快捷鍵(Ctrl+V)來(lái)完成";
break;
}
}
if(sAlert != ""){
alert(sAlert);
return;
}
f.focus();
if(!para){
if(gIsIE){
f.document.execCommand(type);
}else{
f.document.execCommand(type,false,false);
}
}else{
f.document.execCommand(type,false,para);
}
f.focus();
}
/**
* 轉(zhuǎn)換編輯模式
*/
function setMode(bStatus){
var sourceEditor = $("sourceEditor");
var HtmlEditor = $("HtmlEditor");
var divEditor = $("divEditor");
var f = window.frames["HtmlEditor"];
var body = f.document.getElementsByTagName("BODY")[0];
if(bStatus){
sourceEditor.style.display = "";
divEditor.style.display = "none";
sourceEditor.value = body.innerHTML;
}else{
sourceEditor.style.display = "none";
divEditor.style.display = "";
body.innerHTML = sourceEditor.value;
}
}
/**
* 設(shè)置字體顏色
*/
function foreColor(e) {
fDisplayColorBoard(e);
gSetColorType = "foreColor";
}
/**
* 設(shè)置背景色
*/
function backColor(e){
var sColor = fDisplayColorBoard(e);
if(gIsIE)
gSetColorType = "backcolor";
else
gSetColorType = "backcolor";
}
/**
* 顯示顏色拾取器
*/
function fDisplayColorBoard(e){
if(gIsIE){
var e = window.event;
}
if(gIEVer<=5.01 && gIsIE){
var arr = showModalDialog("/a/f/js3/ColorSelect.htm", "", "font-family:Verdana; font-size:12; status:no; dialogWidth:21em; dialogHeight:21em");
if (arr != null) return arr;
return;
}
var dvForeColor =$("dvForeColor");
// fSetColor();
var iX = e.clientX;
var iY = e.clientY;
dvForeColor.style.display = "";
dvForeColor.style.left = (iX-30) + "px";
dvForeColor.style.top = gToolbarStatus?59 + "px":33 + "px";
// EV.stopEvent();
return true;
}
window.onerror = function(){return true;}
/**
* 創(chuàng)建鏈接
*/
function createLink() {
var sURL=window.prompt("請(qǐng)輸入鏈接 (如:http://www.163.com/):", "http://");
if ((sURL!=null) && (sURL!="http://")){
format("CreateLink", sURL);
}
}
/**
* 創(chuàng)建圖片
*/
function createImg() {
var sPhoto=prompt("請(qǐng)輸入圖片位置:", "http://");
if ((sPhoto!=null) && (sPhoto!="http://")){
format("InsertImage", sPhoto);
}
}
/**
* 添加表情
*/
function addPortrait(e){
if(gIEVer<=5.01 && gIsIE || 1==1){
// var imgurl = showModalDialog("portraitSelect.htm","", "font-family:Verdana; font-size:12; status:no; unadorned:yes; scroll:no; resizable:yes;dialogWidth:358px; dialogHeight:232px");
// if (imgurl != null) format("InsertImage", imgurl);
var dvPortrait =$("dvPortrait");
if(dvPortrait){
dvPortrait.parentNode.removeChild(dvPortrait);
}
var div = document.createElement("DIV");
div.style.position = "absolute";
div.style.zIndex = "9";
div.id = "dvPortrait";
var iX = e.clientX;
div.style.top = gToolbarStatus?59 + "px":33 + "px";
div.style.left = (iX-180) + "px";
div.innerHTML = '