--- javascript_aggregator.module
+++ javascript_aggregator.module
@@ -1,5 +1,5 @@
 <?php
-// $Id: javascript_aggregator.module,v 1.17.2.13 2009/05/23 14:54:49 derjochenmeyer Exp $
+// $Id: javascript_aggregator.module,v 1.17.2.12 2009/05/23 14:12:12 derjochenmeyer Exp $
 
 /**
  * Implementation of hook_help().
@@ -28,6 +28,13 @@
       '#default_value' => variable_get('javascript_aggregator_gzip', FALSE),
       '#weight' => 3,
     );
+    $form['bandwidth_optimizations']['javascript_aggregator_jsminplus'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use JSMin+ instead of JSMin'),
+      '#description' => t('Check this option to use <a href="@jsminplus">JSMin+</a> instead of JSMin.', array('@jsminplus' => 'http://crisp.tweakblogs.net/blog/1665/a-new-javascript-minifier-jsmin+.html')),
+      '#default_value' => variable_get('javascript_aggregator_jsminplus', FALSE),
+      '#weight' => 4,
+    );
   }
 }
 
@@ -92,9 +99,16 @@
 
     // Create the JSMinified file if it doesn't exist yet.
     if (!file_exists($jsmin_file_path)) {
-      // JSMin the contents of the aggregated file.
-      require_once(drupal_get_path('module', 'javascript_aggregator') .'/jsmin.php');
-      $contents = JSMin::minify(file_get_contents(file_directory_path() . $aggregated_file));
+      if (variable_get('javascript_aggregator_jsminplus', FALSE)) {
+        // JSMin+ the contents of the aggregated file.
+        require_once(drupal_get_path('module', 'javascript_aggregator') .'/jsminplus.php');
+        $contents = JSMinPlus::minify(file_get_contents(file_directory_path() . $aggregated_file));
+      }
+      else {
+        // JSMin the contents of the aggregated file.
+        require_once(drupal_get_path('module', 'javascript_aggregator') .'/jsmin.php');
+        $contents = JSMin::minify(file_get_contents(file_directory_path() . $aggregated_file));
+      }
 
       // GZip the JavaScript if required.
       $htaccess = file_directory_path() . '/js/.htaccess';
