Index: openacs-4/packages/ajaxhelper/www/doc/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ajaxhelper/www/doc/index.html,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ajaxhelper/www/doc/index.html 5 Apr 2006 06:38:42 -0000 1.2 +++ openacs-4/packages/ajaxhelper/www/doc/index.html 20 Apr 2006 12:31:27 -0000 1.3 @@ -53,7 +53,7 @@     @ah_sources;noquote@

Compiled Template:
-
<script<script type="text/javascript" src="/ajax/prototype/prototype.js"></script> 
<scriptscript>
<script type="text/javascript" src="/ajax/scriptaculous/slider.js"></script>
-
<scriptscript>
<script type="text/javascript" src="/ajax/scriptaculous/scriptaculous.js"></script>

The above TCL API generates the default sources that must be declared for you to be able to use the javascript -effects. Ajax Helper has support for overlibmws (DHTML callouts) and -RICO (other cinematic effects) in addition to scriptaculous.
+libraries Ajax Helper has support for overlibmws (DHTML callouts) and +RICO (other cinematic effects) in addition to scriptaculous.  +Scriptaculous is the default javascript library.

To generate the javascript sources for Rico :

@@ -97,7 +97,7 @@
NOTE :

-You can combine sources by doing something like this
+You can combine sources by doing this

    set ah_sources [ah::js_sources -default]
    append ah_sources [ah::js_sources -source @@ -112,29 +112,140 @@
Ajax Procedures :

-
Scriptaculous has a pair of javascript functions that alllow +Prototype has a pair of javascript functions that alllow programmers to use XMLHTTP. The ajax.updater and ajax.request functions. See http://wiki.script.aculo.us/scriptaculous/show/Ajax.Updater and http://wiki.script.aculo.us/scriptaculous/show/Ajax.Request -for more informaiton about the scriptaculous functions.
+for more information about these javascript functions.

The TCL API is used like this

-    set request [ah::ajaxrequest -url "/url/to/call" --pars "parameter1=parameter_value&parameter1=parameter_value" --options "asynchronous:true" ]
+    set request [ah::ajaxrequest -url +"/url/to/call"  +\
+            +            +            +            +     -pars +"parameter1=parameter_value&parameter1=parameter_value"  ]

The above api will generate an ajax.request javascript function that is -best placed in a javascript event.
+best placed in an  event like "onClick".

    <a href="#" onClick="@request;noquote@">

+Consult the api-doc for more information about other parameters you can +pass on to the ah::ajaxrequest proc.

+The ah::ajaxrequest will make an xmlhttp call but does not do anything +about the response. To update content based on the response from an +xmlhttp request, use ah::ajaxupdate. This procedure will not only make +an xmlhttp call but update the contents of a div or layer with the +response text of the xmlhttp request.

+Here's an example :

+       set js_update_connections +[ah::ajaxupdate -container "connections"  \
+            +    -url "/url/to/call" \
+            +    -enclose  \
+            +    -pars +"'effects=$effects&limit_n=$limit_n'"  \
+                +-effect "Fade" \
+            +    -effectopts "duration: 0.5"]

-
+On the adp side, you can just put
+
+      @js_update_connections;noquote@
+
+The "-enclose" parameter tells the procedure to enclose the resulting +script in script tags <script></script>. This is another +option in addition to putting the scripts in html event attributes like +onClick, onMouseover or onChange.
+
+The "-pars" parameter is where you pass the querystring that you want +to send along with the xmlhttp request. Notice that it takes the form +of a querystring that you normally see in the address bar of your +browser. Use this to pass values to the URL you are making an xmlhttp +request to.
+
+The "-effect" parameter is an optional parameter that allows you to +specify the effect you want to execute after the container's content +has been updated.
+
+Cinematic Effects :
+
+
Use ah::effects to generate javascript that allows you to +implement transitional and cinematic effects to html elements. You will +need to consult the scriptaculous documentation +http://wiki.script.aculo.us/scriptaculous/tags/effects to know what +kinds of +effects and what kinds of options you can pass to the effect script.
+
+The procedure is called in this manner :
+
+    set effect [ah::effect -element "container"
+            +            +               +-effect "Fade"
+            +            +        +       -options "duration: 1.5"]
+NOTE :
+The Effect name and the options are case sensitive.
+
+

+DHTML Callouts :
+
+
There is currently basic support for overlibmws. Right now we +are able to create bubble type call outs.
+
+In your tcl file ...
+
+   set onmouseover [ah::bubblecallout -text " Contents of My +Popup" ]
+
+The adp file should have something like this ....
+  
+   <a href="#" @onmouseover;noquote@ >Link with +Popup</a>
+
+Drag and Drop Sortables :
+
+
Sortables are documented in the scriptaculous wiki http://wiki.script.aculo.us/scriptaculous/show/Sortables.
+For sortables to work you will need to define a container which will +hold the elements you want to be sortable.
+
+Here is what the script looks like
+
+    append scripts [ah::sortable -element "container"
+            +            +            +            +     -options +"tag:'div',only:'portlet',overlap:'horizontal',constraint:false,ghosting:false"]
+
+You adp page should contain a div with id attribute container. This +"container" should have subcontainers which the above script will make +sortable.
+
+
+

+
+
+
+
- + \ No newline at end of file