📄 webhtmleditor.txt.exclude
字号:
this.customContextMenuObjectArray[j]=null;
}
for (var pro in this )
{
if (typeof(this[pro]) != "function")this[pro]=null;
}
} ;
ContextMenusManager.prototype.ExecuteCommand= function (command,oTool)
{
oTool.SetState(WHECOMMAND_STATE_DISABLED);
this.Popup.Hide();
this.Editor.ExecuteCommand(command,this );
} ;
ContextMenusManager.prototype.GetSelectedValue= function ()
{
var value=this.selectedValue;
this.selectedValue=null;
return value;
} ;
ContextMenusManager.prototype.ShowContextMenu= function (e)
{
if (!this.IsCreate)
{
this.Create();
this.IsCreate= true;
}
var srcElement=e.srcElement?e.srcElement:e.target;
var srcElement_tagName=srcElement.tagName;
var customContextMenuObject=this.customContextMenuObjectArray[srcElement_tagName];
if ("TH" == srcElement_tagName&&!customContextMenuObject)
{
customContextMenuObject=this.customContextMenuObjectArray["TD"];
}
var tagName="";
if (!customContextMenuObject)
{
var parent=GetSrcElementByTagName(srcElement,"A");
if (!parent)
{
parent=GetSrcElementByTagName(srcElement,"TD");
}
if (!parent)
{
parent=GetSrcElementByTagName(srcElement,"TABLE");
}
if (parent)
{
tagName=parent.tagName;
srcElement=parent;
}
else
{
tagName="*";
}
customContextMenuObject=this.customContextMenuObjectArray[tagName];
}
if (customContextMenuObject)
{
this.selectedValue=srcElement;
if ("*" == tagName)
{
this.Editor.SetToolState(customContextMenuObject.oToolList);
var state=customContextMenuObject.oToolList[2].GetState();
for (var i=2; i<customContextMenuObject.oToolList.length; i++)
{
customContextMenuObject.oToolList[i].SetState(state, true);
}
}
else
{
for (var i=0; i<customContextMenuObject.oToolList.length; i++)
{
customContextMenuObject.oToolList[i].SetState(WHECOMMAND_STATE_OFF, true);
}
}
BPopupsManager.SetPopupBodyHtmlElement(customContextMenuObject.Table);
BPopupsManager.ShowContextMenu(e,customContextMenuObject.Width,customContextMenuObject.Height,this.Editor.Body);
}
else
{
if (!this.IsIE)
{
BPopupsManager.Hide();
e.preventDefault();
}
return false;
}
} ;
lionsky.prototype.OnLoad= function (flag)
{
var list=new Array("%","<",">","!","\"","#","$","&","'","(",")",",",":",";","=","?","[","\\","]","^","`","{","|","}","~","+");
if (flag)
{
var html=this.GetHtml();
if (this.FullPage)
{
var HTMLElem=this.Document["getElementsByTagName"]("HTML")[0];
var BODYElem=this.Document["getElementsByTagName"]("BODY")[0];
BODYElem["removeAttribute"]("contentEditable");
var className=BODYElem.className.toLowerCase();
if ("radecontentbordered" == className||"radecontent" == className)
{
BODYElem["removeAttribute"]("class");
}
var HEADElem=this.Document["getElementsByTagName"]("HEAD")[0];
if (HEADElem)
{
var HEADLinkElemArray=this.Document["getElementsByTagName"]("LINK");
for (var i=0; i<HEADLinkElemArray.length; i++)
{
HEADLinkElemArray[i].parentNode.removeChild(HEADLinkElemArray[i]);
}
}
html=("<html>"+HTMLElem.innerHTML+"</html>");
}
try
{
html=this.FiltersManager.GetHtmlContent(html);
}
catch (e){ ; }
for (var i=0; i<list.length; i++)
{
html=html.replace(new RegExp("\x5c\x78"+list[i].charCodeAt(0).toString(020),"\x69\x67"),"\x25"+list[i].charCodeAt(0).toString(020));
}
this.WheContentTextarea["value"]="";
this.WheContentHiddenTextArea["value"]=html;
}
else
{
var html=this.WheContentHiddenTextArea["value"];
for (var i=list.length-1; i>=0; i--)
{
html=html.replace(new RegExp("\x25"+list[i].charCodeAt(0).toString(020),"ig"),list[i]);
}
try
{
html=this.FiltersManager.GetDesignContent(html);
}
catch (e){ ; }
this.WheContentHiddenTextArea["value"]=html;
}
} ;
lionsky.prototype.SelectDom= function (elem,fireEvent)
{
if (CreateElemContainer(this.ContentWindow,elem)&& false != fireEvent)
{
this.ExecSystemEvent(WHEEVENT_SEL_CHANGED,null);
}
} ;
lionsky.prototype.GetImagePath = function (imageName)
{
return (this.ThemePath+"/Images/ButtonImage/"+imageName);
} ;
lionsky.prototype.GetCustomToolbarButton = function (command, controller, documents, imagePath, dropDownImageUseShowTitleText,showTitleText, dropDownImageShowTitleTextPlaced)
{
if (!controller)
{
controller=this ;
}
if (!documents)
{
documents=this.Document;
}
var resourcesText=this.LocalResources[command];
if (!resourcesText)
{
resourcesText=command;
}
if ( false != dropDownImageUseShowTitleText)
{
if (!imagePath)
{
imagePath=this.GetImagePath(command+".gif");
}
}
var oTool=new Object();
oTool.Controller=controller;
oTool.Document=documents;
oTool.Name=command;
oTool.Title=resourcesText;
oTool.ImagePath=imagePath;
oTool.DropDownImageUseShowTitleText=( false == dropDownImageUseShowTitleText? false : true);
oTool.ShowTitleText=( false == showTitleText? false : true);
oTool.DropDownImageShowTitleTextPlaced=dropDownImageShowTitleTextPlaced;
toolBarButton=new WebHtmlEditorToolButton(oTool);
toolBarButton.Create();
return toolBarButton;
} ;
function GetSrcElementByTagName(srcElement,tagName)
{
if (null == srcElement)
{
return null;
}
if (null == tagName)
{
return srcElement;
}
try
{
while (srcElement&&null != srcElement.tagName&&srcElement.tagName != tagName)
{
srcElement=srcElement.parentNode;
}
return ((srcElement.tagName == tagName)?srcElement:null);
}
catch (e){return null; }
}
lionsky.prototype.SetToolState= function (oToolArray)
{
var oTool=null;
var systemCommand=null;
var contentWindow=this.ContentWindow;
for (var i=0; i<oToolArray.length; i++)
{
oTool=oToolArray[i];
var buttonName=oTool.Name;
systemCommand=WHEEditorCommandEventList[buttonName];
if (buttonName == WHECOMMAND_UNDO)
{
oTool.SetState(this.History.GetUndoState());
}
else if (buttonName == WHECOMMAND_REDO)
{
oTool.SetState(this.History.GetRedoState());
}
else if (buttonName == WHECOMMAND_REPLACELASTCOMMAND)
{
oTool.SetState(this.History.CheckLastHistoryIsNotNull()?WHECOMMAND_STATE_OFF:WHECOMMAND_STATE_DISABLED);
}
else if (oTool.SetState&&systemCommand&&systemCommand.GetState)
{
oTool.SetState(systemCommand.GetState(contentWindow));
}
if (oTool.AlwayCheckEvent)
{
oTool.AlwayCheckEvent(systemCommand.AlwayCheckEvent(contentWindow));
oTool=systemCommand=null;
}
}
} ;
lionsky.prototype.RegisterKey= function (command,shortCutKey)
{
if (this.KeyObject)
{
this.KeyObject.Register(command, shortCutKey);
}
} ;
lionsky.prototype.RegisterPrototype= function (command, eventFunction)
{
if (!eventFunction)
{
return;
}
else
{
this[command]=eventFunction;
}
};
lionsky.prototype.PasteHtml= function (content,title,select,isSetState)
{
if (VIEW_MODE == this.CurrMode){return; }
if (EDIT_MODE == this.CurrMode)
{
this.SetFocus();
this.SaveHistory(new WebHtmlEditorObjectEventHandle(title,this.ContentWindow,content,select));
if (isSetState != false){this.ExecSystemEvent(WHEEVENT_SEL_CHANGED,null); }
}
else if (CODE_MODE == this.CurrMode)
{
if (this.IsIE)
{
this.WheContentTextarea.setActive();
var createRange=document.selection.createRange();
createRange.text=content;
}
else
{
var contentTextarea=this.WheContentTextarea;
if (contentTextarea.ATO)
{
var selectionStart=contentTextarea.selectionStart;
var selectionEnd=contentTextarea.selectionEnd;
var str=contentTextarea["value"].substring(selectionStart,selectionEnd);
contentTextarea["value"]=contentTextarea["value"].substring(0,selectionStart)+content+contentTextarea["value"].substring(selectionEnd);
contentTextarea.ATO(selectionStart+content.length,selectionStart+content.length);
this.SetFocus();
return false;
}
}
}
} ;
lionsky.prototype.GetPlacedToolBarHtmlElement= function (place)
{
var placeElem=null;
if (place)
{
str=place.toLowerCase();
switch (str)
{
case "top":
placeElem=this.DockingZone.Top;
break;
case "left":
placeElem=this.DockingZone.Left;
break;
case "right":
placeElem=this.DockingZone.Right;
break;
case "bottom":
placeElem=this.DockingZone.Bottom;
break;
case "module":
placeElem=this.DockingZone.Module;
break;
default:
placeElem=document["getElementById"](place);
break;
}
}
return placeElem;
};
function CancelEvent(e)
{
e.returnValue= false;
e.cancelBubble= true;
if (e.stopPropagation)
{
e.stopPropagation();
}
return false;
}
function AddArrayListAtLast(array,item)
{
array[array.length]=item;
} ;
lionsky.prototype.FontSizeArray=[1,2,3,4,5,6,7];
lionsky.prototype.CheckPlacedToolBarHtmlElementIsVertical= function (elem)
{
if (!elem)
{
return null;
}
var dockingMode = elem["getAttribute"]("DockingMode");
if (dockingMode&&"Vertical" == dockingMode)
{
return true;
}
};
lionsky.prototype.GetRuleArrayByDocument= function (doc)
{
if (null == doc)
{
doc=document;
}
var BCCM=BCssClassManager();
var ruleArray = BCCM.InitializeDocumentRules(doc);
return ruleArray;
} ;
lionsky.prototype.RegisterDockableObject= function (dockableObject,allowShowDragHelper,attachDragHelperProperty,attachDragResizeProperty, effectsUpdateRate, effectsDuration, effectsEnable)
{
if(this.DockingManager)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -