Filesystem Tree in Javascript

Joined: 06/06/2009

I am trying to make a directory tree for a add-on Product for a OpenSource CMS I use as currently they are all flash or java based (for the CMS at least) and to make it nicer to use, I want to try and set it up as much as possible as a file system view.

I am no stranger to 3rd party JS libraries and am more than willing to use one (or more) to do this. I was looking at using extJS for the actual tree structure, but need to get contents of file system.

Any ideas?

Drogo

Joined: 05/31/2009
jQuery Sample

You can't access the file system directly from JavaScript because it's running on the client side. You would need to use AJAX to call a server side script file that does the actual file handling. I found a nice looking sample here that uses jQuery. It's pretty slick, I think I may hang onto this one too.

http://abeautifulsite.net/notebook.php?article=58

-Shawn Steward
Freelance Web Designer

Joined: 11/28/2008
AJAX is not a necessity if

AJAX is not a necessity if you produce the entire tree structure and ship it to the browser for JS to take over. I've done it both ways, and used jQuery for each. The linked jQuery plugin above is the one I first used and it does use AJAX. I made heavy modifications to it to the point that it became an original work, then modified again to remove the need for AJAX calls.

Joined: 06/06/2009
I have had a major rethink of

I have had a major rethink of how Im going to have to do it, as the directory structure that appeared I wanted to be the users file system.

But I dont want to mess around with browser permissions or code signing or the like.

Thanks anyways - and for reference I was going to use extJS or YUI to do the hard qwork for me

Joined: 11/28/2008
Yes, user's filesystem is a

Yes, user's filesystem is a whole different animal! :)

Joined: 10/18/2008
Humm, in the Drupal world

Humm, in the Drupal world there is a module called IMCE which integrates with WYSIWYG's and allows for file browsing on the server. If it's a real important project, I'd download their code and see how they do what they do and mimic the sweetness.

/ * Begin Signature */
It's a strange thing about determined seekers-after-wisdom that, no matter where they happen to be, they'll always seek that wisdom which is a long way off. Wisdom is one of the few things that looks bigger the further away it is.

Joined: 06/06/2009
I have found a trick that

I have found a trick that allows you to create a file input for a form and mimic it that way, my server code will just have to figure it out!

But I may well have a look (as long as it doesnt involve installing drupal)