Index: colorbox.api.php
===================================================================
RCS file: colorbox.api.php
diff -N colorbox.api.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ colorbox.api.php	7 Jun 2010 14:59:43 -0000
@@ -0,0 +1,27 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * API documentation for the colorbox module.
+ */
+
+/**
+ * Allows to override Colorbox settings and style.
+ *
+ * @param $settings
+ *   An associative array of Colorbox settings. See the
+ *   @link http://colorpowered.com/colorbox/ Colorbox documentation @endlink
+ *   for the full list of supported parameters.
+ * @param $style
+ *   The name of the active style plugin.
+ */
+function hook_colorbox_settings_alter(&$settings, &$style) {
+  // Disable automatic downscaling of images to maxWidth/maxHeight size.
+  $settings['scalePhotos'] = FALSE;
+
+  // Use custom style plugin specifically for node/123.
+  if ($_GET['q'] == 'node/123') {
+    $style = 'mystyle';
+  }
+}
Index: colorbox.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/colorbox/colorbox.module,v
retrieving revision 1.19
diff -u -p -r1.19 colorbox.module
--- colorbox.module	18 May 2010 07:29:41 -0000	1.19
+++ colorbox.module	7 Jun 2010 15:14:07 -0000
@@ -142,18 +142,6 @@ function _colorbox_doheader() {
     return; // Don't add the JavaScript and CSS on specified paths.
   }
 
-  $path = drupal_get_path('module', 'colorbox');
-  $style = variable_get('colorbox_style', 'default');
-  switch ($style) {
-    case 'default':
-      drupal_add_css($path .'/styles/default/colorbox_default_style.css');
-      break;
-    case 'none':
-      break;
-    default:
-      drupal_add_css($style .'/colorbox.css');
-  }
-
   // Insert options and translated strings as javascript settings.
   if (variable_get('colorbox_custom_settings_activate', 0)) {
     $js_settings = array(
@@ -161,17 +149,17 @@ function _colorbox_doheader() {
       'speed' => variable_get('colorbox_transition_speed', 350),
       'opacity' => variable_get('colorbox_opacity', '0.9'),
       'slideshow' => variable_get('colorbox_slideshow', 0) ? TRUE : FALSE,
-      'slideshowauto' => variable_get('colorbox_slideshowauto', 1) ? TRUE : FALSE,
-      'slideshowspeed' => variable_get('colorbox_slideshowspeed', 2500),
-      'slideshowstart' => variable_get('colorbox_text_start', 'start slideshow'),
-      'slideshowstop' => variable_get('colorbox_text_stop', 'stop slideshow'),
+      'slideshowAuto' => variable_get('colorbox_slideshowauto', 1) ? TRUE : FALSE,
+      'slideshowSpeed' => variable_get('colorbox_slideshowspeed', 2500),
+      'slideshowStart' => variable_get('colorbox_text_start', 'start slideshow'),
+      'slideshowStop' => variable_get('colorbox_text_stop', 'stop slideshow'),
       'current' => variable_get('colorbox_text_current', '{current} of {total}'),
       'previous' => variable_get('colorbox_text_previous', '« Prev'),
       'next' => variable_get('colorbox_text_next', 'Next »'),
       'close' => variable_get('colorbox_text_close', 'Close'),
-      'overlayclose' => variable_get('colorbox_overlayclose', 1) ? TRUE : FALSE,
-      'maxwidth' => variable_get('colorbox_maxwidth', '100%'),
-      'maxheight' => variable_get('colorbox_maxheight', '100%'),
+      'overlayClose' => variable_get('colorbox_overlayclose', 1) ? TRUE : FALSE,
+      'maxWidth' => variable_get('colorbox_maxwidth', '100%'),
+      'maxHeight' => variable_get('colorbox_maxheight', '100%'),
     );
   }
   else {
@@ -180,19 +168,41 @@ function _colorbox_doheader() {
       'speed' => 350,
       'opacity' => '0.85',
       'slideshow' => FALSE,
-      'slideshowauto' => FALSE,
-      'slideshowspeed' => 2500,
-      'slideshowstart' => '',
-      'slideshowstop' => '',
+      'slideshowAuto' => FALSE,
+      'slideshowSpeed' => 2500,
+      'slideshowStart' => '',
+      'slideshowStop' => '',
       'current' => t('{current} of {total}'),
       'previous' => t('« Prev'),
       'next' => t('Next »'),
       'close' => t('Close'),
-      'overlayclose' => TRUE,
-      'maxwidth' => '100%',
-      'maxheight' => '100%',
+      'overlayClose' => TRUE,
+      'maxWidth' => '100%',
+      'maxHeight' => '100%',
     );
   }
+
+  $path = drupal_get_path('module', 'colorbox');
+  $style = variable_get('colorbox_style', 'default');
+
+  // Give other modules the possibility to override Colorbox settings and
+  // style.
+  $data = &$js_settings;
+  $data['__drupal_alter_by_ref'] = array(&$style);
+  drupal_alter('colorbox_settings', $data);
+
+  // Add CSS based on selected style.
+  switch ($style) {
+    case 'none':
+      break;
+    case 'default':
+      drupal_add_css($path .'/styles/default/colorbox_default_style.css');
+      break;
+    default:
+      drupal_add_css($path .'/styles/'. $style .'/colorbox.css');
+      break;
+  }
+
   drupal_add_js(array('colorbox' => $js_settings), 'setting');
 
   if (module_exists('image') && variable_get('colorbox_auto_image_nodes', 0)) {
Index: js/colorbox.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/colorbox/js/colorbox.js,v
retrieving revision 1.6
diff -u -p -r1.6 colorbox.js
--- js/colorbox.js	18 Apr 2010 15:49:38 -0000	1.6
+++ js/colorbox.js	7 Jun 2010 14:51:27 -0000
@@ -2,24 +2,10 @@
 (function ($) {
 
 Drupal.behaviors.initColorbox = function (context) {
-  var settings = Drupal.settings.colorbox;
-  $('a, area, input', context).filter('.colorbox:not(.initColorbox-processed)').addClass('initColorbox-processed').colorbox({
-    transition:settings.transition,
-    speed:settings.speed,
-    opacity:settings.opacity,
-    slideshow:settings.slideshow,
-    slideshowSpeed:settings.slideshowspeed,
-    slideshowAuto:settings.slideshowauto,
-    slideshowStart:settings.slideshowstart,
-    slideshowStop:settings.slideshowstop,
-    current:settings.current,
-    previous:settings.previous,
-    next:settings.next,
-    close:settings.close,
-    overlayClose:settings.overlayclose,
-    maxWidth:settings.maxwidth,
-    maxHeight:settings.maxheight
-  });
+  $('a, area, input', context)
+    .filter('.colorbox:not(.initColorbox-processed)')
+    .addClass('initColorbox-processed')
+    .colorbox(Drupal.settings.colorbox);
 };
 
 })(jQuery);
