Click here to Skip to main content
15,878,748 members
Articles / Web Development / HTML

Fully JavaScript Enabled Editor

Rate me:
Please Sign up or sign in to vote.
4.60/5 (33 votes)
7 Sep 2010CPOL1 min read 65.3K   2.1K   116  
Fully JavaScript enabled editor which also contains some server coding
  • editorvbnet.zip
    • EditorVBNet
      • Default.aspx
      • Default.aspx.vb
      • editorimages
        • BackColor.gif
        • Bold.gif
        • ButtonDesign.gif
        • ButtonHtml.gif
        • ButtonPreview.gif
        • close.gif
        • ConvertToLower.gif
        • ConvertToUpper.gif
        • Copy.gif
        • Cut.gif
        • Delete.gif
        • Delete2.gif
        • Font.gif
        • FontSize.gif
        • ForeColor.gif
        • FormatCodeBlock.gif
        • ImageMapDialog.gif
        • Indent.gif
        • InsertDate.gif
        • InsertHorizontalRule.gif
        • InsertOrderedList.gif
        • InsertSymbol.gif
        • InsertTable.gif
        • InsertTime.gif
        • InsertUnorderedList.gif
        • Italic.gif
        • JustifyCenter.gif
        • JustifyFull.gif
        • JustifyLeft.gif
        • JustifyRight.gif
        • LinkManager.gif
        • Outdent.gif
        • Paste.gif
        • Print.gif
        • Redo.gif
        • RemoveFormat.gif
        • SelectAll.gif
        • StrikeThrough.gif
        • Subscript.gif
        • Superscript.gif
        • Thumbs.db
        • toolbarstart.gif
        • Underline.gif
        • Undo.gif
        • zoomInIcon.gif
        • zoomOutIcon.gif
      • EditorScript.js
      • EditorStyle.css
      • imgWindow.aspx
      • imgWindow.aspx.vb
      • InsertLink.htm
      • InsertTable.htm
      • NEditor.ascx
      • NEditor.ascx.vb
      • SpecialChars.htm
      • uploadsDir
        • imagefiles
          • ball.gif
          • dog.jpg
          • dolphin.jpg
          • eye.jpg
          • image004.jpg
          • image009.jpg
          • mob1.jpg
          • Thumbs.db
          • WATERsky.jpg
  • editorphp.zip
    • EditorPHP
      • default.php
      • editorimages
        • BackColor.gif
        • Bold.gif
        • ButtonDesign.gif
        • ButtonHtml.gif
        • ButtonPreview.gif
        • close.gif
        • ConvertToLower.gif
        • ConvertToUpper.gif
        • Copy.gif
        • Cut.gif
        • Delete.gif
        • Delete2.gif
        • Font.gif
        • FontSize.gif
        • ForeColor.gif
        • FormatCodeBlock.gif
        • ImageMapDialog.gif
        • Indent.gif
        • InsertDate.gif
        • InsertHorizontalRule.gif
        • InsertOrderedList.gif
        • InsertSymbol.gif
        • InsertTable.gif
        • InsertTime.gif
        • InsertUnorderedList.gif
        • Italic.gif
        • JustifyCenter.gif
        • JustifyFull.gif
        • JustifyLeft.gif
        • JustifyRight.gif
        • LinkManager.gif
        • Outdent.gif
        • Paste.gif
        • Print.gif
        • Redo.gif
        • RemoveFormat.gif
        • SelectAll.gif
        • StrikeThrough.gif
        • Subscript.gif
        • Superscript.gif
        • Thumbs.db
        • toolbarstart.gif
        • Underline.gif
        • Undo.gif
        • zoomInIcon.gif
        • zoomOutIcon.gif
      • EditorScript.js
      • EditorStyle.css
      • imgWindow.php
      • InsertLink.htm
      • InsertTable.htm
      • NEditor.php
      • SpecialChars.htm
      • uploadsDir
        • imagefiles
          • ball.gif
          • dog.jpg
          • dolphin.jpg
          • eye.jpg
          • image004.jpg
          • image009.jpg
          • mob1.jpg
          • Thumbs.db
          • WATERsky.jpg
  • editorcs.zip
    • EditorCS
      • Default.aspx
      • Default.aspx.cs
      • editorimages
        • BackColor.gif
        • Bold.gif
        • ButtonDesign.gif
        • ButtonHtml.gif
        • ButtonPreview.gif
        • close.gif
        • ConvertToLower.gif
        • ConvertToUpper.gif
        • Copy.gif
        • Cut.gif
        • Delete.gif
        • Delete2.gif
        • Font.gif
        • FontSize.gif
        • ForeColor.gif
        • FormatCodeBlock.gif
        • ImageMapDialog.gif
        • Indent.gif
        • InsertDate.gif
        • InsertHorizontalRule.gif
        • InsertOrderedList.gif
        • InsertSymbol.gif
        • InsertTable.gif
        • InsertTime.gif
        • InsertUnorderedList.gif
        • Italic.gif
        • JustifyCenter.gif
        • JustifyFull.gif
        • JustifyLeft.gif
        • JustifyRight.gif
        • LinkManager.gif
        • Outdent.gif
        • Paste.gif
        • Print.gif
        • Redo.gif
        • RemoveFormat.gif
        • SelectAll.gif
        • StrikeThrough.gif
        • Subscript.gif
        • Superscript.gif
        • Thumbs.db
        • toolbarstart.gif
        • Underline.gif
        • Undo.gif
        • zoomInIcon.gif
        • zoomOutIcon.gif
      • EditorScript.js
      • EditorStyle.css
      • imgWindow.aspx
      • imgWindow.aspx.cs
      • InsertLink.htm
      • InsertTable.htm
      • NEditor.ascx
      • NEditor.ascx.cs
      • SpecialChars.htm
      • uploadsDir
        • imagefiles
          • ball.gif
          • dog.jpg
          • dolphin.jpg
          • eye.jpg
          • image004.jpg
          • image009.jpg
          • mob1.jpg
          • Thumbs.db
          • WATERsky.jpg
  • editor_php.zip
    • editor_php
      • default.php
      • editorimages
        • BackColor.gif
        • Bold.gif
        • ButtonDesign.gif
        • ButtonHtml.gif
        • ButtonPreview.gif
        • close.gif
        • ConvertToLower.gif
        • ConvertToUpper.gif
        • Copy.gif
        • Cut.gif
        • Delete.gif
        • Delete2.gif
        • Font.gif
        • FontSize.gif
        • ForeColor.gif
        • ImageMapDialog.gif
        • Indent.gif
        • InsertDate.gif
        • InsertFlash.gif
        • InsertFormButton.gif
        • InsertFormCheckbox.gif
        • InsertFormFileUpload.gif
        • InsertFormForm.gif
        • InsertFormHidden.gif
        • InsertFormPassword.gif
        • InsertFormRadio.gif
        • InsertFormReset.gif
        • InsertFormSelect.gif
        • InsertFormSelect2.gif
        • InsertFormSubmit.gif
        • InsertFormText.gif
        • InsertFormTextarea.gif
        • InsertHorizontalRule.gif
        • InsertMedia.gif
        • InsertOrderedList.gif
        • InsertSymbol.gif
        • InsertTable.gif
        • InsertTemplate.gif
        • InsertTime.gif
        • InsertUnorderedList.gif
        • Italic.gif
        • JustifyCenter.gif
        • JustifyFull.gif
        • JustifyLeft.gif
        • JustifyRight.gif
        • LinkManager.gif
        • Outdent.gif
        • Paste.gif
        • Print.gif
        • Redo.gif
        • RemoveFormat.gif
        • Save.gif
        • SaveLocal.gif
        • SelectAll.gif
        • StrikeThrough.gif
        • Subscript.gif
        • Superscript.gif
        • Thumbs.db
        • toolbarstart.gif
        • Underline.gif
        • Undo.gif
        • zoomInIcon.gif
        • zoomOutIcon.gif
      • EditorScripts.js
      • EditorStyle.css
      • flashWindow.php
      • imgWindow.php
      • InsertLinks.htm
      • InsertTable.htm
      • mediaWindow.php
      • NEditor.php
      • saveWindow.php
      • SpecialChars.htm
      • templateWindow.php
      • uploadsDir
        • flashfiles
        • imagefiles
          • Thumbs.db
        • mediafiles
          • Thumbs.db
        • templatefiles
  • editor_vb.net.zip
  • Editor.zip
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NEditor.ascx.cs" Inherits="NEditor" %>

