📄 webhtmleditor.txt.exclude
字号:
var WebHtmlEditorGlobalArray = [];
function ll2(id, runTimeSystemFilePath, themePath, width, height, license, upLoadImagesPaths, upLoadImagesFilter, upLoadImagesSize, upLoadImagesAllowUpLoadSize, upLoadFlashPaths, upLoadFlashFilter, upLoadFlashSize, upLoadFlashAllowUpLoadSize, upLoadMediaPaths, upLoadMediaFilter, upLoadMediaSize, upLoadMediaAllowUpLoadSize, upLoadOtherFilePaths, upLoadOtherFileFilter, upLoadOtherFileSize, upLoadOtherFileAllowUpLoadSize, upLoadTemplatePaths, upLoadTemplateFilter, upLoadTemplateSize, upLoadTemplateAllowUpLoadSize, emotPath, emotArray, licenseKey, useCommonToolbar, toolsOnPage, toolBarOnPageWidth, toolBarOnPageHeight, showAddColorOption, toolBarCollection, enableContextMenus, enableTab, convertFontTagsToSpanTags, convertTagsToLower, allowScript, stripAbsoluteLinkPaths, stripAbsoluteImagesPaths, linkPathToStrip, imagesPathToStrip, stripFormattingOnPaste, showEditMode, showViewMode, showHeightenButton, showMinishButton, upLoadImages_EnabledNewFolder, upLoadImages_EnabledDelete, upLoadImages_EnabledUpLoad, upLoadFlash_EnabledNewFolder, upLoadFlash_EnabledDelete, upLoadFlash_EnabledUpLoad, upLoadMedia_EnabledNewFolder, upLoadMedia_EnabledDelete, upLoadMedia_EnabledUpLoad, upLoadOtherFile_EnabledNewFolder, upLoadOtherFile_EnabledDelete, upLoadOtherFile_EnabledUpLoad, upLoadTemplate_EnabledNewFolder, upLoadTemplate_EnabledDelete, upLoadTemplate_EnabledUpLoad, version, currentCulture, onClientUpLoadImagesEnd, onClientLoad, onClientCommandExecuting, onClientCommandExecuted, onClientModeChange, enabledThumbnailImage, onClientUpLoadFlashEnd, onClientUpLoadMediaEnd, onClientUpLoadOtherFileEnd, onClientUpLoadTemplateEnd, copyStyleToFormatBlockTool, useWebHtmlEditorDialog, convertHtmlToXhtmlFilter, onLoadFocus, showBorder, moduleArrayString)
{
WebHtmlEditor = new lionsky(id);
WebHtmlEditor.KeyObject = new KeyObject();
WebHtmlEditor.RunTimeSystemFilePath = runTimeSystemFilePath;
WebHtmlEditor.DefaultStyle = themePath;
WebHtmlEditor.ThemePath = WebHtmlEditor.RunTimeSystemFilePath + "Theme/" + themePath;
WebHtmlEditor.EmotPath = emotPath;
WebHtmlEditor.EmotArray = eval(emotArray);
WebHtmlEditor.Width = width?width:"450px";
WebHtmlEditor.Height = height?height:"400px";
WebHtmlEditor.LicenseKey = licenseKey;
WebHtmlEditor.UseCommonToolbar= useCommonToolbar != null?useCommonToolbar: false;
WebHtmlEditor.ToolBarArrayArg = toolBarCollection;
WebHtmlEditor.ToolBarOnPageWidth=toolBarOnPageWidth?toolBarOnPageWidth:this.Width;
WebHtmlEditor.ToolBarOnPageHeight=toolBarOnPageHeight?toolBarOnPageHeight: "";
WebHtmlEditor.ShowAddColorOption=showAddColorOption?showAddColorOption: false;
WebHtmlEditor.StripFormattingOnPaste = stripFormattingOnPaste;
WebHtmlEditor.ToolsOnPage = toolsOnPage?toolsOnPage: false;
WebHtmlEditor.ShowEditMode = showEditMode;
WebHtmlEditor.ShowViewMode = showViewMode;
WebHtmlEditor.ShowHeightenButton = showHeightenButton;
WebHtmlEditor.ShowMinishButton = showMinishButton;
WebHtmlEditor.Version = version;
WebHtmlEditor.CurrentCulture = currentCulture;
WebHtmlEditor.OnLoadFocus = onLoadFocus;
WebHtmlEditor.License = "";
WebHtmlEditor.ConvertFontTagsToSpanTags = convertFontTagsToSpanTags?convertFontTagsToSpanTags:false;
WebHtmlEditor.ConvertTagsToLower = convertTagsToLower?convertTagsToLower:false;
WebHtmlEditor.AllowScript = allowScript?allowScript:false;
WebHtmlEditor.StripAbsoluteLinkPaths = stripAbsoluteLinkPaths?stripAbsoluteLinkPaths:false;
WebHtmlEditor.StripAbsoluteImagesPaths = stripAbsoluteImagesPaths?stripAbsoluteImagesPaths:false;
WebHtmlEditor.ConvertHtmlToXhtmlFilter = convertHtmlToXhtmlFilter;
WebHtmlEditor.EnabledThumbnailImage = enabledThumbnailImage;
WebHtmlEditor.UseClassicDialogs=( true != useWebHtmlEditorDialog);
WebHtmlEditor.LinkPathToStrip = linkPathToStrip;
WebHtmlEditor.ImagesPathToStrip = imagesPathToStrip;
WebHtmlEditor.UpLoadImagesPaths = upLoadImagesPaths;
WebHtmlEditor.UpLoadImagesFilter = upLoadImagesFilter;
WebHtmlEditor.UpLoadImagesSize = upLoadImagesSize;
WebHtmlEditor.UpLoadImagesAllowUpLoadSize = upLoadImagesAllowUpLoadSize;
WebHtmlEditor.UpLoadImagesEnabledNewFolder = upLoadImages_EnabledNewFolder;
WebHtmlEditor.UpLoadImagesEnabledDelete = upLoadImages_EnabledDelete;
WebHtmlEditor.UpLoadImagesEnabledUpLoad = upLoadImages_EnabledUpLoad;
WebHtmlEditor.UpLoadFlashPaths = upLoadFlashPaths;
WebHtmlEditor.UpLoadFlashFilter = upLoadFlashFilter;
WebHtmlEditor.UpLoadFlashSize = upLoadFlashSize;
WebHtmlEditor.UpLoadFlashAllowUpLoadSize = upLoadFlashAllowUpLoadSize;
WebHtmlEditor.UpLoadFlashEnabledNewFolder = upLoadFlash_EnabledNewFolder;
WebHtmlEditor.UpLoadFlashEnabledDelete = upLoadFlash_EnabledDelete;
WebHtmlEditor.UpLoadFlashEnabledUpLoad = upLoadFlash_EnabledUpLoad;
WebHtmlEditor.UpLoadMediaPaths = upLoadMediaPaths;
WebHtmlEditor.UpLoadMediaFilter = upLoadMediaFilter;
WebHtmlEditor.UpLoadMediaSize = upLoadMediaSize;
WebHtmlEditor.UpLoadMediaAllowUpLoadSize = upLoadMediaAllowUpLoadSize;
WebHtmlEditor.UpLoadMediaEnabledNewFolder = upLoadMedia_EnabledNewFolder;
WebHtmlEditor.UpLoadMediaEnabledDelete = upLoadMedia_EnabledDelete;
WebHtmlEditor.UpLoadMediaEnabledUpLoad = upLoadMedia_EnabledUpLoad;
WebHtmlEditor.UpLoadOtherFilePaths = upLoadOtherFilePaths;
WebHtmlEditor.UpLoadOtherFileFilter = upLoadOtherFileFilter;
WebHtmlEditor.UpLoadOtherFileSize = upLoadOtherFileSize;
WebHtmlEditor.UpLoadOtherFileAllowUpLoadSize = upLoadOtherFileAllowUpLoadSize;
WebHtmlEditor.UpLoadOtherFileEnabledNewFolder = upLoadOtherFile_EnabledNewFolder;
WebHtmlEditor.UpLoadOtherFileEnabledDelete = upLoadOtherFile_EnabledDelete;
WebHtmlEditor.UpLoadOtherFileEnabledUpLoad = upLoadOtherFile_EnabledUpLoad;
WebHtmlEditor.UpLoadTemplatePaths = upLoadTemplatePaths;
WebHtmlEditor.UpLoadTemplateFilter = upLoadTemplateFilter;
WebHtmlEditor.UpLoadTemplateSize = upLoadTemplateSize;
WebHtmlEditor.UpLoadTemplateAllowUpLoadSize = upLoadTemplateAllowUpLoadSize;
WebHtmlEditor.UpLoadTemplateEnabledNewFolder = upLoadTemplate_EnabledNewFolder;
WebHtmlEditor.UpLoadTemplateEnabledDelete = upLoadTemplate_EnabledDelete;
WebHtmlEditor.UpLoadTemplateEnabledUpLoad = upLoadTemplate_EnabledUpLoad;
var className;
WebHtmlEditor.ShowBorder=showBorder != null?showBorder: true;
WebHtmlEditor.ContentAreaCssClass = className?className: "WheContent";
eval(" var LR = LocalResources;");
WebHtmlEditor.LocalResources = LR;
//
WebHtmlEditor.WheWrapperTable = document["getElementById"]("WheWrapper" + id);
WebHtmlEditor.WheWrapperTable["removeAttribute"]("style",0);
WebHtmlEditor.WheWrapperTable.className = "WheWrapperTable";
WebHtmlEditor.WheWrapperTable.style["height"] = WebHtmlEditor.Height?WebHtmlEditor.Height:"350px";
WebHtmlEditor.WheWrapperTable.style["width"] = WebHtmlEditor.Width?WebHtmlEditor.Width:"550px";
WebHtmlEditor.WheContentHiddenTextArea = document["getElementById"](id);
WebHtmlEditor.WheContentHiddenTextArea.style.display="none";
WebHtmlEditor.WheContentTextarea = document["getElementById"]("WheContentTextArea"+id);
WebHtmlEditor.WheContentTextarea["removeAttribute"]("rows",0);
WebHtmlEditor.WheContentTextarea["removeAttribute"]("cols",0);
WebHtmlEditor.WheStateBar = document["getElementById"]("WheStateBar" + id);
WebHtmlEditor.WheTopDiv = document["getElementById"]("WheTopDiv"+id);
WebHtmlEditor.History = new HistorysManager(WebHtmlEditor);
if (WebHtmlEditor.IsIE)
{
WebHtmlEditor.WhePasteContainer=document["getElementById"]("WhePasteContainer"+id);
WebHtmlEditor.WhePasteContainer.contentEditable= true;
}
WebHtmlEditor.DockingZone = new Object();
var dockZoone=WebHtmlEditor.DockingZone;
dockZoone.Top=document["getElementById"]("WheTop"+id);
dockZoone.Left=document["getElementById"]("WheLeft"+id);
dockZoone.Right=document["getElementById"]("WheRight"+id);
dockZoone.Bottom=document["getElementById"]("WheBottom"+id);
dockZoone.Module=document["getElementById"]("WheModuleHolder"+id);
if (dockZoone.Top)
{
dockZoone.Top["setAttribute"]("DockingMode","Horizontal");
}
if (dockZoone.Left)
{
dockZoone.Left["setAttribute"]("DockingMode","Vertical");
}
if (dockZoone.Right)
{
dockZoone.Right["setAttribute"]("DockingMode","Vertical");
}
if (dockZoone.Bottom)
{
dockZoone.Bottom["setAttribute"]("DockingMode","Horizontal");
}
if (dockZoone.Module)
{
dockZoone.Module["setAttribute"]("DockingMode","Horizontal");
}
//
WebHtmlEditor.ModeButton = new WebHtmlEditorModeButtonManage(WebHtmlEditor);
//
if (onClientLoad && typeof(onClientLoad)=="string")
{
WebHtmlEditor.RegisterPrototype("OnClientLoad", eval(onClientLoad));
}
if (onClientCommandExecuting && typeof(onClientCommandExecuting)=="string")
{
WebHtmlEditor.RegisterPrototype("OnClientCommandExecuting", eval(onClientCommandExecuting));
}
if (onClientCommandExecuted && typeof(onClientCommandExecuted)=="string")
{
WebHtmlEditor.RegisterPrototype("OnClientCommandExecuted", eval(onClientCommandExecuted));
}
if (onClientModeChange && typeof(onClientModeChange)=="string")
{
WebHtmlEditor.RegisterPrototype("OnClientModeChange", eval(onClientModeChange));
}
if(onClientUpLoadImagesEnd && typeof(onClientUpLoadImagesEnd)=="string")
{
WebHtmlEditor.OnClientUpLoadImagesEnd = eval(onClientUpLoadImagesEnd);
}
if(onClientUpLoadFlashEnd && typeof(onClientUpLoadFlashEnd)=="string")
{
WebHtmlEditor.OnClientUpLoadFlashEnd = eval(onClientUpLoadFlashEnd);
}
if(onClientUpLoadMediaEnd && typeof(onClientUpLoadMediaEnd)=="string")
{
WebHtmlEditor.OnClientUpLoadMediaEnd = eval(onClientUpLoadMediaEnd);
}
if(onClientUpLoadOtherFileEnd && typeof(onClientUpLoadOtherFileEnd)=="string")
{
WebHtmlEditor.OnClientUpLoadOtherFileEnd = eval(onClientUpLoadOtherFileEnd);
}
if(onClientUpLoadTemplateEnd && typeof(onClientUpLoadTemplateEnd)=="string")
{
WebHtmlEditor.OnClientUpLoadTemplateEnd = eval(onClientUpLoadTemplateEnd);
}
WebHtmlEditor.RegisterDockingZone();
WebHtmlEditor.RegisterKey(WHECOMMAND_HELP,"F1");
WebHtmlEditor.RegisterKey(WHECOMMAND_UNDO,"CTRL+Z");
WebHtmlEditor.RegisterKey(WHECOMMAND_REDO,"CTRL+Y");
WebHtmlEditor.RegisterKey(WHECOMMAND_BOLD,"CTRL+B");
WebHtmlEditor.RegisterKey(WHECOMMAND_SELECT_ALL,"CTRL+A");
WebHtmlEditor.RegisterKey(WHECOMMAND_ITALIC,"CTRL+I");
WebHtmlEditor.RegisterKey(WHECOMMAND_UNDERLINE,"CTRL+U");
WebHtmlEditor.RegisterKey(WHECOMMAND_COPY,"CTRL+C");
WebHtmlEditor.RegisterKey(WHECOMMAND_PASTE,"CTRL+V");
WebHtmlEditor.RegisterKey(WHECOMMAND_CUT,"CTRL+X");
WebHtmlEditor.RegisterKey(WHECOMMAND_SHOW_LINK_DIALOG,"CTRL+K");
WebHtmlEditor.RegisterKey(WHECOMMAND_COPY,"CTRL+INS");
WebHtmlEditor.RegisterKey(WHECOMMAND_SHOW_FIND_DIALOG,"CTRL+F");
WebHtmlEditor.RegisterKey(WHECOMMAND_SHOW_IMAGE_DIALOG,"CTRL+G");
WebHtmlEditor.RegisterKey(WHECOMMAND_TOGGLE_SCREEN_MODE,"F11");
if (WebHtmlEditor.IsIE)
{
WebHtmlEditor.RegisterKey(WHECOMMAND_ENTER,"ENTER");
WebHtmlEditor.RegisterKey(WHECOMMAND_SHIFTENTER,"SHIFT+ENTER");
WebHtmlEditor.RegisterKey(WHECOMMAND_INSERT_PARAGRAPH,"CTRL+ENTER");
}
WebHtmlEditor.EnableTab = enableTab;
if (WebHtmlEditor.EnableTab)
{
WebHtmlEditor.RegisterKey(WHECOMMAND_ENABLETAB,"TAB");
}
WebHtmlEditor.WheMainTable=document["getElementById"]("WheWrapper"+id);
WebHtmlEditor.ToolBarManager = new ToolBarsManager(WebHtmlEditor);
WebHtmlEditor.OnLoad( false);
Util_AddStyleSheet(WebHtmlEditor.ThemePath +"/WebHtmlEditor.css", document);
var div = document["getElementById"]("WheContentDiv"+id);
var iframe = document["getElementById"]("WheContentIframe" + id);
if(true)
{
if (div)
{
div.style.display="none";
}
WebHtmlEditor.EditArea = iframe;
var tempdocument = WebHtmlEditor.EditArea.contentWindow.document;
var headString = "<head><style></style></head><body></body>";
var strHiddenText = WebHtmlEditor.WheContentHiddenTextArea["value"];
if (strHiddenText.toLowerCase().indexOf("<html>") != -1)
{
headString = strHiddenText;
WebHtmlEditor.FullPage= true;
}
tempdocument.open();
tempdocument.write(headString);
tempdocument.close();
WebHtmlEditor.ContentWindow=WebHtmlEditor.EditArea.contentWindow;
WebHtmlEditor.Document=WebHtmlEditor.EditArea.contentWindow.document;
WebHtmlEditor.Body=WebHtmlEditor.Document.body;
WebHtmlEditor.Body.className = "WheContentBordered";
Util_AddStyleSheet(WebHtmlEditor.ThemePath +"/EditorArea.css", WebHtmlEditor.Document);
if (Util_DetectBrowser("safari"))
{
WebHtmlEditor.EditArea.style["height"]=WebHtmlEditor.Height;
WebHtmlEditor.FullPage= true;
}
}
else
{
WebHtmlEditor.EditArea = div;
WebHtmlEditor.Body = div;
WebHtmlEditor.Document=document;
WebHtmlEditor.ContentWindow=window;
if (iframe)
{
iframe.style.display="none";
}
}
WebHtmlEditor.CreateEditAreaEvent();
WebHtmlEditor.WheContentHiddenTextArea["setAttribute"]("id",WebHtmlEditor.Id);
WebHtmlEditor.SetCurrentModeEditAreaValue();
//
var BCCM=BCssClassManager();
BCCM.AddStyleSheet(WebHtmlEditor.ThemePath +"/EditorArea.css", WebHtmlEditor.Document);
if(copyStyleToFormatBlockTool)
{
BCCM.Copy(document, WebHtmlEditor.Document);
}
WebHtmlEditor.SetBodyShowBorder();
/*
模块设置
var moduleObject =
[
['WebHtmlEditorStatistics','Bottom',true, true, 50, 0.33,true],
['WebHtmlEditorViewDom','Module',true, true, 50, 0.33,true],
['WebHtmlEditorViewRuntimeHtml','Module',true, true, 50, 0.33,true],
['WebHtmlEditorPropertyInspector','Module',false, true, 50, 0.33,true]
];
[
['WebHtmlEditorViewDom',Bottom, 1,true, true, 50, 0.33, true],
['WebHtmlEditorPropertyInspector',Right, 3, false, true, 50, 0.33, true]
]
*/
WebHtmlEditor.ModuleObject = eval(moduleArrayString);
var moduleObjectLen=WebHtmlEditor.ModuleObject.length;
if (moduleObjectLen>0)
{
for (var i=0; i<moduleObjectLen; i++)
{
var item=WebHtmlEditor.ModuleObject[i];
var step=0;
var name=item[step++];
var place=item[step++];
var cellsLen = item[step++];
var dockable=item[step++];
var effectsEnable=item[step++];
var effectsUpdateRate=item[step++];
var effectsDuration=item[step++];
var enabled=item[step++];
var id=null;
try
{
WebHtmlEditor.RegisterModule(name,place,dockable, cellsLen, effectsEnable, effectsUpdateRate, effectsDuration, enabled, id);
}
catch (e){} ;
}
var tempFunc= function (editor)
{
editor.AttachEventHandler(WHEEVENT_MODE_CHANGED, function (){var mode=(editor.CurrMode == EDIT_MODE);editor.SetModulesVisible(mode); } );
} ;
tempFunc(WebHtmlEditor);
}
WebHtmlEditor.EnableContextMenus=enableContextMenus != null?enableContextMenus: true;
customContextMenuArray = [];
WebHtmlEditor.CustomContextMenuArray= (!customContextMenuArray?[]:customContextMenuArray);
if (WebHtmlEditor.EnableContextMenus)
{
var InitializeContextMenusManager = function (editor)
{
var bContextMenusManager = new ContextMenusManager(editor,editor.CustomContextMenuArray);
editor.ContextMenusManager=bContextMenusManager;
editor.AttachEventHandler(WHEEVENT_CONTEXTMENU, function (editor,e){if (editor.CurrMode == EDIT_MODE){bContextMenusManager.ShowContextMenu(e); e.cancelBubble= true; CancelSelect() }} );
} ;
InitializeContextMenusManager(WebHtmlEditor);
}
var popup=BPopupsManager.GetPopupsManager();
popup.AddStyleSheet(WebHtmlEditor.ThemePath +"/WebHtmlEditor.css");
popup.AddStyleSheet(WebHtmlEditor.ThemePath +"/Dialog.Css");
if(WebHtmlEditor.ConvertFontTagsToSpanTags)
{
WebHtmlEditor.FiltersManager.Add(new Font2SpanFilter());
}
if(WebHtmlEditor.ConvertTagsToLower)
{
WebHtmlEditor.FiltersManager.Add(new TagsNameToLowerFilter());
}
if(WebHtmlEditor.AllowScript!=true)
{
WebHtmlEditor.FiltersManager.Add(new StripScriptTagsFilter());
}
if (WebHtmlEditor.StripAbsoluteLinkPaths)
{
WebHtmlEditor.FiltersManager.Add(new StripPathFilter("A", WebHtmlEditor.LinkPathToStrip));
}
if (WebHtmlEditor.StripAbsoluteImagesPaths)
{
WebHtmlEditor.FiltersManager.Add(new StripPathFilter("IMG", WebHtmlEditor.ImagesPathToStrip));
}
if (WebHtmlEditor.ConvertHtmlToXhtmlFilter)
{
WebHtmlEditor.FiltersManager.Add(new ConvertHtmlToXhtmlFilter());
}
if (0 == WebHtmlEditorGlobalArray.length)
{
WebHtmlEditor.attachEvent(window,"unload", function (){WindowOnUnLoad(); } );
}
AddArrayListAtLast(WebHtmlEditorGlobalArray, WebHtmlEditor);
WebHtmlEditor.ExecuteClientCommand("OnClientLoad");
DefaultSetDocumentEdit(WebHtmlEditor);
if(WebHtmlEditor.OnLoadFocus)
{
WebHtmlEditor.SetFocus();
}
WebHtmlEditor.Initialize();
}
lionsky.prototype.GetResources= function (command1,command2)
{
var command=this.LocalResources[command1];
if (!command)
{
return command2;
}
else
{
return command;
}
};
lionsky.prototype.RegisterModule= function (name,place,dockable, cellsLen, effectsEnable, effectsUpdateRate, effectsDuration, enable,id)
{
var title=this.GetResources(name,name);
var moduleArgs = new Object();
moduleArgs.Editor = this;
moduleArgs.Document = document;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -