Editor.htm
<Textarea style = "behavior: url ('editor. htc ');"> </textarea>
Editor. htc
<Public: attach event = oncontentready onevent = initEditor ()>
<Script>
// Object
Var vColorObject = null;
Var vFontObject = null;
Var vFontFamilyDiv = null;
Var vFontSizeDiv = null;
Var vFileObject = null;
Var vConsoleDiv = null;
Var vEditorDiv = null;
// Button prompt text
Var strButtonTitleArray = new Array ("new", "open", "save", "cut", "Copy", "paste", "cancel", "recover ", "Bold", "italic", "lower", "table", "left", "center", "right", "number", "symbol ", "indent", "shrink", "color", "font size", "font", "image", "link", "horizontal", "print ", "preview ");
// Button static text
Var strButtonValueArray = new Array ("new", "open", "save", "cut", "Copy", "paste", "cancel", "restore ", "Bold", "italic", "lower", "table", "left", "center", "right", "number", "symbol ", "indent", "shrink", "color", "font size", "font", "image", "link", "horizontal", "print ", "preview ");
// Button interface program
Var strButtonDefineFunctionArray = new Array ("defineNew ()",
"DefineOpen ()",
"DefineSave ()",
"DefineCut ()",
"DefineCopy ()",
"DefinePaste ()",
"DefineUndo ()",
"DefineRedo ()",
"DefineBold ()",
"DefineItalic ()",
"DefineUnderLine ()",
"DefineTable ()",
"DefineJustifyLeft ()",
"DefineJustifyCenter ()",
"DefineJustifyRight ()",
"DefineInsertOrderedList ()",
"DefineInsertUnorderedList ()",
"DefineOutdent ()",
"DefineIndent ()",
"DefineColor ()",
"DefineFontSize ()",
"DefineFontFamily ()",
"DefineInsertImage ()",
"DefineCreateLink ()",
"DefineInsertHorizontalRule ()",
"DefinePrint ()",
"DefinePreview ()");
// Button icon
Var strButtonDefineIconArray = new Array ("","","","","","","","","","","", "","","","","","","","","","","","","", "","","");
// Button response Library
Function defineNew ()
{
VEditorDiv. innerHTML = "";
}
Function defineOpen ()
{
OpenFileDlg ();
}
Function defineSave ()
{
Element. value = vEditorDiv. innerHTML;
}
Function defineCut ()
{
VEditorDiv. focus ();
Document.exe cCommand ("Cut ");
VEditorDiv. focus ();
}
Function defineCopy ()
{
VEditorDiv. focus ();
Document.exe cCommand ("Copy ");
VEditorDiv. focus ();
}
Function definePaste ()
{
VEditorDiv. focus ();
Document.exe cCommand ("Paste ");
VEditorDiv. focus ();
}
Function defineUndo ()
{
VEditorDiv. focus ();
Document.exe cCommand ("Und</