summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-11-30 17:16:37 +0000
committerDries Buytaert <dries@buytaert.net>2010-11-30 17:16:37 +0000
commitb1177ba603e3fe62c568a9a236cc371aefafc2dc (patch)
tree89f4d9f843eb500c6754edc1e8cd5358da2695e5 /modules
parent732b57d10d0b344510e35d6223f36eecf62c0821 (diff)
downloadbrdo-b1177ba603e3fe62c568a9a236cc371aefafc2dc.tar.gz
brdo-b1177ba603e3fe62c568a9a236cc371aefafc2dc.tar.bz2
- Patch #954804 by ksenzee, merlinofchaos: all .js in /misc should be registered as a library.
Diffstat (limited to 'modules')
-rw-r--r--modules/comment/comment.module2
-rw-r--r--modules/contact/contact.pages.inc4
-rw-r--r--modules/openid/openid.module2
-rw-r--r--modules/overlay/overlay.module2
-rw-r--r--modules/system/system.module106
-rw-r--r--modules/toolbar/toolbar.module2
-rw-r--r--modules/user/user.module2
7 files changed, 108 insertions, 12 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index aa7f2ad47..96b399b77 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -1852,7 +1852,7 @@ function comment_form($form, &$form_state, $comment) {
$is_admin = (!empty($comment->cid) && user_access('administer comments'));
if (!$user->uid && $anonymous_contact != COMMENT_ANONYMOUS_MAYNOT_CONTACT) {
- $form['#attached']['library'][] = array('system', 'cookie');
+ $form['#attached']['library'][] = array('system', 'jquery.cookie');
$form['#attributes']['class'][] = 'user-info-from-cookie';
}
diff --git a/modules/contact/contact.pages.inc b/modules/contact/contact.pages.inc
index 50156f3f7..662896b1b 100644
--- a/modules/contact/contact.pages.inc
+++ b/modules/contact/contact.pages.inc
@@ -57,7 +57,7 @@ function contact_site_form($form, &$form_state) {
}
if (!$user->uid) {
- $form['#attached']['library'][] = array('system', 'cookie');
+ $form['#attached']['library'][] = array('system', 'jquery.cookie');
$form['#attributes']['class'][] = 'user-info-from-cookie';
}
@@ -187,7 +187,7 @@ function contact_personal_form($form, &$form_state, $recipient) {
drupal_set_title(t('Contact @username', array('@username' => format_username($recipient))), PASS_THROUGH);
if (!$user->uid) {
- $form['#attached']['library'][] = array('system', 'cookie');
+ $form['#attached']['library'][] = array('system', 'jquery.cookie');
$form['#attributes']['class'][] = 'user-info-from-cookie';
}
diff --git a/modules/openid/openid.module b/modules/openid/openid.module
index 3e1b2c96b..0ab7c7065 100644
--- a/modules/openid/openid.module
+++ b/modules/openid/openid.module
@@ -137,7 +137,7 @@ function openid_form_user_login_alter(&$form, &$form_state) {
function _openid_user_login_form_alter(&$form, &$form_state) {
$form['#attached']['css'][] = drupal_get_path('module', 'openid') . '/openid.css';
$form['#attached']['js'][] = drupal_get_path('module', 'openid') . '/openid.js';
- $form['#attached']['library'][] = array('system', 'cookie');
+ $form['#attached']['library'][] = array('system', 'jquery.cookie');
if (!empty($form_state['input']['openid_identifier'])) {
$form['name']['#required'] = FALSE;
$form['pass']['#required'] = FALSE;
diff --git a/modules/overlay/overlay.module b/modules/overlay/overlay.module
index e278a0174..7cf44b95c 100644
--- a/modules/overlay/overlay.module
+++ b/modules/overlay/overlay.module
@@ -206,7 +206,7 @@ function overlay_library() {
),
'dependencies' => array(
array('system', 'ui'),
- array('system', 'jquery-bbq'),
+ array('system', 'jquery.bbq'),
),
);
// Overlay child.
diff --git a/modules/system/system.module b/modules/system/system.module
index 4459683d4..5d2e91f17 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1079,6 +1079,89 @@ function _system_batch_theme() {
* Implements hook_library().
*/
function system_library() {
+ // Drupal's AJAX framework.
+ $libraries['drupal.ajax'] = array(
+ 'title' => 'Drupal AJAX',
+ 'website' => 'http://api.drupal.org/api/drupal/includes--ajax.inc/group/ajax/7',
+ 'version' => VERSION,
+ 'js' => array(
+ 'misc/ajax.js' => array('group' => JS_LIBRARY, 'weight' => 2),
+ ),
+ 'dependencies' => array(
+ array('system', 'drupal.progress'),
+ ),
+ );
+
+ // Drupal's batch API.
+ $libraries['drupal.batch'] = array(
+ 'title' => 'Drupal batch API',
+ 'version' => VERSION,
+ 'js' => array(
+ 'misc/batch.js' => array('cache' => FALSE),
+ ),
+ 'dependencies' => array(
+ array('system', 'drupal.progress'),
+ ),
+ );
+
+ // Drupal's progress indicator.
+ $libraries['drupal.progress'] = array(
+ 'title' => 'Drupal progress indicator',
+ 'version' => VERSION,
+ 'js' => array(
+ 'misc/progress.js' => array('cache' => FALSE),
+ ),
+ );
+
+ // Drupal's form library.
+ $libraries['drupal.form'] = array(
+ 'title' => 'Drupal form library',
+ 'version' => VERSION,
+ 'js' => array(
+ 'misc/form.js' => array('group' => JS_LIBRARY, 'weight' => 1),
+ ),
+ );
+
+ // Drupal's states library.
+ $libraries['drupal.states'] = array(
+ 'title' => 'Drupal states',
+ 'version' => VERSION,
+ 'js' => array(
+ 'misc/states.js' => array('group' => JS_LIBRARY, 'weight' => 1),
+ ),
+ );
+
+ // Drupal's collapsible fieldset.
+ $libraries['drupal.collapse'] = array(
+ 'title' => 'Drupal collapsible fieldset',
+ 'version' => VERSION,
+ 'js' => array(
+ 'misc/collapse.js' => array(),
+ ),
+ 'dependencies' => array(
+ // collapse.js relies on drupalGetSummary in form.js
+ array('system', 'drupal.form'),
+ ),
+ );
+
+ // Drupal's resizable textarea.
+ $libraries['drupal.textarea'] = array(
+ 'title' => 'Drupal resizable textarea',
+ 'version' => VERSION,
+ 'js' => array(
+ 'misc/textarea.js' => array(),
+ ),
+ );
+
+ // Drupal's autocomplete widget.
+ $libraries['drupal.autocomplete'] = array(
+ 'title' => 'Drupal autocomplete',
+ 'version' => VERSION,
+ 'js' => array(
+ 'misc/autocomplete.js' => array(),
+ ),
+ );
+
// jQuery.
$libraries['jquery'] = array(
'title' => 'jQuery',
@@ -1090,7 +1173,7 @@ function system_library() {
);
// jQuery Once.
- $libraries['once'] = array(
+ $libraries['jquery.once'] = array(
'title' => 'jQuery Once',
'website' => 'http://plugins.jquery.com/project/once',
'version' => '1.2',
@@ -1100,7 +1183,7 @@ function system_library() {
);
// jQuery Form Plugin.
- $libraries['form'] = array(
+ $libraries['jquery.form'] = array(
'title' => 'jQuery Form Plugin',
'website' => 'http://malsup.com/jquery/form/',
'version' => '2.49',
@@ -1110,7 +1193,7 @@ function system_library() {
);
// jQuery BBQ plugin.
- $libraries['jquery-bbq'] = array(
+ $libraries['jquery.bbq'] = array(
'title' => 'jQuery BBQ',
'website' => 'http://benalman.com/projects/jquery-bbq-plugin/',
'version' => '1.2.1',
@@ -1120,7 +1203,7 @@ function system_library() {
);
// Vertical Tabs.
- $libraries['vertical-tabs'] = array(
+ $libraries['drupal.vertical-tabs'] = array(
'title' => 'Vertical Tabs',
'website' => 'http://drupal.org/node/323112',
'version' => '1.0',
@@ -1130,6 +1213,10 @@ function system_library() {
'css' => array(
'misc/vertical-tabs.css' => array(),
),
+ 'dependencies' => array(
+ // Vertical tabs relies on drupalGetSummary in form.js
+ array('system', 'drupal.form'),
+ ),
);
// Farbtastic.
@@ -1146,7 +1233,7 @@ function system_library() {
);
// Cookie.
- $libraries['cookie'] = array(
+ $libraries['jquery.cookie'] = array(
'title' => 'Cookie',
'website' => 'http://plugins.jquery.com/project/cookie',
'version' => '1.0',
@@ -1536,6 +1623,15 @@ function system_library() {
),
);
+ // These library names are deprecated. Earlier versions of Drupal 7 didn't
+ // consistently namespace their libraries, so these names are included for
+ // backwards compatibility with those versions.
+ $libraries['once'] = &$libraries['jquery.once'];
+ $libraries['form'] = &$libraries['jquery.form'];
+ $libraries['jquery-bbq'] = &$libraries['jquery.bbq'];
+ $libraries['vertical-tabs'] = &$libraries['drupal.vertical-tabs'];
+ $libraries['cookie'] = &$libraries['jquery.cookie'];
+
return $libraries;
}
diff --git a/modules/toolbar/toolbar.module b/modules/toolbar/toolbar.module
index af39ac41b..bd774c5ee 100644
--- a/modules/toolbar/toolbar.module
+++ b/modules/toolbar/toolbar.module
@@ -188,7 +188,6 @@ function toolbar_view() {
'#attached'=> array(
'js' => array(
$module_path . '/toolbar.js',
- array('data' => 'misc/jquery.cookie.js', 'group' => JS_LIBRARY, 'weight' => 2),
array(
'data' => array('tableHeaderOffset' => 'Drupal.toolbar.height'),
'type' => 'setting'
@@ -197,6 +196,7 @@ function toolbar_view() {
'css' => array(
$module_path . '/toolbar.css',
),
+ 'library' => array(array('system', 'jquery.cookie')),
),
);
diff --git a/modules/user/user.module b/modules/user/user.module
index 96c26e0f4..67d8ee549 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -3540,7 +3540,7 @@ function user_register_form($form, &$form_state) {
$form['#user'] = drupal_anonymous_user();
$form['#user_category'] = 'register';
- $form['#attached']['library'][] = array('system', 'cookie');
+ $form['#attached']['library'][] = array('system', 'jquery.cookie');
$form['#attributes']['class'][] = 'user-info-from-cookie';
// Start with the default user account fields.