summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/ajax.inc8
-rw-r--r--includes/batch.inc3
-rw-r--r--includes/common.inc6
-rw-r--r--includes/form.inc10
4 files changed, 11 insertions, 16 deletions
diff --git a/includes/ajax.inc b/includes/ajax.inc
index 24824a63f..899ab4547 100644
--- a/includes/ajax.inc
+++ b/includes/ajax.inc
@@ -604,8 +604,8 @@ function ajax_pre_render_element($element) {
// Attach JavaScript settings to the element.
if (isset($element['#ajax']['event'])) {
- $element['#attached']['library'][] = array('system', 'form');
- $element['#attached']['js']['misc/ajax.js'] = array('group' => JS_LIBRARY, 'weight' => 2);
+ $element['#attached']['library'][] = array('system', 'jquery.form');
+ $element['#attached']['library'][] = array('system', 'drupal.ajax');
$settings = $element['#ajax'];
@@ -667,10 +667,6 @@ function ajax_pre_render_element($element) {
$settings['progress']['url'] = url($settings['progress']['path']);
unset($settings['progress']['path']);
}
- // Add progress.js if we're doing a bar display.
- if ($settings['progress']['type'] == 'bar') {
- $element['#attached']['js']['misc/progress.js'] = array('cache' => FALSE);
- }
$element['#attached']['js'][] = array(
'type' => 'setting',
diff --git a/includes/batch.inc b/includes/batch.inc
index e4ddb06b9..1510a62e8 100644
--- a/includes/batch.inc
+++ b/includes/batch.inc
@@ -139,8 +139,7 @@ function _batch_progress_page_js() {
),
);
drupal_add_js($js_setting, 'setting');
- drupal_add_js('misc/progress.js', array('cache' => FALSE));
- drupal_add_js('misc/batch.js', array('cache' => FALSE));
+ drupal_add_library('system', 'drupal.batch');
return '<div id="progress"></div>';
}
diff --git a/includes/common.inc b/includes/common.inc
index 65a25fd9d..56e276980 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -3951,7 +3951,7 @@ function drupal_add_js($data = NULL, $options = NULL) {
);
// Register all required libraries.
drupal_add_library('system', 'jquery', TRUE);
- drupal_add_library('system', 'once', TRUE);
+ drupal_add_library('system', 'jquery.once', TRUE);
}
switch ($options['type']) {
@@ -4428,7 +4428,7 @@ function drupal_process_attached($elements, $group = JS_DEFAULT, $dependency_che
* @see form_example_states_form()
*/
function drupal_process_states(&$elements) {
- $elements['#attached']['js']['misc/states.js'] = array('group' => JS_LIBRARY, 'weight' => 1);
+ $elements['#attached']['library'][] = array('system', 'drupal.states');
$elements['#attached']['js'][] = array(
'type' => 'setting',
'data' => array('states' => array('#' . $elements['#id'] => $elements['#states'])),
@@ -4654,7 +4654,7 @@ function drupal_add_tabledrag($table_id, $action, $relationship, $group, $subgro
// Add the table drag JavaScript to the page before the module JavaScript
// to ensure that table drag behaviors are registered before any module
// uses it.
- drupal_add_js('misc/jquery.cookie.js', array('weight' => -2));
+ drupal_add_library('system', 'jquery.cookie');
drupal_add_js('misc/tabledrag.js', array('weight' => -1));
$js_added = TRUE;
}
diff --git a/includes/form.inc b/includes/form.inc
index de3e61ed8..3aae8cfa4 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -3380,7 +3380,7 @@ function form_process_fieldset(&$element, &$form_state) {
}
// Contains form element summary functionalities.
- $element['#attached']['js']['misc/form.js'] = array('group' => JS_LIBRARY, 'weight' => 1);
+ $element['#attached']['library'][] = array('system', 'drupal.form');
// The .form-wrapper class is required for #states to treat fieldsets like
// containers.
@@ -3390,7 +3390,7 @@ function form_process_fieldset(&$element, &$form_state) {
// Collapsible fieldsets
if (!empty($element['#collapsible'])) {
- $element['#attached']['js'][] = 'misc/collapse.js';
+ $element['#attached']['library'][] = array('system', 'drupal.collapse');
$element['#attributes']['class'][] = 'collapsible';
if (!empty($element['#collapsed'])) {
$element['#attributes']['class'][] = 'collapsed';
@@ -3506,7 +3506,7 @@ function form_process_vertical_tabs($element, &$form_state) {
function theme_vertical_tabs($variables) {
$element = $variables['element'];
// Add required JavaScript and Stylesheet.
- drupal_add_library('system', 'vertical-tabs');
+ drupal_add_library('system', 'drupal.vertical-tabs');
$output = '<h2 class="element-invisible">' . t('Vertical Tabs') . '</h2>';
$output .= '<div class="vertical-tabs-panes">' . $element['#children'] . '</div>';
@@ -3615,7 +3615,7 @@ function theme_textfield($variables) {
$extra = '';
if ($element['#autocomplete_path'] && drupal_valid_path($element['#autocomplete_path'])) {
- drupal_add_js('misc/autocomplete.js');
+ drupal_add_library('system', 'drupal.autocomplete');
$element['#attributes']['class'][] = 'form-autocomplete';
$attributes = array();
@@ -3677,7 +3677,7 @@ function theme_textarea($variables) {
// Add resizable behavior.
if (!empty($element['#resizable'])) {
- drupal_add_js('misc/textarea.js');
+ drupal_add_library('system', 'drupal.textarea');
$wrapper_attributes['class'][] = 'resizable';
}