Click here to Skip to main content
15,881,938 members
Articles / Web Development / XHTML
Article

Online Code Editor

Rate me:
Please Sign up or sign in to vote.
3.14/5 (4 votes)
23 Oct 2008CPOL 44.5K   237   26   2
With Online Code Editor, you can edit your code online.

Introduction

With the Online Code Editor, you can edit your code online. It allows to write well-formatted source code with line enumeration, tab support, search and replace (with regexp), and live syntax highlighting (customizable).

Screenshot...

Background

The Online Code Editor is based on EditArea, a free JavaScript editor for source code, created by Christophe Dolivet. We added a file browser to manipulate files (load and save). The file browser is based on a tree, like MS Explorer. The script code of the tree was created by Geir Landrö.

Using the code

You just upload a page and a directory to your server, and then you can navigate the files and edit them.

Points of interest

This is the recursive directory script:

VBScript
Sub RecursiveDir(ByVal Root As String, ByVal pID As Integer, _
                 ByVal ListFiles As Boolean)
    Dim Folder As New DirectoryInfo(Root)
    Dim SubFolder As DirectoryInfo
    Dim File As FileInfo
    For Each SubFolder In Folder.GetDirectories
        iID = iID + 1
        If LCase(SubFolder.Name) <> "_codeedit" Then
            Response.Write("d.add(" & iID & ", " & pID & _
                           ",""" & SubFolder.Name & _
                           """);" & vbLf)
        Call RecursiveDir(Root & "\" & SubFolder.Name, iID, ListFiles)
    Next

    If ListFiles Then
        For Each File In Folder.GetFiles("*.*")
            iID = iID + 1 If LCase(File.Name) <> "_codeedit.aspx" Then_
             Response.Write("d.add(" & iID & "," & _
                pID & ",""" & File.Name & _
                """,""_codeedit.aspx?side=right&screenwidth=" & _
                Trim(Request("screenwidth")) & "&screenheight=" & _
                Trim(Request("screenheight")) & "&file=" & _
            Server.UrlEncode(Root & "\" & File.Name) & """);" & vbLf)
        Next
    Else
        Response.Write("d.icon.node =""_CodeEdit/images/folder.gif"";" & vbLf)
    End If
End Sub

History

This is a rough version. We have plans to update it soon. Please visit our website to get any updated news.

License

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


Written By
Web Developer Industria Virtual
Brazil Brazil
Taylor made web applications for you and your business.

Comments and Discussions

 
GeneralRe: Embed into a project Pin
Member 35985511-May-11 10:55
Member 35985511-May-11 10:55 
GeneralThanks Pin
trkchk27-Oct-08 16:33
trkchk27-Oct-08 16:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.