Click here to Skip to main content
Click here to Skip to main content

Online Code Editor

By , 23 Oct 2008
Rate this:
Please Sign up or sign in to vote.

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:

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)

About the Author

Industria Virtual
Web Developer Industria Virtual
Brazil Brazil
Taylor made web applications for you and your business.
Follow on   Twitter

Comments and Discussions

 
GeneralRe: Embed into a project PinmemberMember 35985511-May-11 10:55 
GeneralThanks Pinmemberchodi27-Oct-08 16:33 

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

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

| Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 23 Oct 2008
Article Copyright 2008 by Industria Virtual
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid