Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ie_css_optimizer/README.txt,v
retrieving revision 1.1
diff -u -p -r1.1 README.txt
--- README.txt	20 Jul 2009 03:06:43 -0000	1.1
+++ README.txt	14 Jul 2010 10:01:59 -0000
@@ -38,8 +38,9 @@ INSTALLATION
       be aggregated into one file.
 
     Partial optimization for module CSS development
-      Optimize all stylesheets except for those in active development. In other
-      words, all the theme-level stylesheets will be aggregated into one file.
+      If this option is chosen an additional "Exclude module from CSS
+      optimization" option will appear. All stylesheets except for those
+      belonging to the selected module will be aggregated into one file.
 
     Full optimization
       This option can interfere with module/theme development, but should be
Index: ie-css-optimizer.js
===================================================================
RCS file: ie-css-optimizer.js
diff -N ie-css-optimizer.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ie-css-optimizer.js	14 Jul 2010 10:01:59 -0000
@@ -0,0 +1,27 @@
+// $Id$
+
+(function ($) {
+
+Drupal.behaviors.ie_css_optimizer = function (context) {
+  // This behavior attaches by ID, so is only valid once on a page.
+  if ($('#ie-css-optimizer-module.ie-css-optimizer-processed').size()) {
+    return;
+  }
+  $('#ie-css-optimizer-module', context).addClass('ie-css-optimizer-processed');
+
+  // Toggle display of "follow parent" if "follow" has been checked.
+  $('input[name=preprocess_css]', context).change( function() {
+    if ($('input[name=preprocess_css]:checked').val() == 'module') {
+      $('#ie-css-optimizer-module').slideDown('fast');
+    }
+    else {
+      $('#ie-css-optimizer-module').slideUp('fast');
+    }
+  } );
+  if ($('input[name=preprocess_css]:checked').val() != 'module') {
+    $('#ie-css-optimizer-module', context).css('display', 'none');
+  }
+
+};
+
+})(jQuery);
Index: ie_css_optimizer.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ie_css_optimizer/ie_css_optimizer.admin.inc,v
retrieving revision 1.4
diff -u -p -r1.4 ie_css_optimizer.admin.inc
--- ie_css_optimizer.admin.inc	18 Jul 2009 23:33:35 -0000	1.4
+++ ie_css_optimizer.admin.inc	14 Jul 2010 10:01:59 -0000
@@ -20,10 +20,37 @@ function _ie_css_optimizer_form_system_p
   // Alter the available options.
   unset($form['bandwidth_optimizations']['preprocess_css']['#options'][1]);
   $form['bandwidth_optimizations']['preprocess_css']['#options']['theme'] = t('Partial optimization for theme CSS development');
-//$form['bandwidth_optimizations']['preprocess_css']['#options']['module'] = t('Partial optimization for module CSS development');
+  $form['bandwidth_optimizations']['preprocess_css']['#options']['module'] = t('Partial optimization for module CSS development');
   $form['bandwidth_optimizations']['preprocess_css']['#options'][1] = t('Full optimization');
   $form['bandwidth_optimizations']['preprocess_css']['#description'] =
     t('<em>Disabled:</em> Not recommended. Internet Explorer is limited to 31 linked stylesheets and disabling CSS optimization can cause your website to display improperly in that browser.') . '<br />'
     . t('<em>Partial optimization for CSS development:</em> Optimize all stylesheets except for those in active development.') . '<br />'
     . t('<em>Full optimization:</em> This option can interfere with module/theme development, but should be enabled in a production environment.');
