Index: media.module
===================================================================
--- media.module	(revision 20903)
+++ media.module	(working copy)
@@ -464,7 +464,7 @@
       'redirect' => 'media/%fids/multiedit'
     ),
   );
-  
+
   if (!module_exists('multiform')) {
     // If the multiform module is not installed, do not show this option.
     unset($operations['edit']);
@@ -474,7 +474,7 @@
 
 /**
  * Implementation of hook_forms()
- */ 
+ */
 function media_forms($form_id, $args) {
   $forms = array();
   // To support the multiedit form, each form has to have a unique ID.
@@ -513,7 +513,7 @@
  *
  * @return array
  *  An array of corresponding media entities.
- */ 
+ */
 function media_multi_load($fids) {
   $fids = explode(" ", $fids);
   if ($files = media_load_multiple($fids)) {
@@ -687,9 +687,9 @@
   $libraries['media_base'] = array(
     'title' => 'Media base',
     'js' => array(
-      $path . '/javascript/media.core.js' => array('weight' => JS_LIBRARY - 5),
-      $path . '/javascript/util/json2.js' => array('weight' => JS_LIBRARY),
-      $path . '/javascript/util/ba-debug.min.js' => array('weight' => JS_LIBRARY),
+      $path . '/javascript/media.core.js' => array('group' => JS_LIBRARY, 'weight' => - 5),
+      $path . '/javascript/util/json2.js' => array('group' => JS_LIBRARY),
+      $path . '/javascript/util/ba-debug.min.js' => array('group' => JS_LIBRARY),
     ),
     'css' => array(
       $path . '/css/media.css',
@@ -703,7 +703,7 @@
   $libraries['media_browser'] = array(
     'title' => 'Media Browser popup libraries',
     'js' => array(
-      $path . '/javascript/media.popups.js' => array('weight' => JS_DEFAULT),
+      $path . '/javascript/media.popups.js' => array('group' => JS_DEFAULT),
     ),
     'dependencies' => array(
       array('media', 'media_base'),
@@ -719,7 +719,7 @@
   $libraries['media_browser_page'] = array(
     'title' => 'Media browser',
     'js' => array(
-      $path . '/javascript/media-browser.js'  => array('weight' => JS_DEFAULT),
+      $path . '/javascript/media-browser.js'  => array('group' => JS_DEFAULT),
     ),
     'css' => array(
       $path . '/css/media.browser.css' => array('weight' => CSS_DEFAULT),
@@ -1028,10 +1028,10 @@
     'type' => 'setting',
     'data' => $setting,
   );
-  
+
   // hmm... Might need to think about this.
   // All settings would likely apply to all media in a multi-value, but what about passing the existing fid?
-  
+
   module_load_include('inc', 'media', 'media.browser');
   media_include_browser_js();
 
@@ -1143,6 +1143,6 @@
   if (!in_array(media_get_type($file), $types)) {
     $errors[] = t('Only the following types of files are allowed to be uploaded: %types-allowed', array('%types-allowed' => implode(', ', $types)));
   }
-  
+
   return $errors;
 }
