/[drupal]/contributions/modules/jcarousel/jcarousel.js
ViewVC logotype

Diff of /contributions/modules/jcarousel/jcarousel.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.2.2.8, Thu Nov 5 23:11:47 2009 UTC revision 1.1.2.2.2.9, Tue Nov 10 17:12:05 2009 UTC
# Line 1  Line 1 
1  /* $Id: jcarousel.js,v 1.1.2.2.2.7 2009/11/05 23:07:28 robloach Exp $ */  /* $Id: jcarousel.js,v 1.1.2.2.2.8 2009/11/05 23:11:47 robloach Exp $ */
2    
3  /**  /**
4   * @file   * @file
# Line 14  Drupal.behaviors.jcarousel = function() Line 14  Drupal.behaviors.jcarousel = function()
14    
15      // Convert any callback arguments from strings to function calls.      // Convert any callback arguments from strings to function calls.
16      var callbacks = ['initCallback', 'itemLoadCallback', 'itemFirstInCallback', 'itemFirstOutCallback', 'itemLastOutCallback', 'itemLastInCallback', 'itemVisibleInCallback', 'itemVisibleOutCallback', 'buttonNextCallback', 'buttonPrevCallback'];      var callbacks = ['initCallback', 'itemLoadCallback', 'itemFirstInCallback', 'itemFirstOutCallback', 'itemLastOutCallback', 'itemLastInCallback', 'itemVisibleInCallback', 'itemVisibleOutCallback', 'buttonNextCallback', 'buttonPrevCallback'];
17      for (callback in callbacks) {      jQuery.each(callbacks, function(callback, callbackname) {
18        var callbackname = callbacks[callback];        if (options[callbackname] || false) {
19        // The callback depends on its type.          // The callback depends on its type.
20        if (typeof(options[callbackname]) == 'string') {          if (typeof(options[callbackname]) == 'string') {
21          // Strings are evaluated as functions.            // Strings are evaluated as functions.
22          options[callbackname] = eval(options[callbackname]);            options[callbackname] = eval(options[callbackname]);
23        }          }
24        else if (typeof(options[callbackname]) == 'object' && (options[callbackname] instanceof Array)) {          else if (typeof(options[callbackname]) == 'object' || (options[callbackname] instanceof Array)) {
25          // Arrays are evaluated as a list of callback registrations. This is because callbacks            // Arrays are evaluated as a list of callback registrations. This is because callbacks
26          // like itemVisibleInCallback can either be a function call back, or an array of callbacks            // like itemVisibleInCallback can either be a function call back, or an array of callbacks
27          // consisting of both onBeforeAnimation and onAfterAnimation.            // consisting of both onBeforeAnimation and onAfterAnimation.
28          for (subcallback in options[callbackname]) {            jQuery.each(options[callbackname], function(subcallbackname, subcallback) {
29            var name = options[callbackname][subcallback];              options[callbackname][subcallbackname] = eval(subcallback);
30            options[callbackname][name] = eval(options[callbackname][name]);            });
31          }          }
32        }        }
33      }      });
34    
35      // Prepare the skin name to be added as a class name.      // Prepare the skin name to be added as a class name.
36      var skin = options['skin'];      var skin = options['skin'];

Legend:
Removed from v.1.1.2.2.2.8  
changed lines
  Added in v.1.1.2.2.2.9

  ViewVC Help
Powered by ViewVC 1.1.2