+
+  // Create a list of non-core modules.
+  $modules = array();
+  $contrib_modules = db_query("SELECT name, info FROM system WHERE status = 1 AND type = 'module' AND info NOT LIKE '%%%s%%'", 's:7:"package";s:15:"Core - ');
+  while ($module = db_fetch_array($contrib_modules)) {
+    $module['info'] = unserialize($module['info']);
+    $package = isset($module['info']['package']) ? $module['info']['package'] : 'Other';
+    $modules[$package][$module['name']] = $module['info']['name'];
+  }
+  ksort($modules);
+  foreach (array_keys($modules) as $package) {
+    asort($modules[$package]);
+  }
+
+  // Add an option to choose a specific module.
+  $form['bandwidth_optimizations']['preprocess_css']['#weight'] = -10;
+  $form['bandwidth_optimizations']['preprocess_css_module'] = array(
+    '#weight' => -9,
+    '#type' => 'select',
+    '#title' => t('Exclude module from CSS optimization'),
+    '#default_value' => variable_get('preprocess_css_module', ''),
+    '#options' => array('' => '<select one>') + $modules,
+    '#description' => t('The CSS files for the module selected will not be optimized with the other CSS.'),
+    '#prefix' => '<div id="ie-css-optimizer-module">',
+    '#suffix' => '</div>',
+  );
+  drupal_add_js(drupal_get_path('module', 'ie_css_optimizer') . '/ie-css-optimizer.js');
 }
Index: ie_css_optimizer.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ie_css_optimizer/ie_css_optimizer.module,v
retrieving revision 1.3
diff -u -p -r1.3 ie_css_optimizer.module
--- ie_css_optimizer.module	18 Jul 2009 23:36:16 -0000	1.3
+++ ie_css_optimizer.module	14 Jul 2010 10:01:59 -0000
@@ -8,7 +8,7 @@ function ie_css_optimizer_preprocess_pag
   $preprocess_css = variable_get('preprocess_css', 0);
   if ($preprocess_css == 'theme' || $preprocess_css == 'module') {
     module_load_include('inc', 'ie_css_optimizer', 'ie_css_optimizer.pages');
-    _ie_css_optimizer_preprocess_page($vars, $hook);
+    _ie_css_optimizer_preprocess_page($vars, $hook, $preprocess_css);
   }
 }
 
Index: ie_css_optimizer.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ie_css_optimizer/ie_css_optimizer.pages.inc,v
retrieving revision 1.3
diff -u -p -r1.3 ie_css_optimizer.pages.inc
--- ie_css_optimizer.pages.inc	18 Jul 2009 22:34:31 -0000	1.3
+++ ie_css_optimizer.pages.inc	14 Jul 2010 10:01:59 -0000
@@ -4,10 +4,6 @@
 /**
  * @file
  * Optimize CSS files for development in Internet Explorer.
- *
- * @TODO: Re-write this entire file to make patching core easier. Add a
- * ie_css_optimizer_get_css() that can be used as a drop-in replacement for
- * drupal_get_css().
  */
 
 /**
@@ -18,56 +14,71 @@
  * @param $hook
  *   The name of the template being rendered ("page" in this case.)
  */