<script language="javascript" src="EditorScripts.js"></script>

<table class="maintable" cellpadding="0" cellspacing="0">
    <tr>
        <td valign="top">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        &nbsp;<img src="editorimages/toolbarstart.gif" />
                        <button id="btnBold" class="buttonStyle" title="Bold" onclick="doAction('Bold')">
                            <img src="editorimages/Bold.gif" /></button>
                        <button id="btnItalic" class="buttonStyle" onclick="doAction('Italic')" title="Italic">
                            <img src="editorimages/Italic.gif" /></button>
                        <button id="btnUnderline" class="buttonStyle" onclick="doAction('Underline')" title="Underline">
                            <img src="editorimages/Underline.gif" /></button>
                        <button id="btnStrikeThru" class="buttonStyle" onclick="doAction('Strikethrough')"
                            title="StrikeThrough">
                            <img src="editorimages/StrikeThrough.gif" /></button>
                        <button id="btnFont" class="buttonStyle" onclick="showFontDiv()" title="Font">
                            <img src="editorimages/Font.gif" align="absmiddle" /></button>
                        <button id="btnFontSize" class="buttonStyle" onclick="showFontSizeDiv()" title="Font Size">
                            <img src="editorimages/FontSize.gif" align="absmiddle" /></button>
                        <button id="btnBackcolor" class="buttonStyle" onclick="showColorDiv('BackColor')"
                            title="Backcolor">
                            <img src="editorimages/BackColor.gif" align="absmiddle" /></button>
                        <button id="btnForecolor" class="buttonStyle" onclick="showColorDiv('ForeColor')"
                            title="Forecolor">
                            <img src="editorimages/ForeColor.gif" align="absmiddle" /></button>
                        <button id="btnOL" class="buttonStyle" onclick="doAction('InsertOrderedList')" title="Ordered List">
                            <img src="editorimages/InsertOrderedList.gif" /></button>
                        <button id="btnUL" class="buttonStyle" onclick="doAction('InsertUnorderedList')"
                            title="Unordered List">
                            <img src="editorimages/InsertUnorderedList.gif" /></button>
                        <button id="btnLA" class="buttonStyle" onclick="doAction('JustifyLeft')" title="Left Align">
                            <img src="editorimages/JustifyLeft.gif" /></button>
                        <button id="btnCA" class="buttonStyle" onclick="doAction('JustifyCenter')" title="Center Align">
                            <img src="editorimages/JustifyCenter.gif" /></button>
                        <button id="btnRA" class="buttonStyle" onclick="doAction('JustifyRight')" title="Right Align">
                            <img src="editorimages/JustifyRight.gif" /></button>
                        <button id="btnJA" class="buttonStyle" onclick="doAction('JustifyFull')" title="Justify">
                            <img src="editorimages/JustifyFull.gif" /></button>
                        <button id="btnIndent" class="buttonStyle" onclick="doAction('Indent')" title="Indent">
                            <img src="editorimages/Indent.gif" /></button>
                        <button id="btnOutdent" class="buttonStyle" onclick="doAction('Outdent')" title="Outdent">
                            <img src="editorimages/Outdent.gif" /></button>
                    </td>
                </tr>
                <tr>
                    <td width="100%">
                        &nbsp;<img src="editorimages/toolbarstart.gif" />
                        <button id="btnLink" class="buttonStyle" onclick="showDialog('li',380,125)" title="Insert Link">
                            <img src="editorimages/LinkManager.gif" /></button>
                        <button id="btnTable" class="buttonStyle" onclick="showInsertPopup('tb',320,200)"
                            title="Insert Table">
                            <img src="editorimages/InsertTable.gif" /></button>
                        <button id="btnImage" class="buttonStyle" onclick="showInsertPopup('im',350,340)"
                            title="Insert Image">
                            <img src="editorimages/ImageMapDialog.gif" /></button>
                        <button id="btnFlash" class="buttonStyle" onclick="showInsertPopup('fl',350,320)"
                            title="Insert Flash">
                            <img src="editorimages/InsertFlash.gif" /></button>
                        <button id="btnMedia" class="buttonStyle" onclick="showInsertPopup('me',350,320)"
                            title="Insert Media">
                            <img src="editorimages/InsertMedia.gif" /></button>
                        <button id="btnSPChars" class="buttonStyle" onclick="showDialog('sc',350,330)" title="Insert Special Characters">
                            <img src="editorimages/InsertSymbol.gif" /></button>
                        <button id="btnTemplates" class="buttonStyle" onclick="showInsertPopup('tm',350,260)"
                            title="Insert Template">
                            <img src="editorimages/InsertTemplate.gif" /></button>
                        <button id="btnSave" class="buttonStyle" onclick="showInsertPopup('st',380,125)"
                            title="Save Template in Server">
                            <img src="editorimages/Save.gif" /></button>
                        <button id="bntSave2" class="buttonStyle" onclick="doActionWithValues('SaveAs','1','MyDocument')"
                            title="Save Template Locally">
                            <img src="editorimages/SaveLocal.gif" /></button>
                        <button id="btnPrint" class="buttonStyle" onclick="doAction('Print')" title="Print">
                            <img src="editorimages/Print.gif" /></button>
                        <button id="btnOutput" class="buttonStyle" onclick="showPreview('o')" title="Preview">
                            <img src="editorimages/ButtonPreview.gif" /></button>
                        <button id="btnPreview" class="buttonStyle" onclick="showPreview('s')" title="Html Source">
                            <img src="editorimages/ButtonHtml.gif" /></button>
                        <button id="btnDesign" class="buttonStyle" onclick="showPreview('d')" title="Design"
                            disabled="disabled">
                            <img src="editorimages/ButtonDesign.gif" /></button>
                    </td>
                </tr>
                <tr>
                    <td style="width: 100%">
                        &nbsp;<img src="editorimages/toolbarstart.gif" />
                        <button id="btnFrmButton" class="buttonStyle" onclick="doActionWithValues('InsertInputButton','1','Button1')"
                            title="Insert Button">
                            <img src="editorimages/InsertFormButton.gif" /></button>
                        <button id="btnFrmCheckbox" class="buttonStyle" onclick="doActionWithValues('InsertInputCheckbox','1','Checkbox1')"
                            title="Insert Checkbox">
                            <img src="editorimages/InsertFormCheckbox.gif" /></button>
                        <button id="btnFrmHidden" class="buttonStyle" onclick="doActionWithValues('InsertInputHidden','1','Hidden1')"
                            title="Insert Form Hidden">
                            <img src="editorimages/InsertFormHidden.gif" /></button>
                        <button id="btnFrmFileUpload" class="buttonStyle" onclick="doActionWithValues('InsertInputFileUpload','1','FileUpload1')"
                            title="Insert Form FileUpload">
                            <img src="editorimages/InsertFormFileUpload.gif" /></button>
                        <button id="btnFrmPassword" class="buttonStyle" onclick="doActionWithValues('InsertInputPassword','1','Password1')"
                            title="Insert Form Password">
                            <img src="editorimages/InsertFormPassword.gif" /></button>
                        <button id="btnFrmRadio" class="buttonStyle" onclick="doActionWithValues('InsertInputRadio','1','Radiobutton1')"
                            title="Insert Form Radio">
                            <img src="editorimages/InsertFormRadio.gif" /></button>
                        <button id="btnFrmReset" class="buttonStyle" onclick="doActionWithValues('InsertInputReset','1','Reset1')"
                            title="Insert Form Reset">
                            <img src="editorimages/InsertFormReset.gif" /></button>
                        <button id="btnFrmSubmit" class="buttonStyle" onclick="doActionWithValues('InsertInputSubmit','1','Submit1')"
                            title="Insert Form Submit">
                            <img src="editorimages/InsertFormSubmit.gif" /></button>
                        <button id="btnFrmText" class="buttonStyle" onclick="doActionWithValues('InsertInputText','1','Text1')"
                            title="Insert Form Text">
                            <img src="editorimages/InsertFormText.gif" /></button>
                        <button id="btnFrmTextArea" class="buttonStyle" onclick="doActionWithValues('InsertTextArea','1','TextArea1')"
                            title="Insert Form TextArea">
                            <img src="editorimages/InsertFormTextarea.gif" /></button>
                        <button id="btnFrmSelectDDL" class="buttonStyle" onclick="doActionWithValues('InsertSelectDropdown','1','selectdd11')"
                            title="Insert Form Dropdownlist">
                            <img src="editorimages/InsertFormSelect.gif" /></button>
                        <button id="btnFrmSelectLB" class="buttonStyle" onclick="doActionWithValues('InsertSelectListbox','1','selectlb1')"
                            title="Insert Form Listbox">
                            <img src="editorimages/InsertFormSelect2.gif" /></button>
                    </td>
                </tr>
                <tr>
                    <td style="width: 100%">
                        &nbsp;<img src="editorimages/toolbarstart.gif" />
                        <button id="btnCut" class="buttonStyle" onclick="doAction('Cut')" title="Cut">
                            <img src="editorimages/Cut.gif" /></button>
                        <button id="btnCopy" class="buttonStyle" onclick="doAction('Copy')" title="Copy">
                            <img src="editorimages/Copy.gif" /></button>
                        <button id="btnPaste" class="buttonStyle" onclick="doAction('Paste')" title="Paste">
                            <img src="editorimages/Paste.gif" /></button>
                        <button id="btnSelectAll" class="buttonStyle" onclick="doAction('SelectAll')" title="SelectAll">
                            <img src="editorimages/SelectAll.gif" /></button>
                        <button id="btnRemoveFormat" class="buttonStyle" onclick="doAction('RemoveFormat')"
                            title="Remove Format">
                            <img src="editorimages/RemoveFormat.gif" /></button>
                        <button id="btnDelete" class="buttonStyle" onclick="doAction('Delete')" title="Delete Selected">
                            <img src="editorimages/Delete2.gif" /></button>
                         <button id="btnClearAll" class="buttonStyle" onclick="doAction('ClearAll')" title="Clear All">
                            <img src="editorimages/Delete.gif" /></button>
                        <button id="btnUndo" class="buttonStyle" onclick="doAction('Undo')" title="Undo">
                            <img src="editorimages/Undo.gif" /></button>
                        <button id="bntRedo" class="buttonStyle" onclick="doAction('Redo')" title="Redo">
                            <img src="editorimages/Redo.gif" /></button>
                        <button id="btnLC" class="buttonStyle" onclick="doHtmlAction('lower')" title="LowerCase">
                            <img src="editorimages/ConvertToLower.gif" /></button>
                        <button id="btnUC" class="buttonStyle" onclick="doHtmlAction('upper')" title="UpperCase">
                            <img src="editorimages/ConvertToUpper.gif" /></button>
                        <button id="btnSuperScript" class="buttonStyle" onclick="doAction('Superscript')"
                            title="Superscript">
                            <img src="editorimages/Superscript.gif" /></button>
                        <button id="btnSubScript" class="buttonStyle" onclick="doAction('Subscript')" title="Subscript">
                            <img src="editorimages/Subscript.gif" /></button>
                        <button id="btnHR" class="buttonStyle" onclick="doHtmlAction('hr')" title="Horizontal Line">
                            <img src="editorimages/InsertHorizontalRule.gif" /></button>
                        <button id="btnZoomOut" class="buttonStyle" onclick="setZoom('p')" title="Zoom Out">
                            <img src="editorimages/zoomInIcon.gif" /></button>
                        <button id="btnZoomIn" class="buttonStyle" onclick="setZoom('m')" title="Zoom In">
                            <img src="editorimages/zoomOutIcon.gif" /></button>
                        <button id="btnInsertDate" class="buttonStyle" onclick="showDateDiv()" title="Insert Date">
                            <img src="editorimages/InsertDate.gif" /></button>
                        <button id="btnInsertTime" class="buttonStyle" onclick="showTimeDiv()" title="Insert Time">
                            <img src="editorimages/InsertTime.gif" /></button>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td id="frametd" align="center" valign="top">
            <div id="FrameDiv" style="display: block">
                <iframe id="editFrame" frameborder="0" name="editFrame" class="frameStyle"></iframe>
            </div>
            <div id="txtDiv" style="display: none">
                <textarea id="textContent" class="txtAreaStyle"></textarea>
            </div>
        </td>
    </tr>
    <tr>
        <td>
            &nbsp;
        </td>
    </tr>
</table>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions