Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

JavaScript 'Object' Browser

0.00/5 (No votes)
11 Mar 2013 1  
A tool like the object browser to browse the interface of documented JavaScript and JavaScript code snippets.

Java Object browser

Some time ago I was working on a Web-project that had already a load of Java jQuery files. Some came from the Web-designer, some from external developers, some were standard. While working on them, I discovered that some added functionality already existed or existed with a slightly different interface. Some files were meant to be shared, but some guys changed them not being aware of the sharing.

Of course if everything goes perfect, this won’t happen. But am I really to blame to make my own Fill Select function, because I am not aware that there is already one in a file called General.js? A JavaScript file can be documented, providing intelligence when referenced. But can you blame the developer not making these doc files and how do I know which files to reference?

To contribute to a more organized way of JavaScript development, I developed a browser in a way similar to the Object browser. The idea is twofold: first to organize Java code snippets in a logical categorized way (Dates function apart from Select functions), secondly parse the documentation tags in such a way that they can be displayed in the browser. You can browse the JavaScript interface and you can merge these several code blocks to a separate file (leaving out the annotated tags).

It looks like:

Sample Image

The project consists of a parser that parses a JavaScript that is either embedded as a source or loaded from file and of a Windows Forms application that displays the parsed result. At first I thought why not include a minimize function as well. One annotated source could then be translated to a normal or a minimized file. I dropped that idea because Minimize functionality is already available and can be integrated in MSBuild.

At first I didn’t intend to share this with the developer world, so I have not tested it thoroughly (due to limited time). The code itself doesn’t bear that much complexity, so examining it won’t be that difficult. In the parsing I make use of Reactive Extensions that is worth studying, but don’t forget to include it. So take this as the first imperfect version. Comments are welcome.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here