Index: includes/modal.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/includes/modal.inc,v
retrieving revision 1.7.2.3
diff -u -p -r1.7.2.3 modal.inc
--- includes/modal.inc	16 Jun 2010 17:32:30 -0000	1.7.2.3
+++ includes/modal.inc	2 Aug 2010 23:12:14 -0000
@@ -48,13 +48,13 @@ function ctools_modal_add_js() {
     return;
   }
 
-  $settings = array('CToolsModal' => array(
-    'closeText' => t('Close Window'),
-    'closeImage' => theme('image', ctools_image_path('icon-close-window.png'), t('Close window'), t('Close window')),
-    'throbber' => theme('image', ctools_image_path('throbber.gif'), t('Loading...'), t('Loading')),
-    'backDropOpacity' => '.55',
-    'backDropColor' => '#fff'
-  ));
+  $settings = array(
+    'CToolsModal' => array(
+      'closeText' => t('Close Window'),
+      'closeImage' => theme('image', ctools_image_path('icon-close-window.png'), t('Close window'), t('Close window')),
+      'throbber' => theme('image', ctools_image_path('throbber.gif'), t('Loading...'), t('Loading')),
+    ),
+  );
 
   drupal_add_js($settings, 'setting');
   drupal_add_js('misc/jquery.form.js');
Index: js/modal.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ctools/js/modal.js,v
retrieving revision 1.17.2.14
diff -u -p -r1.17.2.14 modal.js
--- js/modal.js	22 Jul 2010 22:26:04 -0000	1.17.2.14
+++ js/modal.js	2 Aug 2010 23:12:15 -0000
@@ -16,37 +16,79 @@
 
   /**
    * Display the modal
+   *
+   * @todo -- document the settings.
    */
-  Drupal.CTools.Modal.show = function() {
+  Drupal.CTools.Modal.show = function(choice) {
+    var opts = {};
+
+    if (choice && typeof choice == 'string' && Drupal.settings[choice]) {
+      // This notation guarantees we are actually copying it.
+      $.extend(opts, Drupal.settings[choice]);
+    }
+    else if (choice) {
+      $.extend(opts, choice);
+    }
+
+    var defaults = {
+      modalTheme: 'CToolsModalDialog',
+      throbberTheme: 'CToolsModalThrobber',
+      animation: 'show',
+      animationSpeed: 'fast',
+      modalSize: {
+        type: 'scale',
+        width: .8,
+        height: .8
+      },
+      modalOptions: {
+        opacity: .55,
+        background: '#fff'
+      }
+    };
+
+    var empty = {};
+    opts = $.extend(empty, Drupal.settings.CToolsModal, opts);
+
+    empty = {};
+    var settings = $.extend(empty, defaults, opts);
+
     var resize = function(e) {
-      // For reasons I do not understand, when creating the modal the context must be
-      // Drupal.CTools.Modal.modal but otherwise the context must be more than that.
+      // When creating the modal, it actually exists only in a theoretical
+      // place that is not in the DOM. But once the modal exists, it is in the
+      // DOM so the context must be set appropriately.
       var context = e ? document : Drupal.CTools.Modal.modal;
+
+      if (settings.modalSize.type == 'scale') {
+        var width = $(window).width() * settings.modalSize.width;
+        var height = $(window).height() * settings.modalSize.height;
+      }
+      else {
+        var width = settings.modalSize.width;
+        var height = settings.modalSize.height;
+      }
+
       $('div.ctools-modal-content', context).css({
-        'width': $(window).width() * .8 + 'px',
-        'height': $(window).height() * .8 + 'px'
+        'width': width + 'px',
+        'height': height + 'px'
       });
       $('div.ctools-modal-content .modal-content', context).css({
-        'width': ($(window).width() * .8 - 25) + 'px',
-        'height': ($(window).height() * .8 - 35) + 'px'
+        'width': (width - 25) + 'px',
+        'height': (height - 42) + 'px'
       });
     }
 
     if (!Drupal.CTools.Modal.modal) {
-      Drupal.CTools.Modal.modal = $(Drupal.theme('CToolsModalDialog'));
-      $(window).bind('resize', resize);
+      Drupal.CTools.Modal.modal = $(Drupal.theme(settings.modalTheme));
+      if (settings.modalSize.type == 'scale') {
+        $(window).bind('resize', resize);
+      }
     }
 
     resize();
-    $('span.modal-title', Drupal.CTools.Modal.modal).html(Drupal.t('Loading...'));
-    var opts = {
-      // @todo this should be elsewhere.
-      opacity: Drupal.settings.CToolsModal.backDropOpacity,
-      background: Drupal.settings.CToolsModal.backDropColor
-    };
 
-    Drupal.CTools.Modal.modalContent(Drupal.CTools.Modal.modal, opts);
-    $('#modalContent .modal-content').html(Drupal.theme('CToolsModalThrobber'));
+    $('span.modal-title', Drupal.CTools.Modal.modal).html(Drupal.t('Loading...'));
+    Drupal.CTools.Modal.modalContent(Drupal.CTools.Modal.modal, settings.modalOptions, settings.animation, settings.animationSpeed);
+    $('#modalContent .modal-content').html(Drupal.theme(settings.throbberTheme));
   };
 
   /**
@@ -94,10 +136,20 @@
   };
 
   /**
+   * Figure out what settings string to use to display a modal.
+   */
+  Drupal.CTools.Modal.getSettings = function (object) {
+    var match = $(object).attr('class').match(/ctools-modal-(\S+)/);
+    if (match) {
+      return match[1];
+    }
+  }
+
+  /**
    * Click function for modals that can be cached.
    */
   Drupal.CTools.Modal.clickAjaxCacheLink = function () {
-    Drupal.CTools.Modal.show();
+    Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(this));
     return Drupal.CTools.AJAX.clickAJAXCacheLink.apply(this);
   };
 
@@ -107,7 +159,7 @@
    */
   Drupal.CTools.Modal.clickAjaxLink = function () {
     // show the empty dialog right away.
-    Drupal.CTools.Modal.show();
+    Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(this));
     Drupal.CTools.AJAX.clickAJAXLink.apply(this);
     if (!$(this).hasClass('ctools-ajaxing')) {
       Drupal.CTools.Modal.dismiss();
@@ -125,7 +177,7 @@
       return false;
     }
 
-    Drupal.CTools.Modal.show();
+    Drupal.CTools.Modal.show(Drupal.CTools.Modal.getSettings(this));
     Drupal.CTools.AJAX.clickAJAXButton.apply(this);
     if (!$(this).hasClass('ctools-ajaxing')) {
       Drupal.CTools.Modal.dismiss();
