diff --git a/core/core.library.yml b/core/core.library.yml index 74ee00aa..c834afa 100644 --- a/core/core.library.yml +++ b/core/core.library.yml @@ -1,8 +1,26 @@ +backbone: + remote: https://github.com/jashkenas/backbone/ + version: 0.9.2 + js: + - { file: assets/vendor/backbone/backbone.js, group: -100, weight: -19 } + dependencies: + - core/underscore + ckeditor: - version: VERSION + remote: https://github.com/ckeditor/ckeditor-dev + # @todo Stable release required for Drupal 8.0. + version: 4.2-dev + commit: 887d81ac1824008b690e439a1b29eb4f13b51212 js: - { file: assets/vendor/ckeditor/ckeditor.js, preprocess: false } +domready: + remote: https://github.com/ded/domready + # @todo Stable release required for Drupal 8.0. + version: master + js: + - { file: assets/vendor/domready/ready.min.js, group: -100, weight: -21 } + drupal: version: VERSION js: @@ -34,6 +52,17 @@ drupal.announce: - core/drupal - core/drupal.debounce +drupal.autocomplete: + version: VERSION + js: + - { file: misc/autocomplete.js, group: -100, weight: -1 } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/drupal.ajax + - core/jquery.ui.autocomplete + drupal.batch: version: VERSION js: @@ -46,24 +75,23 @@ drupal.batch: - core/drupal.progress - core/jquery.once -drupal.progress: +drupal.collapse: version: VERSION js: - - { file: misc/progress.js, group: 0 } + - { file: misc/collapse.js, group: 0 } dependencies: - - core/drupal - core/jquery - - core/drupalSettings + - core/modernizr + - core/drupal + - core/drupal.form + - core/jquery.once -drupal.form: +drupal.debounce: version: VERSION js: - - { file: misc/form.js, group: -100, weight: 1 } + - { file: misc/debounce.js, group: -100 } dependencies: - - core/jquery - core/drupal - - core/jquery.cookie - - core/jquery.once drupal.dialog: version: VERSION @@ -91,67 +119,66 @@ drupal.dialog.ajax: - core/drupal.ajax - core/drupal.dialog -drupal.states: +drupal.displace: version: VERSION js: - - { file: misc/states.js, group: -100, weight: 1 } + - { file: misc/displace.js, group: -100 } dependencies: - core/jquery - core/drupal - - core/drupalSettings - - core/jquery.once + - core/drupal.debounce -drupal.tabledrag: +drupal.dropbutton: version: VERSION js: - - { file: misc/tabledrag.js, group: -100, weight: -1 } + - { file: misc/dropbutton/dropbutton.js } + css: + - { file: misc/dropbutton/dropbutton.css } + - { file: misc/dropbutton/dropbutton.theme.css } dependencies: - core/jquery - - core/modernizr - core/drupal - core/drupalSettings - core/jquery.once - - core/jquery.cookie -drupal.tableresponsive: +drupal.form: version: VERSION js: - - { file: misc/tableresponsive.js, group: -100 } + - { file: misc/form.js, group: -100, weight: 1 } dependencies: - core/jquery - core/drupal + - core/jquery.cookie - core/jquery.once -drupal.collapse: +drupal.machine-name: version: VERSION js: - - { file: misc/collapse.js, group: 0 } + - { file: misc/machine-name.js } dependencies: - core/jquery - - core/modernizr - - core/drupal - - core/drupal.form - core/jquery.once + - core/drupal + - core/drupalSettings -drupal.autocomplete: +drupal.progress: version: VERSION js: - - { file: misc/autocomplete.js, group: 0, weight: -1 } + - { file: misc/progress.js, group: 0 } dependencies: - - core/jquery - core/drupal + - core/jquery - core/drupalSettings - - core/drupal.ajax - - core/jquery.ui.autocomplete -drupal.displace: +drupal.states: version: VERSION js: - - { file: misc/displace.js, group: -100 } + - { file: misc/states.js, group: -100, weight: 1 } dependencies: - core/jquery - core/drupal - - core/drupal.debounce + - core/drupalSettings + - core/jquery.once drupal.tabbingmanager: version: VERSION @@ -159,60 +186,56 @@ drupal.tabbingmanager: - { file: misc/tabbingmanager.js, group: -100 } dependencies: - core/jquery - - core/jquery.ui.core + - core/jquery.ui - core/drupal -drupal.debounce: +drupal.tabledrag: version: VERSION js: - - { file: misc/debounce.js, group: -100 } + - { file: misc/tabledrag.js, group: -100, weight: -1 } dependencies: + - core/jquery + - core/modernizr - core/drupal + - core/drupalSettings + - core/jquery.once + - core/jquery.cookie -domready: - version: VERSION - js: - - { file: assets/vendor/domready/ready.min.js, group: -100, weight: -21 } - -jquery: - version: VERSION - js: - - { file: assets/vendor/jquery/jquery.js, group: -100, weight: -20 } - -jquery.once: +drupal.tableheader: version: VERSION js: - - { file: assets/vendor/jquery-once/jquery.once.js, group: -100, weight: -19 } + - { file: misc/tableheader.js } dependencies: - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once + - core/drupal.displace -jquery.form: +drupal.tableresponsive: version: VERSION js: - - { file: assets/vendor/jquery-form/jquery.form.js } + - { file: misc/tableresponsive.js, group: -100 } dependencies: - core/jquery - - core/jquery.cookie + - core/drupal + - core/jquery.once -jquery.bbq: +drupal.tableselect: version: VERSION js: - - { file: assets/vendor/jquery-bbq/jquery.ba-bbq.js } + - { file: misc/tableselect.js } dependencies: + - core/drupal - core/jquery -drupal.dropbutton: +drupal.timezone: version: VERSION js: - - { file: misc/dropbutton/dropbutton.js } - css: - - { file: misc/dropbutton/dropbutton.css } - - { file: misc/dropbutton/dropbutton.theme.css } + - { file: misc/timezone.js } dependencies: - core/jquery - core/drupal - - core/drupalSettings - - core/jquery.once drupal.vertical-tabs: version: VERSION @@ -226,15 +249,41 @@ drupal.vertical-tabs: - core/drupalSettings - core/drupal.form -matchmedia: - version: VERSION +html5shiv: + remote: https://github.com/aFarkas/html5shiv + version: 3.6.2 js: - - { file: misc/matchmedia.js } + - { file: assets/vendor/html5shiv/html5.js, group: -100, weight: -22, browsers: { IE: 'lte IE 8', '!IE': false } } + +jquery: + remote: https://github.com/jquery/jquery + version: 2.0.3 + js: + - { file: assets/vendor/jquery/jquery.js, group: -100, weight: -20 } + +jquery.bbq: + remote: https://github.com/cowboy/jquery-bbq + # @todo Ping @benalman to create stable release. + version: v1.3pre + js: + - { file: assets/vendor/jquery-bbq/jquery.ba-bbq.js } dependencies: - - core/drupal.debounce + - core/jquery + +jquery.cookie: + # @todo jquery.cookie.js no longer exists in the latest jQuery UI. + # @see https://github.com/jquery/jquery-ui/tree/master/external + # @see https://github.com/carhartl/jquery-cookie + version: 1.10.2 + js: + - { file: assets/vendor/jquery.ui/external/jquery.cookie.js } + dependencies: + - core/jquery jquery.farbtastic: - version: VERSION + remote: https://github.com/mattfarina/farbtastic + # @todo Ping @robloach or @mattfarina to retroactively create this release. + version: 1.2 js: - { file: assets/vendor/farbtastic/farbtastic.js } css: @@ -242,23 +291,26 @@ jquery.farbtastic: dependencies: - core/jquery -html5shiv: - version: VERSION +jquery.form: + remote: https://github.com/malsup/form + version: 3.39 js: - - { file: assets/vendor/html5shiv/html5.js, group: -100, weight: -22, browsers: { IE: 'lte IE 8', '!IE': false } } + - { file: assets/vendor/jquery-form/jquery.form.js } + dependencies: + - core/jquery + - core/jquery.cookie -modernizr: - version: VERSION +jquery.once: + remote: https://github.com/RobLoach/jquery-once + version: 1.2.3 js: - - { file: assets/vendor/modernizr/modernizr.min.js, every_page: true, group: -100, preprocess: 0, scope: header, weight: -21 } - -normalize: - version: VERSION - css: - - { file: assets/vendor/normalize-css/normalize.css, every_page: true, weight: -220 } + - { file: assets/vendor/jquery-once/jquery.once.js, group: -100, weight: -19 } + dependencies: + - core/jquery -jquery.ui.core: - version: VERSION +jquery.ui: + remote: https://github.com/jquery/jquery-ui + version: &jquery.ui 1.10.2 js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.core.js, group: -100, weight: -11 } css: @@ -268,54 +320,54 @@ jquery.ui.core: - core/jquery jquery.ui.accordion: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.accordion.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.accordion.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget jquery.ui.autocomplete: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.autocomplete.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.autocomplete.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget - core/jquery.ui.position - core/jquery.ui.menu jquery.ui.button: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.button.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.button.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget jquery.ui.datepicker: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.datepicker.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.datepicker.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui jquery.ui.dialog: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.dialog.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.dialog.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget - core/jquery.ui.button - core/jquery.ui.draggable @@ -324,290 +376,263 @@ jquery.ui.dialog: - core/jquery.ui.resizable jquery.ui.draggable: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.draggable.js } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.mouse - core/jquery.ui.widget jquery.ui.droppable: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.droppable.js } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget - core/jquery.ui.mouse - core/jquery.ui.draggable +jquery.ui.effects.core: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.core.js, group: -100, weight: -9 } + +jquery.ui.effects.blind: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.blind.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.bounce: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.bounce.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.clip: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.clip.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.drop: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.drop.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.explode: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.explode.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.fade: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.fade.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.fold: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.fold.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.highlight: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.highlight.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.pulsate: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.pulsate.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.scale: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.scale.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.shake: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.shake.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.slide: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.slide.js } + dependencies: + - core/jquery.ui.effects.core + +jquery.ui.effects.transfer: + version: *jquery.ui + js: + - { file: assets/vendor/jquery.ui/ui/jquery.effects.transfer.js } + dependencies: + - core/jquery.ui.effects.core + jquery.ui.menu: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.menu.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.menu.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget jquery.ui.mouse: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.mouse.js } dependencies: - core/jquery.ui.widget jquery.ui.position: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.position.js } jquery.ui.progressbar: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.progressbar.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.progressbar.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget jquery.ui.resizable: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.resizable.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.resizable.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget - core/jquery.ui.mouse jquery.ui.selectable: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.selectable.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.selectable.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.mouse - core/jquery.ui.widget jquery.ui.slider: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.slider.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.slider.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.mouse - core/jquery.ui.widget jquery.ui.sortable: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.sortable.js } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.mouse - core/jquery.ui.widget jquery.ui.spinner: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.spinner.js } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget - core/jquery.ui.button jquery.ui.tabs: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.tabs.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.tabs.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget jquery.ui.tooltip: - version: VERSION + version: *jquery.ui js: - { file: assets/vendor/jquery.ui/ui/jquery.ui.tooltip.js } css: - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.tooltip.css } dependencies: - - core/jquery.ui.core + - core/jquery.ui - core/jquery.ui.widget - core/jquery.ui.position -jquery.ui.widget: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.ui.widget.js, group: -100, weight: -10 } - dependencies: - - core/jquery.ui.core - -jquery.effects.core: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.core.js, group: -100, weight: -9 } - -jquery.effects.blind: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.blind.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.bounce: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.bounce.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.clip: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.clip.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.drop: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.drop.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.explode: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.explode.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.fade: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.fade.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.fold: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.fold.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.highlight: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.highlight.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.pulsate: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.pulsate.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.scale: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.scale.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.shake: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.shake.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.slide: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.slide.js } - dependencies: - - core/jquery.effects.core - -jquery.effects.transfer: - version: VERSION - js: - - { file: assets/vendor/jquery.ui/ui/jquery.effects.transfer.js } - dependencies: - - core/jquery.effects.core - jquery.ui.touch-punch: - version: VERSION + remote: https://github.com/furf/jquery-ui-touch-punch + version: 0.2.2 js: - { file: assets/vendor/jquery-ui-touch-punch/jquery.ui.touch-punch.js } dependencies: - - core/jquery.ui.core + - core/jquery.ui -underscore: - version: VERSION - js: - - { file: assets/vendor/underscore/underscore.js, group: -100, weight: -20 } - -backbone: - version: VERSION +jquery.ui.widget: + version: *jquery.ui js: - - { file: assets/vendor/backbone/backbone.js, group: -100, weight: -19 } + - { file: assets/vendor/jquery.ui/ui/jquery.ui.widget.js, group: -100, weight: -10 } dependencies: - - core/underscore + - core/jquery.ui -jquery.cookie: +matchmedia: + remote: https://github.com/paulirish/matchMedia.js + # @todo Contribute upstream and replace with upstream version. version: VERSION js: - - { file: assets/vendor/jquery.ui/external/jquery.cookie.js } + - { file: misc/matchmedia.js } dependencies: - - core/jquery + - core/drupal.debounce -drupal.tableselect: - version: VERSION +modernizr: + remote: https://github.com/Modernizr/Modernizr + version: v2.6.2 js: - - { file: misc/tableselect.js } - dependencies: - - core/drupal - - core/jquery + - { file: assets/vendor/modernizr/modernizr.min.js, every_page: true, group: -100, preprocess: 0, scope: header, weight: -21 } -drupal.tableheader: - version: VERSION - js: - - { file: misc/tableheader.js } - dependencies: - - core/jquery - - core/drupal - - core/drupalSettings - - core/jquery.once - - core/drupal.displace +normalize: + remote: https://github.com/necolas/normalize.css + version: v2.1.2 + css: + - { file: assets/vendor/normalize-css/normalize.css, every_page: true, weight: -220 } -drupal.timezone: - version: VERSION +underscore: + remote: https://github.com/jashkenas/underscore + version: 1.4.0 js: - - { file: misc/timezone.js } - dependencies: - - core/jquery - - core/drupal + - { file: assets/vendor/underscore/underscore.js, group: -100, weight: -20 } -drupal.machine-name: - version: VERSION - js: - - { file: misc/machine-name.js } - dependencies: - - core/jquery - - core/jquery.once - - core/drupal - - core/drupalSettings diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc index 5c4bb99..46a8742 100644 --- a/core/includes/ajax.inc +++ b/core/includes/ajax.inc @@ -475,8 +475,8 @@ function ajax_pre_render_element($element) { // Attach JavaScript settings to the element. if (isset($element['#ajax']['event'])) { - $element['#attached']['library'][] = array('system', 'jquery.form'); - $element['#attached']['library'][] = array('system', 'drupal.ajax'); + $element['#attached']['library'][] = array('core', 'jquery.form'); + $element['#attached']['library'][] = array('core', 'drupal.ajax'); $settings = $element['#ajax']; diff --git a/core/includes/batch.inc b/core/includes/batch.inc index 049b3fb..c72fa91 100644 --- a/core/includes/batch.inc +++ b/core/includes/batch.inc @@ -171,7 +171,7 @@ function _batch_progress_page() { ), ); drupal_add_js($js_setting, 'setting'); - drupal_add_library('system', 'drupal.batch'); + drupal_add_library('core', 'drupal.batch'); return theme('progress_bar', array('percent' => $percentage, 'message' => $message, 'label' => $label)); } diff --git a/core/includes/common.inc b/core/includes/common.inc index fd274b8..a9c194d 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -2658,7 +2658,7 @@ function drupal_process_attached($elements, $dependency_check = FALSE) { * @see form_example_states_form() */ function drupal_process_states(&$elements) { - $elements['#attached']['library'][] = array('system', 'drupal.states'); + $elements['#attached']['library'][] = array('core', 'drupal.states'); // Elements of '#type' => 'item' are not actual form input elements, but we // still want to be able to show/hide them. Since there's no actual HTML input // element available, setting #attributes does not make sense, but a wrapper @@ -2705,10 +2705,6 @@ function drupal_add_library($module, $name, $every_page = NULL) { ); foreach (array('js', 'css') as $type) { foreach ($elements['#attached'][$type] as $data => $options) { - // Apply the JS_LIBRARY group if it isn't explicitly given. - if ($type == 'js' && !isset($options['group'])) { - $elements['#attached']['js'][$data]['group'] = JS_LIBRARY; - } // Set the every_page flag if one was passed. if (isset($every_page)) { $elements['#attached'][$type][$data]['every_page'] = $every_page; @@ -2758,11 +2754,12 @@ function drupal_add_library($module, $name, $every_page = NULL) { * requisite API functions; find and use a different name. */ function drupal_get_library($module, $name = NULL) { + static $library_info = array(); $libraries = &drupal_static(__FUNCTION__, array()); if ($module === 'core') { $module_path = 'core'; - $library_info = 'core/core.library.yml'; + $library_file = 'core/core.library.yml'; } else { // @todo Add a $type argument OR automatically figure out the type based on @@ -2771,62 +2768,78 @@ function drupal_get_library($module, $name = NULL) { if (in_array($module, array('seven', 'bartik'))) { $module_path = drupal_get_path('theme', $module); } - $library_info = $module_path . '/' . $module . '.library.yml'; + $library_file = $module_path . '/' . $module . '.library.yml'; } - if (!isset($libraries[$module]) && file_exists($library_info)) { - $parser = new Parser(); - $module_libraries = $parser->parse(file_get_contents($library_info)); - if (empty($module_libraries)) { - $module_libraries = array(); + if (!isset($libraries[$module])) { + if (!isset($library_info[$module])) { + $library_info[$module] = array(); + if (file_exists($library_file)) { + $parser = new Parser(); + $library_info[$module] = $parser->parse(file_get_contents($library_file)) ?: array(); + } } + $module_libraries = $library_info[$module]; + // Allow modules to alter the module's registered libraries. drupal_alter('library_info', $module_libraries, $module); - foreach ($module_libraries as $lib_name => $library) { - $new_library = array('dependencies' => array(), 'js' => array(), 'css' => array()); - $library += $new_library; - $new_library['version'] = $library['version']; - if (isset($library['version']) && $library['version'] === 'VERSION') { - $new_library['version'] = \Drupal::VERSION; + foreach ($module_libraries as $id => $library) { + $library += array('dependencies' => array(), 'js' => array(), 'css' => array()); + + if (isset($library['version'])) { + // @todo Retrieve version of a non-core extension. + if ($library['version'] === 'VERSION') { + $library['version'] = \Drupal::VERSION; + } + // Remove 'v' prefix from external library versions. + elseif ($library['version'][0] === 'v') { + $library['version'] = substr($library['version'], 1); + } } + foreach (array('js', 'css') as $type) { - foreach ($library[$type] as $file) { - $file['version'] = $new_library['version']; + foreach ($library[$type] as $i => $options) { + // Apply the JS_LIBRARY group if it wasn't explicitly set. + if (!isset($options['group']) && $type == 'js') { + $options['group'] = JS_LIBRARY; + } - if (!empty($file['file'])) { - // An absolute path maps to the Drupal document root. - if ($file['file'][0] === '/') { - $file['data'] = substr($file['file'], 1); + if (isset($options['file'])) { + $options['type'] = 'file'; + // An absolute path maps to DRUPAL_ROOT. + if ($options['file'][0] === '/' && $options['file'][1] !== '/') { + $options['data'] = substr($options['file'], 1); } else { - $file['data'] = $module_path . '/' . $file['file']; + $options['data'] = $module_path . '/' . $options['file']; } - $file['type'] = 'file'; - unset($file['file']); + unset($options['file']); + $options['version'] = $library['version']; } - elseif (!empty($file['external'])) { - $file['data'] = $file['external']; - $file['type'] = 'external'; - unset($file['external']); + elseif (isset($options['external'])) { + $options['type'] = 'external'; + $options['data'] = $options['external']; + unset($options['external']); + $options['version'] = $library['version']; } - elseif (isset($file['settings'])) { - $file['data'] = $file['settings']; - $file['type'] = 'setting'; - unset($file['settings']); + elseif (isset($options['settings'])) { + $options['type'] = 'setting'; + $options['data'] = $options['settings']; + unset($options['settings']); } - $new_library[$type][] = $file; + + unset($library[$type][$i]); + $library[$type][] = $options; } } - $new_library['dependencies'] = $library['dependencies']; - - // @todo replace all uses of #attached and remove this. - foreach ($new_library['dependencies'] as $i => $dep) { - if (!is_array($dep)) { - $new_library['dependencies'][$i] = explode('/', $dep); + // @todo Replace all uses of #attached and remove this. + foreach ($library['dependencies'] as $i => $dependency) { + if (!is_array($dependency)) { + $library['dependencies'][$i] = explode('/', $dependency, 2); } } - $module_libraries[$lib_name] = $new_library; + $module_libraries[$id] = $library; } $libraries[$module] = $module_libraries; } @@ -2980,7 +2993,7 @@ function drupal_attach_tabledrag(&$element, array $options) { 'limit' => $options['limit'], ); - $element['#attached']['library'][] = array('system', 'drupal.tabledrag'); + $element['#attached']['library'][] = array('core', 'drupal.tabledrag'); $element['#attached']['js'][] = array('data' => $settings, 'type' => 'setting'); } @@ -3616,7 +3629,7 @@ function drupal_pre_render_links($element) { * Pre-render callback: Attaches the dropbutton library and required markup. */ function drupal_pre_render_dropbutton($element) { - $element['#attached']['library'][] = array('system', 'drupal.dropbutton'); + $element['#attached']['library'][] = array('core', 'drupal.dropbutton'); $element['#attributes']['class'][] = 'dropbutton'; if (!isset($element['#theme_wrappers'])) { $element['#theme_wrappers'] = array(); @@ -3950,6 +3963,7 @@ function drupal_render(&$elements, $is_recursive_call = FALSE) { else { $wrapper_hook = $value; } + $elements['#children'] = theme($wrapper_hook, $wrapper_elements); } } @@ -3981,6 +3995,7 @@ function drupal_render(&$elements, $is_recursive_call = FALSE) { drupal_render_cache_set($elements['#markup'], $elements); } + // Only when we're not in a recursive drupal_render() call, // #post_render_cache callbacks must be executed, to prevent breaking the // render cache in case of nested elements with #cache set. diff --git a/core/includes/form.inc b/core/includes/form.inc index 87f8edf..8b87e1b 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -1566,7 +1566,7 @@ function theme_tableselect($variables) { // checkboxes/radios in the first table column. if ($element['#js_select']) { // Add a "Select all" checkbox. - drupal_add_library('system', 'drupal.tableselect'); + drupal_add_library('core', 'drupal.tableselect'); array_unshift($header, array('class' => array('select-all'))); } else { @@ -1681,7 +1681,7 @@ function form_process_table($element, &$form_state) { // Add a "Select all" checkbox column to the header. // @todo D8: Rename into #select_all? if ($element['#js_select']) { - $element['#attached']['library'][] = array('system', 'drupal.tableselect'); + $element['#attached']['library'][] = array('core', 'drupal.tableselect'); array_unshift($element['#header'], array('class' => array('select-all'))); } // Add an empty header column for radio buttons or when a "Select all" @@ -1881,7 +1881,7 @@ function form_process_machine_name($element, &$form_state) { 'langcode' => $language->id, ), ); - $element['#attached']['library'][] = array('system', 'drupal.machine-name'); + $element['#attached']['library'][] = array('core', 'drupal.machine-name'); $element['#attached']['js'][] = $js_settings; return $element; @@ -1954,7 +1954,7 @@ function form_process_group(&$element, &$form_state) { } // Contains form element summary functionalities. - $element['#attached']['library'][] = array('system', 'drupal.form'); + $element['#attached']['library'][] = array('core', 'drupal.form'); return $element; } @@ -1977,7 +1977,7 @@ function form_pre_render_details($element) { } // Collapsible details. - $element['#attached']['library'][] = array('system', 'drupal.collapse'); + $element['#attached']['library'][] = array('core', 'drupal.collapse'); if (empty($element['#collapsed'])) { $element['#attributes']['open'] = 'open'; } @@ -2069,7 +2069,7 @@ function form_process_vertical_tabs($element, &$form_state) { $element['#title_display'] = 'invisible'; } - $element['#attached']['library'][] = array('system', 'drupal.vertical-tabs'); + $element['#attached']['library'][] = array('core', 'drupal.vertical-tabs'); // The JavaScript stores the currently selected tab in this hidden // field so that the active tab can be restored the next time the @@ -2158,7 +2158,7 @@ function form_process_autocomplete($element, &$form_state) { } if ($access) { $element['#attributes']['class'][] = 'form-autocomplete'; - $element['#attached']['library'][] = array('system', 'drupal.autocomplete'); + $element['#attached']['library'][] = array('core', 'drupal.autocomplete'); // Provide a data attribute for the JavaScript behavior to bind to. $element['#attributes']['data-autocomplete-path'] = $path; } diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 8762f0b..cde1b69 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -2105,7 +2105,7 @@ function install_configure_form($form, &$form_state, &$install_state) { drupal_add_library('system', 'drupal.system'); // Add JavaScript time zone detection. - drupal_add_library('system', 'drupal.timezone'); + drupal_add_library('core', 'drupal.timezone'); // We add these strings as settings because JavaScript translation does not // work during installation. drupal_add_js(array('copyFieldValue' => array('edit-site-mail' => array('edit-account-mail'))), 'setting'); diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 9545be7..7c71035 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1553,7 +1553,7 @@ function theme_table($variables) { // Add sticky headers, if applicable. if (count($header) && $sticky) { - drupal_add_library('system', 'drupal.tableheader'); + drupal_add_library('core', 'drupal.tableheader'); // Add 'sticky-enabled' class to the table to identify it for JS. // This is needed to target tables constructed by this function. $attributes['class'][] = 'sticky-enabled'; @@ -1562,7 +1562,7 @@ function theme_table($variables) { // with the classes represented by the constants RESPONSIVE_PRIORITY_MEDIUM // and RESPONSIVE_PRIORITY_LOW, add the tableresponsive behaviors. if (count($header) && $responsive) { - drupal_add_library('system', 'drupal.tableresponsive'); + drupal_add_library('core', 'drupal.tableresponsive'); // Add 'responsive-enabled' class to the table to identify it for JS. // This is needed to target tables constructed by this function. $attributes['class'][] = 'responsive-enabled'; @@ -2147,7 +2147,7 @@ function template_preprocess_html(&$variables) { drupal_add_html_head($element, $name); } - drupal_add_library('system', 'html5shiv', TRUE); + drupal_add_library('core', 'html5shiv', TRUE); // Render page_top and page_bottom into top level variables. $variables['page_top'] = array(); @@ -2427,7 +2427,7 @@ function template_preprocess_maintenance_page(&$variables) { // These are usually added from system_page_build() except maintenance.css. // When the database is inactive it's not called so we add it here. - $default_css['library'][] = array('system', 'normalize'); + $default_css['library'][] = array('core', 'normalize'); $path = drupal_get_path('module', 'system'); // Adjust the weights to load these early. $default_css['css'][$path . '/css/system.module.css'] = array( diff --git a/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php b/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php index 45115df..3742843 100644 --- a/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php +++ b/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php @@ -124,7 +124,7 @@ public function setDialogTitle($title) { */ public function render() { // Add the library for handling the dialog in the response. - drupal_add_library('system', 'drupal.dialog.ajax'); + drupal_add_library('core', 'drupal.dialog.ajax'); // For consistency ensure the modal option is set to TRUE or FALSE. $this->dialogOptions['modal'] = isset($this->dialogOptions['modal']) && $this->dialogOptions['modal']; diff --git a/core/modules/block/lib/Drupal/block/BlockListController.php b/core/modules/block/lib/Drupal/block/BlockListController.php index 6db9219..3439f53 100644 --- a/core/modules/block/lib/Drupal/block/BlockListController.php +++ b/core/modules/block/lib/Drupal/block/BlockListController.php @@ -149,7 +149,7 @@ public function buildForm(array $form, array &$form_state) { } $entities = $this->load(); $form['#theme'] = array('block_list'); - $form['#attached']['library'][] = array('system', 'drupal.tableheader'); + $form['#attached']['library'][] = array('core', 'drupal.tableheader'); $form['#attached']['library'][] = array('block', 'drupal.block'); $form['#attached']['library'][] = array('block', 'drupal.block.admin'); $form['#attributes']['class'][] = 'clearfix'; diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/CKEditorPlugin/DrupalImage.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/CKEditorPlugin/DrupalImage.php index 9fc56a2..8e5f0ab 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/CKEditorPlugin/DrupalImage.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/CKEditorPlugin/DrupalImage.php @@ -34,7 +34,7 @@ public function getFile() { */ public function getLibraries(Editor $editor) { return array( - array('system', 'drupal.ajax'), + array('core', 'drupal.ajax'), ); } diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/CKEditorPlugin/DrupalLink.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/CKEditorPlugin/DrupalLink.php index 2e764c1..91a513a 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/CKEditorPlugin/DrupalLink.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/CKEditorPlugin/DrupalLink.php @@ -33,7 +33,7 @@ public function getFile() { */ public function getLibraries(Editor $editor) { return array( - array('system', 'drupal.ajax'), + array('core', 'drupal.ajax'), ); } diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php index 8a5d52f..379ba38 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php @@ -90,7 +90,7 @@ public function form(array $form, array &$form_state) { $is_admin = $comment->id() && $this->currentUser->hasPermission('administer comments'); if (!$this->currentUser->isAuthenticated() && $anonymous_contact != COMMENT_ANONYMOUS_MAYNOT_CONTACT) { - $form['#attached']['library'][] = array('system', 'jquery.cookie'); + $form['#attached']['library'][] = array('core', 'jquery.cookie'); $form['#attributes']['class'][] = 'user-info-from-cookie'; } diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigSync.php b/core/modules/config/lib/Drupal/config/Form/ConfigSync.php index 4287d86..641abe0 100644 --- a/core/modules/config/lib/Drupal/config/Form/ConfigSync.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigSync.php @@ -166,7 +166,7 @@ public function buildForm(array $form, array &$form_state) { } // Add the AJAX library to the form for dialog support. - $form['#attached']['library'][] = array('system', 'drupal.ajax'); + $form['#attached']['library'][] = array('core', 'drupal.ajax'); foreach ($config_comparer->getChangelist() as $config_change_type => $config_files) { if (empty($config_files)) { diff --git a/core/modules/contact/lib/Drupal/contact/MessageFormController.php b/core/modules/contact/lib/Drupal/contact/MessageFormController.php index ca4a607..8e8e46a 100644 --- a/core/modules/contact/lib/Drupal/contact/MessageFormController.php +++ b/core/modules/contact/lib/Drupal/contact/MessageFormController.php @@ -45,7 +45,7 @@ public function form(array $form, array &$form_state) { '#required' => TRUE, ); if ($user->isAnonymous()) { - $form['#attached']['library'][] = array('system', 'jquery.cookie'); + $form['#attached']['library'][] = array('core', 'jquery.cookie'); $form['#attributes']['class'][] = 'user-info-from-cookie'; } // Do not allow authenticated users to alter the name or e-mail values to diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleLibraryInfoAlterTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleLibraryInfoAlterTest.php index 912d657..2a51216 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleLibraryInfoAlterTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleLibraryInfoAlterTest.php @@ -36,7 +36,7 @@ public static function getInfo() { * @see locale_library_info_alter() */ public function testLibraryInfoAlter() { - drupal_add_library('system', 'jquery.ui.datepicker'); + drupal_add_library('core', 'jquery.ui.datepicker'); $scripts = drupal_get_js(); $this->assertTrue(strpos($scripts, 'locale.datepicker.js'), 'locale.datepicker.js added to scripts.'); } diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index 17591ec..59fd428 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -636,7 +636,7 @@ function locale_js_translate(array $files = array()) { * Provides the language support for the jQuery UI Date Picker. */ function locale_library_info_alter(&$libraries, $module) { - if ($module == 'system' && isset($libraries['jquery.ui.datepicker'])) { + if ($module == 'core' && isset($libraries['jquery.ui.datepicker'])) { $language_interface = language(Language::TYPE_INTERFACE); // locale.datepicker.js should be added in the JS_LIBRARY group, so that // this attach behavior will execute early. JS_LIBRARY is the default for diff --git a/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php index ceee2e2..48ad990e 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php +++ b/core/modules/system/lib/Drupal/system/Plugin/views/field/BulkFormBase.php @@ -107,7 +107,7 @@ public function preRender(&$values) { */ public function viewsForm(&$form, &$form_state) { // Add the tableselect javascript. - $form['#attached']['library'][] = array('system', 'drupal.tableselect'); + $form['#attached']['library'][] = array('core', 'drupal.tableselect'); // Only add the bulk form options and buttons if there are results. if (!empty($this->view->result)) { diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php index 3a11ccc..bf467b0 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php @@ -77,7 +77,7 @@ function testAddFile() { */ function testAddSetting() { // Add a file in order to test default settings. - drupal_add_library('system', 'drupalSettings'); + drupal_add_library('core', 'drupalSettings'); $javascript = drupal_add_js(); $last_settings = reset($javascript['settings']['data']); $this->assertTrue(array_key_exists('currentPath', $last_settings), 'The current path JavaScript setting is set correctly.'); @@ -103,7 +103,7 @@ function testAddExternal() { function testAttributes() { $default_query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0'; - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); drupal_add_js('http://example.com/script.js', array('attributes' => array('defer' => 'defer'))); drupal_add_js('core/misc/collapse.js', array('attributes' => array('defer' => 'defer'))); $javascript = drupal_get_js(); @@ -124,7 +124,7 @@ function testAggregatedAttributes() { $default_query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0'; - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); drupal_add_js('http://example.com/script.js', array('attributes' => array('defer' => 'defer'))); drupal_add_js('core/misc/collapse.js', array('attributes' => array('defer' => 'defer'))); $javascript = drupal_get_js(); @@ -140,7 +140,7 @@ function testAggregatedAttributes() { * Tests drupal_get_js() for JavaScript settings. */ function testHeaderSetting() { - drupal_add_library('system', 'drupalSettings'); + drupal_add_library('core', 'drupalSettings'); $javascript = drupal_get_js('header'); $this->assertTrue(strpos($javascript, 'basePath') > 0, 'Rendered JavaScript header returns basePath setting.'); @@ -202,7 +202,7 @@ function testHeaderSetting() { * Tests to see if resetting the JavaScript empties the cache. */ function testReset() { - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); drupal_add_js('core/misc/collapse.js'); drupal_static_reset('drupal_add_js'); $this->assertEqual(array(), drupal_add_js(), 'Resetting the JavaScript correctly empties the cache.'); @@ -212,7 +212,7 @@ function testReset() { * Tests adding inline scripts. */ function testAddInline() { - drupal_add_library('system', 'jquery'); + drupal_add_library('core', 'jquery'); $inline = 'jQuery(function () { });'; $javascript = drupal_add_js($inline, array('type' => 'inline', 'scope' => 'footer')); $this->assertTrue(array_key_exists('core/assets/vendor/jquery/jquery.js', $javascript), 'jQuery is added when inline scripts are added.'); @@ -224,7 +224,7 @@ function testAddInline() { * Tests rendering an external JavaScript file. */ function testRenderExternal() { - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); $external = 'http://example.com/example.js'; drupal_add_js($external, 'external'); $javascript = drupal_get_js(); @@ -236,7 +236,7 @@ function testRenderExternal() { * Tests drupal_get_js() with a footer scope. */ function testFooterHTML() { - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); $inline = 'jQuery(function () { });'; drupal_add_js($inline, array('type' => 'inline', 'scope' => 'footer')); $javascript = drupal_get_js('footer'); @@ -247,7 +247,7 @@ function testFooterHTML() { * Tests drupal_add_js() sets preproccess to FALSE when cache is also FALSE. */ function testNoCache() { - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); $javascript = drupal_add_js('core/misc/collapse.js', array('cache' => FALSE)); $this->assertFalse($javascript['core/misc/collapse.js']['preprocess'], 'Setting cache to FALSE sets proprocess to FALSE when adding JavaScript.'); } @@ -256,7 +256,7 @@ function testNoCache() { * Tests adding a JavaScript file with a different group. */ function testDifferentGroup() { - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); $javascript = drupal_add_js('core/misc/collapse.js', array('group' => JS_THEME)); $this->assertEqual($javascript['core/misc/collapse.js']['group'], JS_THEME, 'Adding a JavaScript file with a different group caches the given group.'); } @@ -277,7 +277,7 @@ function testDifferentWeight() { function testBrowserConditionalComments() { $default_query_string = $this->container->get('state')->get('system.css_js_query_string') ?: '0'; - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); drupal_add_js('core/misc/collapse.js', array('browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE))); drupal_add_js('jQuery(function () { });', array('type' => 'inline', 'browsers' => array('IE' => FALSE))); $javascript = drupal_get_js(); @@ -293,7 +293,7 @@ function testBrowserConditionalComments() { * Tests JavaScript versioning. */ function testVersionQueryString() { - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); drupal_add_js('core/misc/collapse.js', array('version' => 'foo')); drupal_add_js('core/misc/ajax.js', array('version' => 'bar')); $javascript = drupal_get_js(); @@ -310,7 +310,7 @@ function testAggregation() { // ahead of ones without. The order of JavaScript execution must be the // same regardless of whether aggregation is enabled, so ensure this // expected order, first with aggregation off. - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); drupal_add_js('core/misc/ajax.js'); drupal_add_js('core/misc/collapse.js', array('every_page' => TRUE)); drupal_add_js('core/misc/autocomplete.js'); @@ -330,7 +330,7 @@ function testAggregation() { $config = \Drupal::config('system.performance'); $config->set('js.preprocess', 1); $config->save(); - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); drupal_add_js('core/misc/ajax.js'); drupal_add_js('core/misc/collapse.js', array('every_page' => TRUE)); drupal_add_js('core/misc/autocomplete.js'); @@ -353,7 +353,7 @@ function testAggregationOrder() { drupal_static_reset('drupal_add_js'); // Add two JavaScript files to the current request and build the cache. - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); drupal_add_js('core/misc/ajax.js'); drupal_add_js('core/misc/autocomplete.js'); @@ -374,7 +374,7 @@ function testAggregationOrder() { // Reset variables and add a file in a different scope first. \Drupal::state()->delete('system.js_cache_files'); drupal_static_reset('drupal_add_js'); - drupal_add_library('system', 'drupal'); + drupal_add_library('core', 'drupal'); drupal_add_js('some/custom/javascript_file.js', array('scope' => 'footer')); drupal_add_js('core/misc/ajax.js'); drupal_add_js('core/misc/autocomplete.js'); @@ -445,7 +445,7 @@ function testRenderDifferentWeight() { // JavaScript files are sorted first by group, then by the 'every_page' // flag, then by weight (see drupal_sort_css_js()), so to test the effect of // weight, we need the other two options to be the same. - drupal_add_library('system', 'jquery'); + drupal_add_library('core', 'jquery'); drupal_add_js('core/misc/collapse.js', array('group' => JS_LIBRARY, 'every_page' => TRUE, 'weight' => -21)); $javascript = drupal_get_js(); $this->assertTrue(strpos($javascript, 'core/misc/collapse.js') < strpos($javascript, 'core/assets/vendor/jquery/jquery.js'), 'Rendering a JavaScript file above jQuery.'); @@ -472,18 +472,12 @@ function testAlter() { * Adds a library to the page and tests for both its JavaScript and its CSS. */ function testLibraryRender() { - $result = drupal_add_library('system', 'jquery.farbtastic'); + $result = drupal_add_library('core', 'jquery.farbtastic'); $this->assertTrue($result !== FALSE, 'Library was added without errors.'); $scripts = drupal_get_js(); $styles = drupal_get_css(); $this->assertTrue(strpos($scripts, 'core/assets/vendor/farbtastic/farbtastic.js'), 'JavaScript of library was added to the page.'); $this->assertTrue(strpos($styles, 'core/assets/vendor/farbtastic/farbtastic.css'), 'Stylesheet of library was added to the page.'); - - drupal_add_library('common_test', 'shorthand.plugin'); - $path = drupal_get_path('module', 'common_test') . '/js/shorthand.js?v=0.8.3.37'; - $scripts = drupal_get_js(); - $this->assertTrue(strpos($scripts, $path), 'JavaScript specified in hook_library_info() using shorthand format (without any options) was added to the page.'); - $this->assertEqual(substr_count($scripts, 'shorthand.js'), 1, 'Shorthand JavaScript file only added once.'); } /** @@ -493,11 +487,11 @@ function testLibraryRender() { */ function testLibraryAlter() { // Verify that common_test altered the title of Farbtastic. - $library = drupal_get_library('system', 'jquery.farbtastic'); - $this->assertEqual($library['title'], 'Farbtastic: Altered Library', 'Registered libraries were altered.'); + $library = drupal_get_library('core', 'jquery.farbtastic'); + $this->assertEqual($library['version'], '0.0', 'Registered libraries were altered.'); // common_test_library_info_alter() also added a dependency on jQuery Form. - drupal_add_library('system', 'jquery.farbtastic'); + drupal_add_library('core', 'jquery.farbtastic'); $scripts = drupal_get_js(); $this->assertTrue(strpos($scripts, 'core/assets/vendor/jquery-form/jquery.form.js'), 'Altered library dependencies are added to the page.'); } @@ -505,11 +499,11 @@ function testLibraryAlter() { /** * Tests that multiple modules can implement the same library. * - * @see common_test_library_info() + * @see common_test.library.yml */ function testLibraryNameConflicts() { $farbtastic = drupal_get_library('common_test', 'jquery.farbtastic'); - $this->assertEqual($farbtastic['title'], 'Custom Farbtastic Library', 'Alternative libraries can be added to the page.'); + $this->assertEqual($farbtastic['version'], '0.1', 'Alternative libraries can be added to the page.'); } /** @@ -530,7 +524,7 @@ function testLibraryUnknown() { * Tests the addition of libraries through the #attached['library'] property. */ function testAttachedLibrary() { - $element['#attached']['library'][] = array('system', 'jquery.farbtastic'); + $element['#attached']['library'][] = array('core', 'jquery.farbtastic'); drupal_render($element); $scripts = drupal_get_js(); $this->assertTrue(strpos($scripts, 'core/assets/vendor/farbtastic/farbtastic.js'), 'The attached_library property adds the additional libraries.'); @@ -543,14 +537,14 @@ function testGetLibrary() { // Retrieve all libraries registered by a module. $libraries = drupal_get_library('common_test'); $this->assertTrue(isset($libraries['jquery.farbtastic']), 'Retrieved all module libraries.'); - // Retrieve all libraries for a module not implementing hook_library_info(). + // Retrieve all libraries for a module not declaring any libraries. // Note: This test installs language module. $libraries = drupal_get_library('dblog'); - $this->assertEqual($libraries, array(), 'Retrieving libraries from a module not implementing hook_library_info() returns an emtpy array.'); + $this->assertEqual($libraries, array(), 'Retrieving libraries from a module not declaring any libraries returns an emtpy array.'); // Retrieve a specific library by module and name. $farbtastic = drupal_get_library('common_test', 'jquery.farbtastic'); - $this->assertEqual($farbtastic['version'], '5.3', 'Retrieved a single library.'); + $this->assertEqual($farbtastic['version'], '0.1', 'Retrieved a single library.'); // Retrieve a non-existing library by module and name. $farbtastic = drupal_get_library('common_test', 'foo'); $this->assertIdentical($farbtastic, FALSE, 'Retrieving a non-existing library returns FALSE.'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/MergeAttachmentsTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/MergeAttachmentsTest.php index 07c77d0..3f806f3 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/MergeAttachmentsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/MergeAttachmentsTest.php @@ -14,13 +14,6 @@ */ class MergeAttachmentsTest extends DrupalUnitTestBase { - /** - * Modules to enable. - * - * @var array - */ - public static $modules = array('system'); - public static function getInfo() { return array( 'name' => 'Attachment merging', @@ -29,30 +22,26 @@ public static function getInfo() { ); } - function setUp() { - parent::setUp(); - } - /** * Tests justs library asset merging. */ function testLibraryMerging() { $a['#attached'] = array( 'library' => array( - array('system', 'drupal'), - array('system', 'drupalSettings'), + array('core', 'drupal'), + array('core', 'drupalSettings'), ), ); $b['#attached'] = array( 'library' => array( - array('system', 'jquery'), + array('core', 'jquery'), ), ); $expected['#attached'] = array( 'library' => array( - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery'), + array('core', 'drupal'), + array('core', 'drupalSettings'), + array('core', 'jquery'), ), ); $this->assertIdentical($expected['#attached'], drupal_merge_attached($a['#attached'], $b['#attached']), 'Attachments merged correctly.'); @@ -60,22 +49,22 @@ function testLibraryMerging() { // Merging in the opposite direction yields the opposite library order. $expected['#attached'] = array( 'library' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), + array('core', 'jquery'), + array('core', 'drupal'), + array('core', 'drupalSettings'), ), ); $this->assertIdentical($expected['#attached'], drupal_merge_attached($b['#attached'], $a['#attached']), 'Attachments merged correctly; opposite merging yields opposite order.'); // Merging with duplicates: duplicates are simply retained, it's up to the // rest of the system to handle duplicates. - $b['#attached']['library'][] = array('system', 'drupalSettings'); + $b['#attached']['library'][] = array('core', 'drupalSettings'); $expected['#attached'] = array( 'library' => array( - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery'), - array('system', 'drupalSettings'), + array('core', 'drupal'), + array('core', 'drupalSettings'), + array('core', 'jquery'), + array('core', 'drupalSettings'), ), ); $this->assertIdentical($expected['#attached'], drupal_merge_attached($a['#attached'], $b['#attached']), 'Attachments merged correctly; duplicates are retained.'); diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php index f3985e0..208a7b8 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/RenderTest.php @@ -599,8 +599,8 @@ function testDrupalRenderChildrenPostRenderCache() { array('type' => 'setting', 'data' => array('foo' => 'bar')) ), 'library' => array( - array('system', 'drupal.collapse'), - array('system', 'drupal.collapse'), + array('core', 'drupal.collapse'), + array('core', 'drupal.collapse'), ), ), '#post_render_cache' => array( @@ -661,8 +661,8 @@ function testDrupalRenderChildrenPostRenderCache() { array('type' => 'setting', 'data' => array('foo' => 'bar')) ), 'library' => array( - array('system', 'drupal.collapse'), - array('system', 'drupal.collapse'), + array('core', 'drupal.collapse'), + array('core', 'drupal.collapse'), ), ), '#post_render_cache' => array( @@ -679,7 +679,7 @@ function testDrupalRenderChildrenPostRenderCache() { ', '#attached' => array( 'library' => array( - array('system', 'drupal.collapse'), + array('core', 'drupal.collapse'), ), ), '#post_render_cache' => array( diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index d2c8db9..ca12d22 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -295,7 +295,7 @@ function hook_js_alter(&$javascript) { */ function hook_library_info_alter(&$libraries, $module) { // Update Farbtastic to version 2.0. - if ($module == 'system' && isset($libraries['farbtastic'])) { + if ($module == 'core' && isset($libraries['farbtastic'])) { // Verify existing version is older than the one we are updating to. if (version_compare($libraries['farbtastic']['version'], '2.0', '<')) { // Update the existing Farbtastic to version 2.0. diff --git a/core/modules/system/system.module b/core/modules/system/system.module index f4bf194..02520d2 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -854,1007 +854,6 @@ function system_theme_suggestions_region(array $variables) { } /** - * Implements hook_library_info(). - */ -function system_library_info() { - // Drupal-specific JavaScript. - $libraries['drupal'] = array( - 'title' => 'Drupal', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/drupal.js' => array('group' => JS_LIBRARY, 'weight' => -18), - ), - 'dependencies' => array( - array('system', 'domready'), - ), - ); - - // Drupal settings. - $libraries['drupalSettings'] = array( - 'title' => 'Drupal Settings', - 'version' => \Drupal::VERSION, - 'js' => array( - array('type' => 'setting', 'data' => array()), - ), - ); - - // Drupal's Ajax framework. - $libraries['drupal.ajax'] = array( - 'title' => 'Drupal AJAX', - 'website' => 'http://api.drupal.org/api/group/ajax/8', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/ajax.js' => array('group' => JS_LIBRARY, 'weight' => 2), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'drupal.progress'), - array('system', 'jquery.once'), - ), - ); - - // Drupal's Screen Reader change announcement utility. - $libraries['drupal.announce'] = array( - 'title' => 'Drupal announce', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/announce.js' => array('group' => JS_LIBRARY), - ), - 'dependencies' => array( - array('system', 'drupal'), - array('system', 'drupal.debounce'), - ), - ); - - // Drupal's batch API. - $libraries['drupal.batch'] = array( - 'title' => 'Drupal batch API', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/batch.js' => array('group' => JS_DEFAULT, 'cache' => FALSE), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'drupal.ajax'), - array('system', 'drupal.progress'), - array('system', 'jquery.once'), - ), - ); - - // Drupal's progress indicator. - $libraries['drupal.progress'] = array( - 'title' => 'Drupal progress indicator', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/progress.js' => array('group' => JS_DEFAULT), - ), - 'dependencies' => array( - array('system', 'drupal'), - array('system', 'jquery'), - array('system', 'drupalSettings'), - ), - ); - - // Drupal's form library. - $libraries['drupal.form'] = array( - 'title' => 'Drupal form library', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/form.js' => array('group' => JS_LIBRARY, 'weight' => 1), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.cookie'), - array('system', 'jquery.once'), - ), - ); - - // Drupal's dialog component. - $libraries['drupal.dialog'] = array( - 'title' => 'Drupal Dialog', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/dialog.js' => array('group' => JS_LIBRARY), - 'core/misc/dialog.position.js' => array('group' => JS_LIBRARY), - ), - 'css' => array( - 'core/misc/dialog.theme.css' => array('weight' => 1), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'drupal.debounce'), - array('system', 'drupal.displace'), - array('system', 'jquery.ui.dialog'), - ), - ); - - // Drupal's integration between AJAX and dialogs. - $libraries['drupal.dialog.ajax'] = array( - 'title' => 'Drupal Dialog AJAX', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/dialog.ajax.js' => array('group' => JS_LIBRARY, 'weight' => 3), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'drupal.ajax'), - array('system', 'drupal.dialog'), - ), - ); - - // Drupal's states library. - $libraries['drupal.states'] = array( - 'title' => 'Drupal states', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/states.js' => array('group' => JS_LIBRARY, 'weight' => 1), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - ), - ); - - // Drupal's tabledrag library. - $libraries['drupal.tabledrag'] = array( - 'title' => 'Drupal tabledrag', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/tabledrag.js' => array('group' => JS_LIBRARY, 'weight' => -1), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'modernizr'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - array('system', 'jquery.cookie'), - ), - ); - - // Drupal's responsive table API. - $libraries['drupal.tableresponsive'] = array( - 'title' => 'Drupal responsive table API', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/tableresponsive.js' => array('group' => JS_LIBRARY), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - ), - ); - - // Collapsible details. - $libraries['drupal.collapse'] = array( - 'title' => 'Collapsible details', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/collapse.js' => array('group' => JS_DEFAULT), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'modernizr'), - array('system', 'drupal'), - // collapse.js relies on drupalGetSummary in form.js - array('system', 'drupal.form'), - array('system', 'jquery.once'), - ), - ); - - // Drupal's autocomplete widget. - $libraries['drupal.autocomplete'] = array( - 'title' => 'Drupal autocomplete', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/autocomplete.js' => array('group' => JS_LIBRARY, 'weight' => -1), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'drupal.ajax'), - array('system', 'jquery.ui.autocomplete'), - ), - ); - - // A utility that measures and reports viewport offset dimensions from - // elements like the toolbar that can potentially displace the positioning of - // elements. - $libraries['drupal.displace'] = array( - 'title' => 'Drupal displace', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/displace.js' => array('group' => JS_LIBRARY), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupal.debounce'), - ), - ); - - // Manages tab orders in the document. - $libraries['drupal.tabbingmanager'] = array( - 'title' => 'Drupal tabbing manager', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/tabbingmanager.js' => array('group' => JS_LIBRARY), - ), - 'dependencies' => array( - array('system', 'jquery'), - // Depends on jQuery UI Core to use the ":tabbable" pseudo selector. - array('system', 'jquery.ui.core'), - array('system', 'drupal'), - ), - ); - - // A utility function to limit calls to a function with a given time. - $libraries['drupal.debounce'] = array( - 'title' => 'Drupal debounce', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/debounce.js' => array('group' => JS_LIBRARY), - ), - 'dependencies' => array( - // @todo remove drupal dependency. - array('system', 'drupal'), - ), - ); - - // domReady. - $libraries['domready'] = array( - 'title' => 'domReady', - 'website' => 'https://github.com/ded/domready', - 'version' => 'master', - 'js' => array( - 'core/assets/vendor/domready/ready.min.js' => array('group' => JS_LIBRARY, 'weight' => -21), - ), - ); - - // jQuery. - $libraries['jquery'] = array( - 'title' => 'jQuery', - 'website' => 'http://jquery.com', - 'version' => '2.0.3', - 'js' => array( - 'core/assets/vendor/jquery/jquery.js' => array('group' => JS_LIBRARY, 'weight' => -20), - ), - ); - - // jQuery Once. - $libraries['jquery.once'] = array( - 'title' => 'jQuery Once', - 'website' => 'http://plugins.jquery.com/once/', - 'version' => '1.2.3', - 'js' => array( - 'core/assets/vendor/jquery-once/jquery.once.js' => array('group' => JS_LIBRARY, 'weight' => -19), - ), - 'dependencies' => array( - array('system', 'jquery'), - ), - ); - - // jQuery Form Plugin. - $libraries['jquery.form'] = array( - 'title' => 'jQuery Form Plugin', - 'website' => 'http://malsup.com/jquery/form/', - 'version' => '3.39', - 'js' => array( - 'core/assets/vendor/jquery-form/jquery.form.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'jquery.cookie'), - ), - ); - - // jQuery BBQ plugin. - $libraries['jquery.bbq'] = array( - 'title' => 'jQuery BBQ', - 'website' => 'http://benalman.com/projects/jquery-bbq-plugin/', - 'version' => '1.3pre', - 'js' => array( - 'core/assets/vendor/jquery-bbq/jquery.ba-bbq.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - ), - ); - - // Dropbutton. - $libraries['drupal.dropbutton'] = array( - 'title' => 'Dropbutton', - 'website' => 'http://drupal.org/node/1608878', - 'version' => '1.0', - 'js' => array( - 'core/misc/dropbutton/dropbutton.js' => array(), - ), - 'css' => array( - 'core/misc/dropbutton/dropbutton.css' => array(), - 'core/misc/dropbutton/dropbutton.theme.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - ), - ); - - // Vertical Tabs. - $libraries['drupal.vertical-tabs'] = array( - 'title' => 'Vertical Tabs', - 'website' => 'http://drupal.org/node/323112', - 'version' => '1.0', - 'js' => array( - 'core/misc/vertical-tabs.js' => array(), - ), - 'css' => array( - 'core/misc/vertical-tabs.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - // Vertical tabs relies on drupalGetSummary in form.js - array('system', 'drupal.form'), - ), - ); - - // matchMedia polyfill. - $libraries['matchmedia'] = array( - 'title' => 'window.matchMedia polyfill', - 'website' => 'http://drupal.org/node/1815602', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/matchmedia.js' => array(), - ), - 'dependencies' => array( - array('system', 'drupal.debounce'), - ), - ); - - // Farbtastic. - $libraries['jquery.farbtastic'] = array( - 'title' => 'Farbtastic', - 'website' => 'http://code.google.com/p/farbtastic/', - 'version' => '1.2', - 'js' => array( - 'core/assets/vendor/farbtastic/farbtastic.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/farbtastic/farbtastic.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - ), - ); - - // HTML5 Shiv. - $libraries['html5shiv'] = array( - 'title' => 'html5shiv', - 'website' => 'https://github.com/aFarkas/html5shiv/', - 'version' => '3.6.2', - 'js' => array( - 'core/assets/vendor/html5shiv/html5.js' => array( - 'group' => JS_LIBRARY, - 'weight' => -22, - 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), - ), - ), - ); - - // Modernizr. - $libraries['modernizr'] = array( - 'title' => 'Modernizr', - 'website' => 'http://modernizr.com/', - 'version' => '2.6.2', - 'js' => array( - 'core/assets/vendor/modernizr/modernizr.min.js' => array( - 'every_page' => TRUE, - 'group' => JS_LIBRARY, - 'preprocess' => 0, - 'scope' => 'header', - 'weight' => -21, - ), - ), - ); - - // Normalize. - $libraries['normalize'] = array( - 'title' => 'normalize.css', - 'website' => 'http://git.io/normalize', - 'version' => '2.1.2', - 'css' => array( - 'core/assets/vendor/normalize-css/normalize.css' => array( - 'every_page' => TRUE, - 'weight' => CSS_BASE - 20, - ), - ), - ); - - // jQuery UI. - $libraries['jquery.ui.core'] = array( - 'title' => 'jQuery UI: Core', - 'website' => 'http://jqueryui.com', - 'version' => '1.10.2', - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.core.js' => array('group' => JS_LIBRARY, 'weight' => -11), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.core.css' => array(), - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.theme.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - ), - ); - $libraries['jquery.ui.accordion'] = array( - 'title' => 'jQuery UI: Accordion', - 'website' => 'http://jqueryui.com/demos/accordion/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.accordion.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.accordion.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - ), - ); - $libraries['jquery.ui.autocomplete'] = array( - 'title' => 'jQuery UI: Autocomplete', - 'website' => 'http://jqueryui.com/demos/autocomplete/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.autocomplete.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.autocomplete.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - array('system', 'jquery.ui.position'), - array('system', 'jquery.ui.menu'), - ), - ); - $libraries['jquery.ui.button'] = array( - 'title' => 'jQuery UI: Button', - 'website' => 'http://jqueryui.com/demos/button/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.button.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.button.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - ), - ); - $libraries['jquery.ui.datepicker'] = array( - 'title' => 'jQuery UI: Date Picker', - 'website' => 'http://jqueryui.com/demos/datepicker/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.datepicker.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.datepicker.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - ), - ); - $libraries['jquery.ui.dialog'] = array( - 'title' => 'jQuery UI: Dialog', - 'website' => 'http://jqueryui.com/demos/dialog/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.dialog.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.dialog.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - array('system', 'jquery.ui.button'), - array('system', 'jquery.ui.draggable'), - array('system', 'jquery.ui.mouse'), - array('system', 'jquery.ui.position'), - array('system', 'jquery.ui.resizable'), - ), - ); - $libraries['jquery.ui.draggable'] = array( - 'title' => 'jQuery UI: Draggable', - 'website' => 'http://jqueryui.com/demos/draggable/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.draggable.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.mouse'), - array('system', 'jquery.ui.widget'), - ), - ); - $libraries['jquery.ui.droppable'] = array( - 'title' => 'jQuery UI: Droppable', - 'website' => 'http://jqueryui.com/demos/droppable/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.droppable.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - array('system', 'jquery.ui.mouse'), - array('system', 'jquery.ui.draggable'), - ), - ); - $libraries['jquery.ui.menu'] = array( - 'title' => 'jQuery UI: Mouse', - 'website' => 'http://docs.jquery.com/UI/Menu', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.menu.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.menu.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - ), - ); - $libraries['jquery.ui.mouse'] = array( - 'title' => 'jQuery UI: Mouse', - 'website' => 'http://docs.jquery.com/UI/Mouse', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.mouse.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.widget'), - ), - ); - $libraries['jquery.ui.position'] = array( - 'title' => 'jQuery UI: Position', - 'website' => 'http://jqueryui.com/demos/position/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.position.js' => array(), - ), - ); - $libraries['jquery.ui.progressbar'] = array( - 'title' => 'jQuery UI: Progress Bar', - 'website' => 'http://jqueryui.com/demos/progressbar/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.progressbar.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.progressbar.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - ), - ); - $libraries['jquery.ui.resizable'] = array( - 'title' => 'jQuery UI: Resizable', - 'website' => 'http://jqueryui.com/demos/resizable/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.resizable.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.resizable.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - array('system', 'jquery.ui.mouse'), - ), - ); - $libraries['jquery.ui.selectable'] = array( - 'title' => 'jQuery UI: Selectable', - 'website' => 'http://jqueryui.com/demos/selectable/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.selectable.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.selectable.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.mouse'), - array('system', 'jquery.ui.widget'), - ), - ); - $libraries['jquery.ui.slider'] = array( - 'title' => 'jQuery UI: Slider', - 'website' => 'http://jqueryui.com/demos/slider/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.slider.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.slider.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.mouse'), - array('system', 'jquery.ui.widget'), - ), - ); - $libraries['jquery.ui.sortable'] = array( - 'title' => 'jQuery UI: Sortable', - 'website' => 'http://jqueryui.com/demos/sortable/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.sortable.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.mouse'), - array('system', 'jquery.ui.widget'), - ), - ); - $libraries['jquery.ui.spinner'] = array( - 'title' => 'jQuery UI: Spinner', - 'website' => 'http://jqueryui.com/demos/spinner/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.spinner.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - array('system', 'jquery.ui.button'), - ), - ); - $libraries['jquery.ui.tabs'] = array( - 'title' => 'jQuery UI: Tabs', - 'website' => 'http://jqueryui.com/demos/tabs/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.tabs.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.tabs.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - ), - ); - $libraries['jquery.ui.tooltip'] = array( - 'title' => 'jQuery UI: Tooltip', - 'website' => 'http://jqueryui.com/demos/tooltip/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.tooltip.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/jquery.ui/themes/base/jquery.ui.tooltip.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - array('system', 'jquery.ui.widget'), - array('system', 'jquery.ui.position'), - ), - ); - $libraries['jquery.ui.widget'] = array( - 'title' => 'jQuery UI: Widget', - 'website' => 'http://docs.jquery.com/UI/Widget', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.ui.widget.js' => array('group' => JS_LIBRARY, 'weight' => -10), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - ), - ); - $libraries['jquery.effects.core'] = array( - 'title' => 'jQuery UI: Effects', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.core.js' => array('group' => JS_LIBRARY, 'weight' => -9), - ), - ); - $libraries['jquery.effects.blind'] = array( - 'title' => 'jQuery UI: Effects Blind', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.blind.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.bounce'] = array( - 'title' => 'jQuery UI: Effects Bounce', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.bounce.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.clip'] = array( - 'title' => 'jQuery UI: Effects Clip', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.clip.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.drop'] = array( - 'title' => 'jQuery UI: Effects Drop', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.drop.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.explode'] = array( - 'title' => 'jQuery UI: Effects Explode', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.explode.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.fade'] = array( - 'title' => 'jQuery UI: Effects Fade', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.fade.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.fold'] = array( - 'title' => 'jQuery UI: Effects Fold', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.fold.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.highlight'] = array( - 'title' => 'jQuery UI: Effects Highlight', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.highlight.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.pulsate'] = array( - 'title' => 'jQuery UI: Effects Pulsate', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.pulsate.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.scale'] = array( - 'title' => 'jQuery UI: Effects Scale', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.scale.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.shake'] = array( - 'title' => 'jQuery UI: Effects Shake', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.shake.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.slide'] = array( - 'title' => 'jQuery UI: Effects Slide', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.slide.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - $libraries['jquery.effects.transfer'] = array( - 'title' => 'jQuery UI: Effects Transfer', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => $libraries['jquery.ui.core']['version'], - 'js' => array( - 'core/assets/vendor/jquery.ui/ui/jquery.effects.transfer.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.effects.core'), - ), - ); - - // Touch Punch for jQuery UI touch support. - $libraries['jquery.ui.touch-punch'] = array( - 'title' => 'jQuery UI Touch Punch', - 'website' => 'http://jqueryui.com/demos/effect/', - 'version' => '0.2.2', - 'js' => array( - 'core/assets/vendor/jquery-ui-touch-punch/jquery.ui.touch-punch.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery.ui.core'), - ), - ); - - // Underscore. - $libraries['underscore'] = array( - 'title' => 'Underscore.js', - 'website' => 'http://underscorejs.org/', - 'version' => '1.4.0', - 'js' => array( - 'core/assets/vendor/underscore/underscore.js' => array('group' => JS_LIBRARY, 'weight' => -20), - ), - ); - - // Backbone. - $libraries['backbone'] = array( - 'title' => 'Backbone.js', - 'website' => 'http://backbonejs.org/', - 'version' => '0.9.2', - 'js' => array( - 'core/assets/vendor/backbone/backbone.js' => array('group' => JS_LIBRARY, 'weight' => -19), - ), - 'dependencies' => array( - array('system', 'underscore'), - ), - ); - - // Cookie. - $libraries['jquery.cookie'] = array( - 'title' => 'Cookie', - 'website' => 'http://plugins.jquery.com/project/cookie', - 'version' => $libraries['jquery.ui.core']['version'], // Shipped with jQuery UI. - 'js' => array( - 'core/assets/vendor/jquery.ui/external/jquery.cookie.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - ), - ); - $libraries['drupal.tableselect'] = array( - 'title' => 'Tableselect', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/tableselect.js' => array(), - ), - 'dependencies' => array( - array('system', 'drupal'), - array('system', 'jquery'), - ), - ); - $libraries['drupal.tableheader'] = array( - 'title' => 'Table header', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/tableheader.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - array('system', 'drupal.displace'), - ), - ); - $libraries['drupal.timezone'] = array( - 'title' => 'Timezone', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/timezone.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - ), - ); - $libraries['drupal.machine-name'] = array( - 'title' => 'Machine name', - 'version' => \Drupal::VERSION, - 'js' => array( - 'core/misc/machine-name.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'jquery.once'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - ), - ); - - $libraries['drupal.system'] = array( - 'title' => 'System', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'system') . '/system.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - ), - ); - $libraries['drupal.system.modules'] = array( - 'title' => 'System modules', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'system') . '/system.modules.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - ), - ); - - return $libraries; -} - -/** * Implements hook_stream_wrappers(). */ function system_stream_wrappers() { @@ -2093,7 +1092,7 @@ function system_filetransfer_info() { */ function system_page_build(&$page) { // Ensure the same CSS is loaded in template_preprocess_maintenance_page(). - $page['#attached']['library'][] = array('system', 'normalize'); + $page['#attached']['library'][] = array('core', 'normalize'); $path = drupal_get_path('module', 'system'); // Adjust the weights to load these early. $page['#attached']['css'][$path . '/css/system.module.css'] = array( @@ -2173,7 +1172,7 @@ function system_user_timezone(&$form, &$form_state) { if (!$account->getTimezone() && $account->id() == $user->id() && empty($form_state['input']['timezone'])) { $form['timezone']['#description'] = t('Your time zone setting will be automatically detected if possible. Confirm the selection and click save.'); $form['timezone']['timezone']['#attributes'] = array('class' => array('timezone-detect')); - drupal_add_library('system', 'drupal.timezone'); + drupal_add_library('core', 'drupal.timezone'); } } diff --git a/core/modules/system/tests/modules/common_test/common_test.library.yml b/core/modules/system/tests/modules/common_test/common_test.library.yml new file mode 100644 index 0000000..4a2381d --- /dev/null +++ b/core/modules/system/tests/modules/common_test/common_test.library.yml @@ -0,0 +1,8 @@ +jquery.farbtastic: + version: 0.1 + js: + - { file: assets/vendor/farbtastic/farbtastic.js } + css: + - { file: assets/vendor/farbtastic/farbtastic.css } + dependencies: + - core/jquery diff --git a/core/modules/system/tests/modules/common_test/common_test.module b/core/modules/system/tests/modules/common_test/common_test.module index b3b8ad8..44a84ef 100644 --- a/core/modules/system/tests/modules/common_test/common_test.module +++ b/core/modules/system/tests/modules/common_test/common_test.module @@ -139,53 +139,15 @@ function theme_common_test_empty($variables) { * Implements hook_library_info_alter(). */ function common_test_library_info_alter(&$libraries, $module) { - if ($module == 'system' && isset($libraries['jquery.farbtastic'])) { - // Change the title of Farbtastic to "Farbtastic: Altered Library". - $libraries['jquery.farbtastic']['title'] = 'Farbtastic: Altered Library'; + if ($module == 'core' && isset($libraries['jquery.farbtastic'])) { + // Change the version of Farbtastic to 0.0. + $libraries['jquery.farbtastic']['version'] = '0.0'; // Make Farbtastic depend on jQuery Form to test library dependencies. - $libraries['jquery.farbtastic']['dependencies'][] = array('system', 'jquery.form'); + $libraries['jquery.farbtastic']['dependencies'][] = array('core', 'jquery.form'); } } /** - * Implements hook_library_info(). - * - * Adds Farbtastic in a different version. - */ -function common_test_library_info() { - $libraries['jquery.farbtastic'] = array( - 'title' => 'Custom Farbtastic Library', - 'website' => 'http://code.google.com/p/farbtastic/', - 'version' => '5.3', - 'js' => array( - 'core/assets/vendor/farbtastic/farbtastic.js' => array(), - ), - 'css' => array( - 'core/assets/vendor/farbtastic/farbtastic.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - ), - ); - // Nominate a library using the shorthand format, where no options are given, - // just the file name. - $libraries['shorthand.plugin'] = array( - 'title' => 'Shorthand Plugin', - 'website' => 'http://www.example.com/', - 'version' => '0.8.3.37', - 'js' => array( - // Here we attach the JavaScript file using the shorthand format, only - // the file name is given, no options. - drupal_get_path('module', 'common_test') . '/js/shorthand.js', - ), - 'dependencies' => array( - array('system', 'jquery'), - ), - ); - return $libraries; -} - -/** * Implements hook_cron(). * * System module should handle if a module does not catch an exception and keep diff --git a/core/modules/update/update.library.yml b/core/modules/update/update.library.yml new file mode 100644 index 0000000..10a9120 --- /dev/null +++ b/core/modules/update/update.library.yml @@ -0,0 +1,4 @@ +drupal.update.admin: + version: VERSION + css: + - { file: css/update.admin.css } diff --git a/core/modules/update/update.module b/core/modules/update/update.module index af8143b..4cf9c0d 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -145,23 +145,6 @@ function update_page_build() { } /** - * Implements hook_library_info(). - */ -function update_library_info() { - $path = drupal_get_path('module', 'update'); - $libraries['drupal.update.admin'] = array( - 'title' => 'Update administration UI', - 'website' => '', - 'version' => \Drupal::VERSION, - 'css' => array( - $path . '/css/update.admin.css' => array(), - ), - ); - - return $libraries; -} - -/** * Implements hook_menu(). */ function update_menu() { diff --git a/core/modules/user/lib/Drupal/user/RegisterFormController.php b/core/modules/user/lib/Drupal/user/RegisterFormController.php index 38612a2..cfba21c 100644 --- a/core/modules/user/lib/Drupal/user/RegisterFormController.php +++ b/core/modules/user/lib/Drupal/user/RegisterFormController.php @@ -36,7 +36,7 @@ public function form(array $form, array &$form_state) { return new RedirectResponse(url('user/' . $user->id(), array('absolute' => TRUE))); } - $form['#attached']['library'][] = array('system', 'jquery.cookie'); + $form['#attached']['library'][] = array('core', 'jquery.cookie'); $form['#attributes']['class'][] = 'user-info-from-cookie'; // Start with the default user account fields. diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 6c6cd0a..acfaabc 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -722,7 +722,7 @@ function template_preprocess_views_view_table(&$variables) { } if (!empty($options['sticky'])) { - $variables['view']->element['#attached']['library'][] = array('system', 'drupal.tableheader'); + $variables['view']->element['#attached']['library'][] = array('core', 'drupal.tableheader'); $variables['attributes']['class'][] = "sticky-enabled"; } $variables['attributes']['class'][] = 'cols-' . count($variables['header']); @@ -745,7 +745,7 @@ function template_preprocess_views_view_table(&$variables) { // with the classes represented by the constants RESPONSIVE_PRIORITY_MEDIUM // and RESPONSIVE_PRIORITY_LOW, add the tableresponsive behaviors. if (isset($variables['header']) && $responsive) { - $variables['view']->element['#attached']['library'][] = array('system', 'drupal.tableresponsive'); + $variables['view']->element['#attached']['library'][] = array('core', 'drupal.tableresponsive'); // Add 'responsive-enabled' class to the table to identify it for JS. // This is needed to target tables constructed by this function. $variables['attributes']['class'][] = 'responsive-enabled'; diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php index 84df38e..1f50b93 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php @@ -82,10 +82,10 @@ public function form(array $form, array &$form_state) { $form['#tree'] = TRUE; - $form['#attached']['library'][] = array('system', 'jquery.ui.tabs'); - $form['#attached']['library'][] = array('system', 'jquery.ui.dialog'); - $form['#attached']['library'][] = array('system', 'drupal.states'); - $form['#attached']['library'][] = array('system', 'drupal.tabledrag'); + $form['#attached']['library'][] = array('core', 'jquery.ui.tabs'); + $form['#attached']['library'][] = array('core', 'jquery.ui.dialog'); + $form['#attached']['library'][] = array('core', 'drupal.states'); + $form['#attached']['library'][] = array('core', 'drupal.tabledrag'); if (!\Drupal::config('views.settings')->get('no_javascript')) { $form['#attached']['library'][] = array('views_ui', 'views_ui.admin'); diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php index ed9d983..2762bc2 100644 --- a/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php +++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewListController.php @@ -176,7 +176,7 @@ public function render() { $list['#attributes']['id'] = 'views-entity-list'; $list['#attached']['css'] = ViewFormControllerBase::getAdminCSS(); - $list['#attached']['library'][] = array('system', 'drupal.ajax'); + $list['#attached']['library'][] = array('core', 'drupal.ajax'); $list['#attached']['library'][] = array('views_ui', 'views_ui.listing'); $form['filters'] = array( diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index 27ac0ca..ad712d9 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -293,30 +293,6 @@ function views_ui_contextual_links_suppress_pop() { } /** - * This is part of a patch to address a jQueryUI bug. The bug is responsible - * for the inability to scroll a page when a modal dialog is active. If the content - * of the dialog extends beyond the bottom of the viewport, the user is only able - * to scroll with a mousewheel or up/down keyboard keys. - * - * @see http://bugs.jqueryui.com/ticket/4671 - * @see https://bugs.webkit.org/show_bug.cgi?id=19033 - * @see /js/jquery.ui.dialog.patch.js - * @see /js/jquery.ui.dialog.min.js - * - * The javascript patch overwrites the $.ui.dialog.overlay.events object to remove - * the mousedown, mouseup and click events from the list of events that are bound - * in $.ui.dialog.overlay.create. - */ - -function views_ui_library_alter(&$libraries, $module) { - if ($module == 'system' && isset($libraries['jquery.ui.dialog'])) { - if (version_compare($libraries['jquery.ui.dialog']['version'], '1.7.2', '>=')) { - $libraries['jquery.ui.dialog']['js'][drupal_get_path('module', 'views') . '/js/jquery.ui.dialog.patch.js'] = array(); - } - } -} - -/** * Implements hook_views_analyze(). * * This is the basic views analysis that checks for very minimal problems. diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 27262ae..234a26b 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -156,7 +156,7 @@ function seven_menu_local_action($variables) { $libraries = array( '#attached' => array( 'library' => array( - array('system', 'modernizr'), + array('core', 'modernizr'), ), ), ); @@ -183,7 +183,7 @@ function seven_menu_local_action($variables) { function seven_element_info_alter(&$type) { // We require Modernizr for button styling. if (isset($type['button'])) { - $type['button']['#attached']['library'][] = array('system', 'modernizr'); + $type['button']['#attached']['library'][] = array('core', 'modernizr'); } }