-function _ie_css_optimizer_preprocess_page(&$vars, $hook) {
+function _ie_css_optimizer_preprocess_page(&$vars, $hook, $preprocess_css) {
   // Count the number of link tags that will be used.
   $number_of_link_tags = 0;
   $style_imports = array();
-
-  // Check for Conditional Stylesheet's link tags.
   $conditional_styles = variable_get('conditional_styles_' . $GLOBALS['theme'], '');
-  $number_of_link_tags += substr_count($conditional_styles, '<link');
 
-  // $vars['directory'] points at the page.tpl.php, which may not be in the
-  // active theme. So we create our own path to theme.
-  $themes = list_themes();
-  $theme_path = dirname($themes[$GLOBALS['theme']]->filename);
-
-  // Loop through all of the stylesheets.
-  foreach (array_keys($vars['css']) AS $media) {
-    // Each media type is aggregated separately.
-    $number_of_link_tags++;
-    foreach (array_keys($vars['css'][$media]) AS $type) {
-      if ($type == 'module') {
-        // Setup theme overrides for module styles.
-        $theme_styles = array();
-        foreach (array_keys($vars['css'][$media]['theme']) as $theme_style) {
-          $theme_styles[] = basename($theme_style);
-        }
-      }
-      foreach (array_keys($vars['css'][$media][$type]) AS $path) {
-        // If the theme supplies its own style using the name of the module style, skip its inclusion.
-        // This includes any RTL styles associated with its main LTR counterpart.
-        if ($type == 'module' && in_array(str_replace('-rtl.css', '.css', basename($path)), $theme_styles)) {
-          // Unset the file to prevent its inclusion when CSS aggregation is enabled.
-          unset($vars['css'][$media][$type][$path]);
-          continue;
-        }
-        // Exempt the active theme's styles from aggregation.
-        if ($type == 'theme' && strpos($path, $theme_path) === 0) {
-          if ($number_of_link_tags < 31) {
-            // Implement the style using its own link tag.
-            $vars['css'][$media][$type][$path] = FALSE;
-            $number_of_link_tags++;
+  if ($preprocess_css == 'theme') {
+    // Check for Conditional Stylesheet's link tags.
+    if (module_exists('conditional_styles')) {
+      $number_of_link_tags += substr_count($conditional_styles, '<link');
+    }
+
+    // $vars['directory'] points at the page.tpl.php, which may not be in the
+    // active theme. So we create our own path to theme.
+    $themes = list_themes();
+    $theme_path = dirname($themes[$GLOBALS['theme']]->filename);
+
+    // Loop through all of the stylesheets.
+    foreach (array_keys($vars['css']) as $media) {
+      // Each media type is aggregated separately.
+      $number_of_link_tags++;
+      foreach (array_keys($vars['css'][$media]) as $type) {
+        if ($type == 'module') {
+          // Setup theme overrides for module styles.
+          $theme_styles = array();
+          foreach (array_keys($vars['css'][$media]['theme']) as $theme_style) {
+            $theme_styles[] = basename($theme_style);
           }
-          else {
-            // Implement the style using an @import statement.
-            $style_imports[$media][] = $path;
+        }
+        foreach (array_keys($vars['css'][$media][$type]) as $path) {
+          // If the theme supplies its own style using the name of the module style, skip its inclusion.
+          // This includes any RTL styles associated with its main LTR counterpart.
+          if ($type == 'module' && in_array(str_replace('-rtl.css', '.css', basename($path)), $theme_styles)) {
+            // Unset the file to prevent its inclusion when CSS aggregation is enabled.
             unset($vars['css'][$media][$type][$path]);
+            continue;
+          }
+          // Exempt the active theme's styles from aggregation.
+          if ($type == 'theme' && strpos($path, $theme_path) === 0) {
+            if ($number_of_link_tags < 31) {
+              // Implement the style using its own link tag.
+              $vars['css'][$media][$type][$path] = FALSE;
+              $number_of_link_tags++;
+            }
+            else {
+              // Implement the style using an @import statement.
+              $style_imports[$media][] = $path;
+              unset($vars['css'][$media][$type][$path]);
+            }
+          }
+          // Some module styles are marked as exempt from aggregation.
+          elseif (!$vars['css'][$media][$type][$path]) {
+            $number_of_link_tags++;
           }
         }
-        // Some module styles are marked as exempt from aggregation.
-        elseif (!$vars['css'][$media][$type][$path]) {
-          $number_of_link_tags++;
+      }
+    }
+  }
+  elseif ($module = variable_get('preprocess_css_module', '')) {
+    $path = drupal_get_path('module', $module);
+    // Loop through all of the stylesheets.
+    foreach (array_keys($vars['css']) as $media) {
+      foreach (array_keys($vars['css'][$media]['module']) as $style) {
+        if (strpos($style, $path) === 0) {
+          $vars['css'][$media]['module'][$style] = FALSE;
         }
       }
     }
@@ -78,9 +89,9 @@ function _ie_css_optimizer_preprocess_pa
 
   // If we have over 31 link tags, include the @import stylesheets.
   if (!empty($style_imports)) {
-    foreach (array_keys($style_imports) AS $media) {
+    foreach (array_keys($style_imports) as $media) {
       $output = '';
-      foreach ($style_imports[$media] AS $path) {
+      foreach ($style_imports[$media] as $path) {
         if (file_exists($path)) {
           $output .= '  @import "' . $vars['base_path'] . $path . '";' . "\n";
         }
