The Textarea tag is encapsulated as a Web online editor.

Source: Internet
Author: User

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</

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.