Forum OpenACS Development: Ajax Helper 0.8d committed to CVS HEAD

Ajax Helper 0.8d

Highlights of this release include ....

- Automatic loading of javascript sources in master template. After installing/upgrading to the latest release, check out ajax/doc for the code to include in your master templates to facilitate automatic loading of javascript sources when you use any of the helper procs.

- Tests Folder. Check out ajaxhelper/www/tests. This folder will hold adp/tcl files that test the wrapper procs. You can view these files to see how to use many of the helper procs in ajax helper.

- ah::insert helper proc to dynamically insert text before, after, on top or at the bottom of a given dom element.

- ah::yui::create_tree. A helper proc for generating yahoo tree view controls is now available.

- Updated Rounder. Removed the rico library for rounding corners and replaced it with a library from CurvyCorners. The original helper procedure for rounding corners has been updated as well.

- Initial integration with dojo.

Collapse
Posted by Hamilton Chua on
I've also cleaned up our ajax-filestorage-ui and committed it to CVS HEAD.
Collapse
Posted by Ryan Gallimore on
Thanks, Hamilton! This looks great.

Cheers.

Collapse
Posted by Caroline Meeks on
There are updates to the UI on head to support tagging with categories and other features

There is also new documentation here:
http://www.solutiongrove.com/docwiki/AJAXFS_Documentation

And a demonstration at: solutiongrove.info

Thanks to Hamilton for the features, Cesar Brea, Monitor and Harvard Kennedy School of Government for the funding and Pauline for the documentation.

Collapse
Posted by Victor Guerra on
I just added the cvs modules
for ajaxhelper and ajax-filestorage-ui packages.

--
Victor Guerra.

Collapse
Posted by Gerardo Morales on
Hi,

I'm trying your ajax-filestorage-ui package but I can't get it to work... I installed the package from HEAD (as well as the ajaxhelpler package) and everything installed ok, but when I access the index page I see nothing.

I debugged a little and this is the javascript which is dynamically (?) generated:

tree = new YAHOO.widget.TreeView("folders"); var treeroot = tree.getRoot(); var od744 = {label: "File Storage", id: "744", href: "javascript:showFolderContents('744',tree)"}; var node = treeroot; var nd744 = new YAHOO.widget.TextNode(od744,node,false); nd744.setDynamicLoad(loadDataForNode); tree.draw();

and these are the sources:

<script type="text/javascript" src="/resources/ajaxhelper/yui/connection/connection.js"></script>
<script type="text/javascript" src="/resources/ajaxhelper/yui/connection/connection.js"></script> (this is generated and referenced through the js_sources variable)

Could you help me please?, I'm working on a client proposal and I would like to show him the new ajax interface =), but I'm not too familiarized with javascript yet...

TIA,

Gerardo

Collapse
Posted by Hamilton Chua on
Hi Gerardo,

I sent a couple of e-mails, not sure if you got them.

Kindly read /ajax/doc and check if you have the code that needs to be on your blank-master template.

I'll be updating ajaxhelper to 0.85 soon. It has a couple of bug fixes and some nice additions.

Hamilton

Collapse
Posted by Malte Sussdorff on
I managed to get the filestorage-ui to work and even committed a lib so I can include it as the default for file storage on my site.

Sadly, this leaves me with a couple of questions to which I can't find the answer:

a) How can I pass the header_stuff variable from an include to the master template?
b) How can I make the ajax-filestorage-ui view open the folder contents of the main folder by default ?

Thanks for any guideance on this

Collapse
Posted by Malte Sussdorff on
And even more questions.

- How could I add a new file
- Is there a plan to add the capabilities (aka actions) from file-storage folder chunk, or is it just for viewing files ?
- What is your current use case ?

Collapse
Posted by Hamilton Chua on
More responses inline :

How could I add a new file ?

The code on CVS does not have this feature yet.

Is there a plan to add the capabilities (aka actions) from file-storage folder chunk, or is it just for viewing files ?

Yes, I have plans to add sorting, adding, deleting, copying and moving of files and folders.

What is your current use case ?

