Click here to Skip to main content
15,879,348 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="EditorScript.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="btnHeading" class="buttonStyle" onclick="showHeadingDiv()" title="Heading">
                            <img src="editorimages/FormatCodeBlock.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="btnSPChars" class="buttonStyle" onclick="showDialog('sc',350,330)" title="Insert Special Characters">
                            <img src="editorimages/InsertSymbol.gif" /></button>
                        <button id="btnHR" class="buttonStyle" onclick="doAction('InsertHorizontalRule')"
                            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>
                        <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="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="btnRedo" 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>
                    </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" onload="setText(this, '<%= editorContentValue.ClientID %>')">
                </iframe>
            </div>
            <div id="txtDiv" style="display: none">
                <textarea id="textContent" class="txtAreaStyle"></textarea>
            </div>
        </td>
    </tr>
    <tr>
        <td>
            &nbsp;<input id="editorContentValue" name="editorContentValue" type="hidden" runat="server" />
        </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