The intention is to develop a user interface that mimics windows explorer. The package will initially allow you to view files and folders but I hope to be able to integrate the other file storage actions soon.

Collapse
Posted by Caroline Meeks on
My vision for the FS AJAX UI is to provide a clean attractive UI for the most common use cases. Then you have a link to an "admin" page, which is the old UI for occasional tasks like uploading zip files, uploading new versions, renaming etc.
Collapse
Posted by Hamilton Chua on
Hello Malte,

My responses inline ...

a) How can I pass the header_stuff variable from an include to the master template?

The only way I know how to do that is thru global variables. In fact if you check ajax/doc/ there are instruction on pasting some code into your blank-master files to enable auto loading of javascript sources when you use helpers.

This means that if you use ah::effects, for example, and you have that piece of code in the blank-master, you won't need to worry anymore about what javascript source files to load as this will be taken cared of by ajaxhelper.

The intention is to take away the guess work, to minimize effort of using ajax and to prevent double declaration of js sources.

This mechanism is still a bit messy and I'm in the process of refactoring but it should work ok on 0.8.

So for ajax-file-storage, you might want to use global variables in your template files if you intend to make it an include.

b) How can I make the ajax-filestorage-ui view open the folder contents of the main folder by default ?

Looking at index.tcl, look for the comment "#create node". You'll see a list of items. On the particular file storage instance where you want it to open just add "1" to the list after "${dyn_load_script}". If you check the code in ajax-yahoo-procs.tcl you'll see that the item corresponds to -open which tells the tree to open the partcular node/folder.

So as the code loops thru all the fs_instances, you have to put a check for the file storage instance you want opened by default and add "1" to the list.

I hope that helps.

Ajax Helper 0.82d

Highlights of this release include ...

- improvement in autoloading javascript sources thru ah::requires for helper procs. This replaces the series of if statements you saw on each helper proc on 0.8.

- /ajaxhelper/lib/compress/ contains a java program RHINO that can be used to compress your custom javascript files. This same java program is used by the dojo toolkit to minify their javascript library.

- updated YUI to 0.12.1
- updated dojo to 0.4.1
- added YUI extensions 0.33
- new helper procs for generating YUI menus
- new helper proc for dojoio bind, this is an alternative to using ah::ajaxrequest, dojoio seems to be smarter because if the browser doesn't support ajax, it reverts to using iframes and other transport types
- more tests in ajaxhelper/www/tests, including tests that demonstrate how to use the menu helpers and the dojoio bind helper

Ajax File Storage UI 0.5d

- revised the user interface to use layouts c/o yui-ext
- rewrote javascript to fully use YUI widgets and utilities
- moved all javascript to ajaxfs.js and styles to ajaxfs.css
- new ui provides panes to display properties of selected file or folder
- renaming a file or folder now supported

Collapse
Posted by Claudio Pasolini on
Hi Hamilton,

I'd like to generate a yui menu with the ajaxhelper proc ah::yui::menu_from_list and so far I have:

  • installed ajaxhelper from HEAD
  • changed blnk-master.tcl and blank-master.adp following the instructions in the docs
  • created a testyui.tcl :
    set menu_list [list [list "Yahoo" "http://www.yahoo.it";] [list "Google" "http://www.google.it";] [list "Vestasoft" "http://www.vestasoft.com";]]

    ah::yui::menu_from_list \ -varname mymenu \ -id actions \ -menulist $menu_list \ -arrayname yuimenu

    set script_show $yuimenu(show) set script_render $yuimenu(render)

but now I'm stuck because I don't know how to proceed with the adp part. I tried to load the rendering script declaring it within the header_stuff property, and actually it is loaded but I get a JS error telling
Error: missing : after property id
Could you kindly provide a working example?
Collapse
Posted by Hamilton Chua on
There are tests that demonstrate how to use it in ajaxhelper/www/tests.

In particular, take a look at test_yahoomenu-js.

If ajaxhelper is mounted under /ajax, which it should be by default. Go to http://youropenacsinstant/ajax/tests/test_yahoomenu-js

Collapse
Posted by Claudio Pasolini on
Thank You Hamilton,

I missed the tests directory!