diff --git a/core/core.library.yml b/core/core.library.yml new file mode 100644 index 0000000..3ae72a4 --- /dev/null +++ b/core/core.library.yml @@ -0,0 +1,608 @@ +drupal: + version: VERSION + js: + - { file: /misc/drupal.js, group: -100, weight: -18 } + dependencies: + - core/domready + +drupalSettings: + version: VERSION + js: + - { settings: { } } + +drupal.ajax: + version: VERSION + js: + - { file: /misc/ajax.js, group: -100, weight: 2 } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/drupal.progress + - core/jquery.once + +drupal.announce: + version: VERSION + js: + - { file: /misc/announce.js, group: -100 } + dependencies: + - core/drupal + - core/drupal.debounce + +drupal.batch: + version: VERSION + js: + - { file: /misc/batch.js, group: 0, cache: false } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/drupal.ajax + - core/drupal.progress + - core/jquery.once + +drupal.progress: + version: VERSION + js: + - { file: /misc/progress.js, group: 0 } + dependencies: + - core/drupal + - core/jquery + - core/drupalSettings + +drupal.form: + version: VERSION + js: + - { file: /misc/form.js, group: -100, weight: 1 } + dependencies: + - core/jquery + - core/drupal + - core/jquery.cookie + - core/jquery.once + +drupal.dialog: + version: VERSION + js: + - { file: /misc/dialog.js, group: -100 } + - { file: /misc/dialog.position.js, group: -100 } + css: + - { file: /misc/dialog.theme.css, weight: 1 } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/drupal.debounce + - core/drupal.displace + - core/jquery.ui.dialog + +drupal.dialog.ajax: + version: VERSION + js: + - { file: /misc/dialog.ajax.js, group: -100, weight: 3 } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/drupal.ajax + - core/drupal.dialog + +drupal.states: + version: VERSION + js: + - { file: /misc/states.js, group: -100, weight: 1 } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once + +drupal.tabledrag: + version: VERSION + js: + - { file: /misc/tabledrag.js, group: -100, weight: -1 } + dependencies: + - core/jquery + - core/modernizr + - core/drupal + - core/drupalSettings + - core/jquery.once + - core/jquery.cookie + +drupal.tableresponsive: + version: VERSION + js: + - { file: /misc/tableresponsive.js, group: -100 } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once + +drupal.collapse: + version: VERSION + js: + - { file: /misc/collapse.js, group: 0 } + dependencies: + - core/jquery + - core/modernizr + - core/drupal + - core/drupal.form + - core/jquery.once + +drupal.autocomplete: + version: VERSION + js: + - { file: /misc/autocomplete.js, group: 0, weight: -1 } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/drupal.ajax + - core/jquery.ui.autocomplete + +drupal.displace: + version: VERSION + js: + - { file: /misc/displace.js, group: -100 } + dependencies: + - core/jquery + - core/drupal + - core/drupal.debounce + +drupal.tabbingmanager: + version: VERSION + js: + - { file: /misc/tabbingmanager.js, group: -100 } + dependencies: + - core/jquery + - core/jquery.ui.core + - core/drupal + +drupal.debounce: + version: VERSION + js: + - { file: /misc/debounce.js, group: -100 } + dependencies: + - core/drupal + +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: + version: VERSION + js: + - { file: assets/vendor/jquery-once/jquery.once.js, group: -100, weight: -19 } + dependencies: + - core/jquery + +jquery.form: + version: VERSION + js: + - { file: assets/vendor/jquery-form/jquery.form.js } + dependencies: + - core/jquery + - core/jquery.cookie + +jquery.bbq: + version: VERSION + js: + - { file: assets/vendor/jquery-bbq/jquery.ba-bbq.js } + dependencies: + - core/jquery + +drupal.dropbutton: + version: VERSION + js: + - { file: /misc/dropbutton/dropbutton.js } + css: + - { file: /misc/dropbutton/dropbutton.css } + - { file: /misc/dropbutton/dropbutton.theme.css } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once + +drupal.vertical-tabs: + version: VERSION + js: + - { file: /misc/vertical-tabs.js } + css: + - { file: /misc/vertical-tabs.css } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/drupal.form + +matchmedia: + version: VERSION + js: + - { file: /misc/matchmedia.js } + dependencies: + - core/drupal.debounce + +jquery.farbtastic: + version: VERSION + js: + - { file: assets/vendor/farbtastic/farbtastic.js } + css: + - { file: assets/vendor/farbtastic/farbtastic.css } + dependencies: + - core/jquery + +html5shiv: + version: VERSION + js: + - { file: assets/vendor/html5shiv/html5.js, group: -100, weight: -22, browsers: { IE: 'lte IE 8', '!IE': false } } + +modernizr: + version: VERSION + 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 } + +jquery.ui.core: + version: VERSION + js: + - { file: assets/vendor/jquery.ui/ui/jquery.ui.core.js, group: -100, weight: -11 } + css: + - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.core.css } + - { file: assets/vendor/jquery.ui/themes/base/jquery.ui.theme.css } + dependencies: + - core/jquery + +jquery.ui.accordion: + version: VERSION + 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.widget + +jquery.ui.autocomplete: + version: VERSION + 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.widget + - core/jquery.ui.position + - core/jquery.ui.menu + +jquery.ui.button: + version: VERSION + 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.widget + +jquery.ui.datepicker: + version: VERSION + 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 + +jquery.ui.dialog: + version: VERSION + 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.widget + - core/jquery.ui.button + - core/jquery.ui.draggable + - core/jquery.ui.mouse + - core/jquery.ui.position + - core/jquery.ui.resizable + +jquery.ui.draggable: + version: VERSION + js: + - { file: assets/vendor/jquery.ui/ui/jquery.ui.draggable.js } + dependencies: + - core/jquery.ui.core + - core/jquery.ui.mouse + - core/jquery.ui.widget + +jquery.ui.droppable: + version: VERSION + js: + - { file: assets/vendor/jquery.ui/ui/jquery.ui.droppable.js } + dependencies: + - core/jquery.ui.core + - core/jquery.ui.widget + - core/jquery.ui.mouse + - core/jquery.ui.draggable + +jquery.ui.menu: + version: VERSION + 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.widget + +jquery.ui.mouse: + version: VERSION + js: + - { file: assets/vendor/jquery.ui/ui/jquery.ui.mouse.js } + dependencies: + - core/jquery.ui.widget + +jquery.ui.position: + version: VERSION + js: + - { file: assets/vendor/jquery.ui/ui/jquery.ui.position.js } + +jquery.ui.progressbar: + version: VERSION + 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.widget + +jquery.ui.resizable: + version: VERSION + 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.widget + - core/jquery.ui.mouse + +jquery.ui.selectable: + version: VERSION + 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.mouse + - core/jquery.ui.widget + +jquery.ui.slider: + version: VERSION + 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.mouse + - core/jquery.ui.widget + +jquery.ui.sortable: + version: VERSION + js: + - { file: assets/vendor/jquery.ui/ui/jquery.ui.sortable.js } + dependencies: + - core/jquery.ui.core + - core/jquery.ui.mouse + - core/jquery.ui.widget + +jquery.ui.spinner: + version: VERSION + js: + - { file: assets/vendor/jquery.ui/ui/jquery.ui.spinner.js } + dependencies: + - core/jquery.ui.core + - core/jquery.ui.widget + - core/jquery.ui.button + +jquery.ui.tabs: + version: VERSION + 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.widget + +jquery.ui.tooltip: + version: VERSION + 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.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 + js: + - { file: assets/vendor/jquery-ui-touch-punch/jquery.ui.touch-punch.js } + dependencies: + - core/jquery.ui.core + +underscore: + version: VERSION + js: + - { file: assets/vendor/underscore/underscore.js, group: -100, weight: -20 } + +backbone: + version: VERSION + js: + - { file: assets/vendor/backbone/backbone.js, group: -100, weight: -19 } + dependencies: + - core/underscore + +jquery.cookie: + version: VERSION + js: + - { file: assets/vendor/jquery.ui/external/jquery.cookie.js } + dependencies: + - core/jquery + +drupal.tableselect: + version: VERSION + js: + - { file: /misc/tableselect.js } + dependencies: + - core/drupal + - core/jquery + +drupal.tableheader: + version: VERSION + js: + - { file: /misc/tableheader.js } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once + - core/drupal.displace + +drupal.timezone: + version: VERSION + js: + - { file: /misc/timezone.js } + dependencies: + - core/jquery + - core/drupal + +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/common.inc b/core/includes/common.inc index a584b4d..e6f7f65 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -12,6 +12,7 @@ use Drupal\Core\Language\Language; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Yaml\Parser; use Drupal\Component\PhpStorage\PhpStorageFactory; use Drupal\Component\Utility\MapArray; use Drupal\Component\Utility\NestedArray; @@ -2688,7 +2689,6 @@ function drupal_process_states(&$elements) { * its dependencies could not be added. * * @see drupal_get_library() - * @see hook_library_info() * @see hook_library_info_alter() */ function drupal_add_library($module, $name, $every_page = NULL) { @@ -2752,7 +2752,6 @@ function drupal_add_library($module, $name, $every_page = NULL) { * of libraries registered by $module is returned (which may be empty). * * @see drupal_add_library() - * @see hook_library_info() * @see hook_library_info_alter() * * @todo The purpose of drupal_get_*() is completely different to other page @@ -2761,32 +2760,71 @@ function drupal_add_library($module, $name, $every_page = NULL) { function drupal_get_library($module, $name = NULL) { $libraries = &drupal_static(__FUNCTION__, array()); - if (!isset($libraries[$module])) { - // Retrieve all libraries associated with the module. - $module_libraries = module_invoke($module, 'library_info'); + if ($module === 'core') { + $module_path = 'core'; + $library_info = 'core/core.library.yml'; + } + else { + $module_path = drupal_get_path('module', $module); + if (in_array($module, array('seven', 'bartik'))) { + $module_path = drupal_get_path('theme', $module); + } + $library_info = $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(); } // Allow modules to alter the module's registered libraries. drupal_alter('library_info', $module_libraries, $module); - foreach ($module_libraries as $key => $data) { - if (is_array($data)) { - // Add default elements to allow for easier processing. - $module_libraries[$key] += array('dependencies' => array(), 'js' => array(), 'css' => array()); - foreach ($module_libraries[$key]['js'] as $file => $options) { - if (is_scalar($options)) { - // The JavaScript or CSS file has been specified in shorthand - // format, without an array of options. In this case $options is the - // filename. Convert the shorthand version and remove the old array - // key. - unset($module_libraries[$key]['js'][$file]); - $file = $options; - $options = array(); + 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 (array('js', 'css') as $type) { + foreach ($library[$type] as $file) { + $file['version'] = $new_library['version']; + + if (!empty($file['file'])) { + // An absolute path maps to the Drupal document root. + if ($file['file'][0] === '/') { + $file['data'] = substr($file['file'], 1); + } + else { + $file['data'] = $module_path . '/' . $file['file']; + } + $file['type'] = 'file'; + unset($file['file']); + } + elseif (!empty($file['external'])) { + $file['data'] = $file['external']; + $file['type'] = 'external'; + unset($file['external']); } - $module_libraries[$key]['js'][$file]['version'] = $module_libraries[$key]['version']; + elseif (isset($file['settings'])) { + $file['data'] = $file['settings']; + $file['type'] = 'setting'; + unset($file['settings']); + } + $new_library[$type][] = $file; + } + } + $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); } } + $module_libraries[$lib_name] = $new_library; } $libraries[$module] = $module_libraries; } @@ -3910,7 +3948,6 @@ function drupal_render(&$elements, $is_recursive_call = FALSE) { else { $wrapper_hook = $value; } - $elements['#children'] = theme($wrapper_hook, $wrapper_elements); } } @@ -3942,7 +3979,6 @@ 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/modules/block/block.library.yml b/core/modules/block/block.library.yml new file mode 100644 index 0000000..98ac0d9 --- /dev/null +++ b/core/modules/block/block.library.yml @@ -0,0 +1,16 @@ +drupal.block: + version: VERSION + js: + - { file: block.js } + dependencies: + - core/jquery + - core/drupal +drupal.block.admin: + version: VERSION + js: + - { file: js/block.admin.js } + css: + - { file: css/block.admin.css } + dependencies: + - core/jquery + - core/drupal diff --git a/core/modules/block/block.module b/core/modules/block/block.module index dd3aa6f..b191748 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -561,36 +561,3 @@ function block_language_delete($language) { } } } - -/** - * Implements hook_library_info(). - */ -function block_library_info() { - $libraries['drupal.block'] = array( - 'title' => 'Block', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'block') . '/block.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - ), - ); - $libraries['drupal.block.admin'] = array( - 'title' => 'Block admin', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'block') . '/js/block.admin.js' => array(), - ), - 'css' => array( - drupal_get_path('module', 'block') . '/css/block.admin.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - ), - ); - - return $libraries; -} diff --git a/core/modules/book/book.library.yml b/core/modules/book/book.library.yml new file mode 100644 index 0000000..20365b7 --- /dev/null +++ b/core/modules/book/book.library.yml @@ -0,0 +1,8 @@ +drupal.book: + version: VERSION + js: + - { file: book.js } + dependencies: + - core/jquery + - core/drupal + - core/drupal.form diff --git a/core/modules/book/book.module b/core/modules/book/book.module index ec8cf4c..177e6b2 100644 --- a/core/modules/book/book.module +++ b/core/modules/book/book.module @@ -801,23 +801,3 @@ function book_node_type_update(NodeTypeInterface $type) { function book_link_load($mlid) { return entity_load('menu_link', $mlid); } - -/** - * Implements hook_library_info(). - */ -function book_library_info() { - $libraries['drupal.book'] = array( - 'title' => 'Book', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'book') . '/book.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupal.form'), - ), - ); - - return $libraries; -} diff --git a/core/modules/ckeditor/ckeditor.library.yml b/core/modules/ckeditor/ckeditor.library.yml new file mode 100644 index 0000000..674a201 --- /dev/null +++ b/core/modules/ckeditor/ckeditor.library.yml @@ -0,0 +1,64 @@ +drupal.ckeditor: + version: VERSION + js: + - { file: js/ckeditor.js } + - { settings: { ckeditor: { modulePath: core/modules/ckeditor } } } + css: + - { file: css/ckeditor.css } + dependencies: + - core/jquery + - core/drupal + - core/drupal.debounce + - ckeditor/ckeditor + - editor/drupal.editor +drupal.ckeditor.admin: + version: VERSION + js: + - { file: js/ckeditor.admin.js } + css: + - { file: css/ckeditor.admin.css } + - { asset: ckeditor/skins/moono/editor.css } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once + - core/jquery.ui.sortable + - core/jquery.ui.draggable + - core/jquery.ui.touch-punch + - core/backbone + - core/drupal.dialog + - core/drupal.announce + - ckeditor/ckeditor + - editor/drupal.editor.admin + - core/drupal.vertical-tabs +drupal.ckeditor.drupalimage.admin: + version: VERSION + js: + - { file: js/ckeditor.drupalimage.admin.js } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once + - core/drupal.vertical-tabs + - core/drupalSettings +drupal.ckeditor.stylescombo.admin: + version: VERSION + js: + - { file: js/ckeditor.stylescombo.admin.js } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once + - core/drupal.vertical-tabs + - core/drupalSettings +drupal.ckeditor.drupalimagecaption-theme: + version: VERSION + js: + - { file: js/plugins/drupalimagecaption/theme.js } + dependencies: + - ckeditor/ckeditor +ckeditor: + version: VERSION + js: + - { asset: ckeditor/ckeditor.js, preprocess: false } diff --git a/core/modules/ckeditor/ckeditor.module b/core/modules/ckeditor/ckeditor.module index a33ecf2..10d5376 100644 --- a/core/modules/ckeditor/ckeditor.module +++ b/core/modules/ckeditor/ckeditor.module @@ -32,114 +32,6 @@ function ckeditor_help($path, $arg) { } /** - * Implements hook_library_info(). - */ -function ckeditor_library_info() { - $module_path = drupal_get_path('module', 'ckeditor'); - - $settings = array( - 'ckeditor' => array( - 'modulePath' => drupal_get_path('module', 'ckeditor'), - ), - ); - $libraries['drupal.ckeditor'] = array( - 'title' => 'Drupal behavior to enable CKEditor on textareas.', - 'version' => \Drupal::VERSION, - 'js' => array( - $module_path . '/js/ckeditor.js' => array(), - array('data' => $settings, 'type' => 'setting'), - ), - 'css' => array( - $module_path . '/css/ckeditor.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupal.debounce'), - array('ckeditor', 'ckeditor'), - array('editor', 'drupal.editor'), - ), - ); - $libraries['drupal.ckeditor.admin'] = array( - 'title' => 'Drupal behavior for drag-and-drop CKEditor toolbar builder UI.', - 'version' => \Drupal::VERSION, - 'js' => array( - $module_path . '/js/ckeditor.admin.js' => array(), - ), - 'css' => array( - $module_path . '/css/ckeditor.admin.css' => array(), - 'core/assets/vendor/ckeditor/skins/moono/editor.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - array('system', 'jquery.ui.sortable'), - array('system', 'jquery.ui.draggable'), - array('system', 'jquery.ui.touch-punch'), - array('system', 'backbone'), - array('system', 'drupal.dialog'), - array('system', 'drupal.announce'), - array('ckeditor', 'ckeditor'), - array('editor', 'drupal.editor.admin'), - // Depend on Vertical Tabs, so that Vertical Tabs' JavaScript is executed - // first, which ensures its behavior runs first. - array('system', 'drupal.vertical-tabs'), - ), - ); - $libraries['drupal.ckeditor.drupalimage.admin'] = array( - 'title' => 'Only show the "drupalimage" plugin settings when its button is enabled.', - 'version' => \Drupal::VERSION, - 'js' => array( - $module_path . '/js/ckeditor.drupalimage.admin.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - array('system', 'drupal.vertical-tabs'), - array('system', 'drupalSettings'), - ), - ); - $libraries['drupal.ckeditor.stylescombo.admin'] = array( - 'title' => 'Only show the "stylescombo" plugin settings when its button is enabled.', - 'version' => \Drupal::VERSION, - 'js' => array( - $module_path . '/js/ckeditor.stylescombo.admin.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - array('system', 'drupal.vertical-tabs'), - array('system', 'drupalSettings'), - ), - ); - $libraries['drupal.ckeditor.drupalimagecaption-theme'] = array( - 'title' => 'Theming support for the imagecaption plugin.', - 'version' => \Drupal::VERSION, - 'js' => array( - $module_path . '/js/plugins/drupalimagecaption/theme.js' => array(), - ), - 'dependencies' => array( - array('ckeditor', 'ckeditor'), - ), - ); - $libraries['ckeditor'] = array( - 'title' => 'Loads the main CKEditor library.', - 'version' => '4.3-dev — d8-imagecaption branch commit 887d81ac1824008b690e439a1b29eb4f13b51212', - 'js' => array( - 'core/assets/vendor/ckeditor/ckeditor.js' => array( - 'preprocess' => FALSE, - ), - ), - ); - - return $libraries; -} - -/** * Implements hook_theme(). */ function ckeditor_theme() { diff --git a/core/modules/color/color.library.yml b/core/modules/color/color.library.yml new file mode 100644 index 0000000..22b02c6 --- /dev/null +++ b/core/modules/color/color.library.yml @@ -0,0 +1,19 @@ +drupal.color: + version: VERSION + js: + - { file: color.js } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once + - core/jquery.farbtastic + - color/drupal.color.preview +drupal.color.preview: + version: VERSION + js: + - { file: preview.js } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once diff --git a/core/modules/color/color.module b/core/modules/color/color.module index aaf0ba6..72491d6 100644 --- a/core/modules/color/color.module +++ b/core/modules/color/color.module @@ -773,38 +773,3 @@ function _color_rgb2hsl($rgb) { return array($h, $s, $l); } - -/** - * Implements hook_library_info(). - */ -function color_library_info() { - $libraries['drupal.color'] = array( - 'title' => 'Color', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'color') . '/color.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - array('system', 'jquery.farbtastic'), - array('color', 'drupal.color.preview'), - ), - ); - $libraries['drupal.color.preview'] = array( - 'title' => 'Color preview', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'color') . '/preview.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - ), - ); - - return $libraries; -} diff --git a/core/modules/comment/comment.library.yml b/core/modules/comment/comment.library.yml new file mode 100644 index 0000000..5629b4b --- /dev/null +++ b/core/modules/comment/comment.library.yml @@ -0,0 +1,33 @@ +drupal.comment: + version: VERSION + js: + - { file: comment-entity-form.js } + dependencies: + - core/jquery + - core/drupal + - core/drupal.form +drupal.comment-by-viewer: + version: VERSION + js: + - { file: js/comment-by-viewer.js } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings +drupal.comment-new-indicator: + version: VERSION + js: + - { file: js/comment-new-indicator.js } + dependencies: + - core/jquery + - core/drupal + - history/drupal.history + - core/drupal.displace +drupal.node-new-comments-link: + version: VERSION + js: + - { file: js/node-new-comments-link.js } + dependencies: + - core/jquery + - core/drupal + - history/drupal.history diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 1491817..970f62f 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1656,60 +1656,3 @@ function comment_file_download_access($field, EntityInterface $entity, FileInter return FALSE; } } - -/** - * Implements hook_library_info(). - */ -function comment_library_info() { - $path = drupal_get_path('module', 'comment'); - $libraries['drupal.comment'] = array( - 'title' => 'Comment', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/comment-entity-form.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupal.form'), - ), - ); - $libraries['drupal.comment-by-viewer'] = array( - 'title' => 'Annotate comments by the current viewer for targeted styling', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/comment-by-viewer.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - ), - ); - $libraries['drupal.comment-new-indicator'] = array( - 'title' => 'New comment indicator', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/comment-new-indicator.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('history', 'drupal.history'), - array('system', 'drupal.displace'), - ), - ); - $libraries['drupal.node-new-comments-link'] = array( - 'title' => 'New comments link', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/node-new-comments-link.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('history', 'drupal.history'), - ), - ); - return $libraries; -} diff --git a/core/modules/config_translation/config_translation.library.yml b/core/modules/config_translation/config_translation.library.yml new file mode 100644 index 0000000..aefcbda --- /dev/null +++ b/core/modules/config_translation/config_translation.library.yml @@ -0,0 +1,4 @@ +drupal.config_translation.admin: + version: VERSION + css: + - { file: css/config_translation.admin.css } diff --git a/core/modules/config_translation/config_translation.module b/core/modules/config_translation/config_translation.module index 0fc1170..8718423 100644 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@ -163,20 +163,6 @@ function config_translation_config_translation_type_info_alter(&$definitions) { } /** - * Implements hook_library_info(). - */ -function config_translation_library_info() { - $libraries['drupal.config_translation.admin'] = array( - 'title' => 'Configuration translation admin', - 'version' => \Drupal::VERSION, - 'css' => array( - drupal_get_path('module', 'config_translation') . '/css/config_translation.admin.css' => array(), - ), - ); - return $libraries; -} - -/** * Implements hook_local_tasks_alter(). */ function config_translation_local_tasks_alter(&$local_tasks) { diff --git a/core/modules/content_translation/content_translation.library.yml b/core/modules/content_translation/content_translation.library.yml new file mode 100644 index 0000000..deae9a5 --- /dev/null +++ b/core/modules/content_translation/content_translation.library.yml @@ -0,0 +1,10 @@ +drupal.content_translation.admin: + version: VERSION + js: + - { file: content_translation.admin.js } + css: + - { file: css/content_translation.admin.css } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 0d476cb..21ffa2a 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -386,30 +386,6 @@ function content_translation_delete_access(EntityInterface $entity, Language $la } /** - * Implements hook_library_info(). - */ -function content_translation_library_info() { - $path = drupal_get_path('module', 'content_translation'); - $libraries['drupal.content_translation.admin'] = array( - 'title' => 'Content translation UI', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/content_translation.admin.js' => array(), - ), - 'css' => array( - $path . '/css/content_translation.admin.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - ), - ); - - return $libraries; -} - -/** * Returns the key name used to store the configuration setting. * * Based on the entity type and bundle, the keys used to store configuration diff --git a/core/modules/contextual/contextual.library.yml b/core/modules/contextual/contextual.library.yml new file mode 100644 index 0000000..3bf6e15 --- /dev/null +++ b/core/modules/contextual/contextual.library.yml @@ -0,0 +1,28 @@ +drupal.contextual-links: + version: VERSION + js: + - { file: js/contextual.js, group: -100, weight: -2 } + css: + - { file: css/contextual.module.css } + - { file: css/contextual.theme.css } + - { file: css/contextual.icons.css } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/backbone + - core/modernizr + - core/jquery.once +drupal.contextual-toolbar: + version: VERSION + js: + - { file: js/contextual.toolbar.js, group: -100 } + css: + - { file: css/contextual.toolbar.css } + dependencies: + - core/jquery + - core/drupal + - core/backbone + - core/jquery.once + - core/drupal.tabbingmanager + - core/drupal.announce diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module index a465e47..9a61095 100644 --- a/core/modules/contextual/contextual.module +++ b/core/modules/contextual/contextual.module @@ -90,56 +90,6 @@ function contextual_permission() { } /** - * Implements hook_library_info(). - */ -function contextual_library_info() { - $path = drupal_get_path('module', 'contextual'); - $libraries['drupal.contextual-links'] = array( - 'title' => 'Contextual Links', - 'website' => 'http://drupal.org/node/473268', - 'version' => \Drupal::VERSION, - 'js' => array( - // Add the JavaScript, with a group and weight such that it will run - // before modules/contextual/js/contextual.toolbar.js. - $path . '/js/contextual.js' => array('group' => JS_LIBRARY, 'weight' => -2), - ), - 'css' => array( - $path . '/css/contextual.module.css' => array(), - $path . '/css/contextual.theme.css' => array(), - $path . '/css/contextual.icons.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'backbone'), - array('system', 'modernizr'), - array('system', 'jquery.once'), - ), - ); - $libraries['drupal.contextual-toolbar'] = array( - 'title' => 'Contextual Links Toolbar Tab', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/contextual.toolbar.js' => array('group' => JS_LIBRARY), - ), - 'css' => array( - $path . '/css/contextual.toolbar.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'backbone'), - array('system', 'jquery.once'), - array('system', 'drupal.tabbingmanager'), - array('system', 'drupal.announce'), - ), - ); - - return $libraries; -} - -/** * Implements hook_element_info(). */ function contextual_element_info() { diff --git a/core/modules/edit/edit.library.yml b/core/modules/edit/edit.library.yml new file mode 100644 index 0000000..98a9f4c --- /dev/null +++ b/core/modules/edit/edit.library.yml @@ -0,0 +1,46 @@ +edit: + version: VERSION + js: + - { file: js/edit.js, scope: footer } + - { file: js/util.js, scope: footer } + - { file: js/models/AppModel.js, scope: footer } + - { file: js/models/EntityModel.js, scope: footer } + - { file: js/models/FieldModel.js, scope: footer } + - { file: js/models/EditorModel.js, scope: footer } + - { file: js/views/AppView.js, scope: footer } + - { file: js/views/FieldDecorationView.js, scope: footer } + - { file: js/views/EntityDecorationView.js, scope: footer } + - { file: js/views/EntityToolbarView.js, scope: footer } + - { file: js/views/ContextualLinkView.js, scope: footer } + - { file: js/views/FieldToolbarView.js, scope: footer } + - { file: js/views/EditorView.js, scope: footer } + - { file: js/theme.js, scope: footer } + css: + - { file: css/edit.module.css } + - { file: css/edit.theme.css } + - { file: css/edit.icons.css } + dependencies: + - core/jquery + - core/underscore + - core/backbone + - core/jquery.form + - core/jquery.ui.position + - core/drupal + - core/drupal.displace + - core/drupal.form + - core/drupal.ajax + - core/drupal.debounce + - core/drupalSettings + - core/drupal.dialog +edit.inPlaceEditor.form: + version: VERSION + js: + - { file: js/editors/formEditor.js, scope: footer } + dependencies: + - edit/edit +edit.inPlaceEditor.plainText: + version: VERSION + js: + - { file: js/editors/plainTextEditor.js, scope: footer } + dependencies: + - edit/edit diff --git a/core/modules/edit/edit.module b/core/modules/edit/edit.module index bc7b314..cb4be31 100644 --- a/core/modules/edit/edit.module +++ b/core/modules/edit/edit.module @@ -40,81 +40,6 @@ function edit_page_build(&$page) { } /** - * Implements hook_library_info(). - */ -function edit_library_info() { - $path = drupal_get_path('module', 'edit'); - $options = array( - 'scope' => 'footer', - ); - $libraries['edit'] = array( - 'title' => 'Edit: in-place editing', - 'version' => \Drupal::VERSION, - 'js' => array( - // Core. - $path . '/js/edit.js' => $options, - $path . '/js/util.js' => $options, - // Models. - $path . '/js/models/AppModel.js' => $options, - $path . '/js/models/EntityModel.js' => $options, - $path . '/js/models/FieldModel.js' => $options, - $path . '/js/models/EditorModel.js' => $options, - // Views. - $path . '/js/views/AppView.js' => $options, - $path . '/js/views/FieldDecorationView.js' => $options, - $path . '/js/views/EntityDecorationView.js' => $options, - $path . '/js/views/EntityToolbarView.js' => $options, - $path . '/js/views/ContextualLinkView.js' => $options, - $path . '/js/views/FieldToolbarView.js' => $options, - $path . '/js/views/EditorView.js' => $options, - // Other. - $path . '/js/theme.js' => $options, - ), - 'css' => array( - $path . '/css/edit.module.css' => array(), - $path . '/css/edit.theme.css' => array(), - $path . '/css/edit.icons.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'underscore'), - array('system', 'backbone'), - array('system', 'jquery.form'), - array('system', 'jquery.ui.position'), - array('system', 'drupal'), - array('system', 'drupal.displace'), - array('system', 'drupal.form'), - array('system', 'drupal.ajax'), - array('system', 'drupal.debounce'), - array('system', 'drupalSettings'), - array('system', 'drupal.dialog'), - ), - ); - $libraries['edit.inPlaceEditor.form'] = array( - 'title' => 'Form in-place editor', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/editors/formEditor.js' => $options, - ), - 'dependencies' => array( - array('edit', 'edit'), - ), - ); - $libraries['edit.inPlaceEditor.plainText'] = array( - 'title' => 'Plain text in-place editor', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/editors/plainTextEditor.js' => $options, - ), - 'dependencies' => array( - array('edit', 'edit'), - ), - ); - - return $libraries; -} - -/** * Implement hook_library_info_alter(). * * Allow the admin theme to override the Edit entity toolbar's default styling. @@ -124,8 +49,8 @@ function edit_library_info() { function edit_library_info_alter(&$libraries, $module) { if ($module == 'edit' && isset($libraries['edit'])) { $css = _edit_theme_css(); - foreach ($css as $css_file) { - $libraries['edit']['css'][$css_file] = array(); + foreach ($css as $css_file => $file) { + $libraries['edit']['css'][$css_file] = $file; } } } @@ -207,7 +132,7 @@ function _edit_theme_css($theme = NULL) { if (isset($info['edit_stylesheets'])) { $css = $info['edit_stylesheets']; foreach ($css as $key => $path) { - $css[$key] = $theme_path . '/' . $path; + $css[$key] = array('data' => $theme_path . '/' . $path, 'type' => 'file'); } } if (isset($info['base theme'])) { diff --git a/core/modules/editor/editor.library.yml b/core/modules/editor/editor.library.yml new file mode 100644 index 0000000..aca72d0 --- /dev/null +++ b/core/modules/editor/editor.library.yml @@ -0,0 +1,37 @@ +drupal.editor.admin: + version: VERSION + js: + - { file: js/editor.admin.js } + dependencies: + - core/jquery + - core/drupal +drupal.editor: + version: VERSION + js: + - { file: js/editor.js } + css: + - { file: css/editor.css } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once +drupal.editor.dialog: + version: VERSION + js: + - { file: js/editor.dialog.js, weight: 2 } + dependencies: + - core/jquery + - core/drupal.dialog + - core/drupal.ajax + - core/drupalSettings +edit.inPlaceEditor.formattedText: + version: VERSION + js: + - { file: js/editor.formattedTextEditor.js, scope: footer, attributes: { defer: true } } + - { settings: { editor: { getUntransformedTextURL: /drupal8/lib.php/editor/%21entity_type/%21id/%21field_name/%21langcode/%21view_mode } } } + dependencies: + - edit/edit + - editor/drupal.editor + - core/drupal.ajax + - core/drupalSettings diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index affe711..12abc1d 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -63,82 +63,6 @@ function editor_element_info() { } /** - * Implements hook_library_info(). - */ -function editor_library_info() { - $path = drupal_get_path('module', 'editor'); - - $libraries['drupal.editor.admin'] = array( - 'title' => 'Text Editor', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/editor.admin.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - ), - ); - $libraries['drupal.editor'] = array( - 'title' => 'Text Editor', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/editor.js' => array(), - ), - 'css' => array( - $path . '/css/editor.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - ), - ); - - $libraries['drupal.editor.dialog'] = array( - 'title' => 'Text Editor Dialog', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/editor.dialog.js' => array('weight' => 2), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal.dialog'), - array('system', 'drupal.ajax'), - array('system', 'drupalSettings'), - ), - ); - - $libraries['edit.inPlaceEditor.formattedText'] = array( - 'title' => 'Formatted text in-place editor', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/editor.formattedTextEditor.js' => array( - 'scope' => 'footer', - 'attributes' => array('defer' => TRUE), - ), - array( - 'type' => 'setting', - 'data' => array( - 'editor' => array( - 'getUntransformedTextURL' => url('editor/!entity_type/!id/!field_name/!langcode/!view_mode'), - ) - ) - ), - ), - 'dependencies' => array( - array('edit', 'edit'), - array('editor', 'drupal.editor'), - array('system', 'drupal.ajax'), - array('system', 'drupalSettings'), - ), - ); - - return $libraries; -} - -/** * Implements hook_form_FORM_ID_alter(). */ function editor_form_filter_admin_overview_alter(&$form, $form_state) { diff --git a/core/modules/field_ui/field_ui.library.yml b/core/modules/field_ui/field_ui.library.yml new file mode 100644 index 0000000..b279bdb --- /dev/null +++ b/core/modules/field_ui/field_ui.library.yml @@ -0,0 +1,11 @@ +drupal.field_ui: + version: VERSION + js: + - { file: field_ui.js } + css: + - { file: css/field_ui.admin.css } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once diff --git a/core/modules/field_ui/field_ui.module b/core/modules/field_ui/field_ui.module index 2033cf6..f115d7e 100644 --- a/core/modules/field_ui/field_ui.module +++ b/core/modules/field_ui/field_ui.module @@ -254,30 +254,6 @@ function field_ui_form_node_type_form_submit($form, &$form_state) { } /** - * Implements hook_library_info(). - */ -function field_ui_library_info() { - $libraries['drupal.field_ui'] = array( - 'title' => 'Field UI', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'field_ui') . '/field_ui.js' => array(), - ), - 'css' => array( - drupal_get_path('module', 'field_ui') . '/css/field_ui.admin.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - ), - ); - - return $libraries; -} - -/** * Implements hook_view_mode_presave(). */ function field_ui_view_mode_presave(EntityViewModeInterface $view_mode) { diff --git a/core/modules/file/file.library.yml b/core/modules/file/file.library.yml new file mode 100644 index 0000000..42fdfc7 --- /dev/null +++ b/core/modules/file/file.library.yml @@ -0,0 +1,10 @@ +drupal.file: + version: VERSION + js: + - { file: file.js } + css: + - { file: css/file.admin.css } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings diff --git a/core/modules/file/file.module b/core/modules/file/file.module index 4041886..d3828af 100644 --- a/core/modules/file/file.module +++ b/core/modules/file/file.module @@ -1920,29 +1920,6 @@ function file_get_file_references(File $file, $field = NULL, $age = EntityStorag */ /** - * Implements hook_library_info(). - */ -function file_library_info() { - $libraries['drupal.file'] = array( - 'title' => 'File', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'file') . '/file.js' => array(), - ), - 'css' => array( - drupal_get_path('module', 'file') . '/css/file.admin.css' - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - ), - ); - - return $libraries; -} - -/** * Implements hook_permission(). */ function file_permission() { diff --git a/core/modules/filter/filter.library.yml b/core/modules/filter/filter.library.yml new file mode 100644 index 0000000..6fb4cf4 --- /dev/null +++ b/core/modules/filter/filter.library.yml @@ -0,0 +1,33 @@ +drupal.filter.admin: + version: VERSION + js: + - { file: filter.admin.js } + css: + - { file: css/filter.admin.css } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once + - core/drupal.form +drupal.filter.filter_html.admin: + version: VERSION + js: + - { file: filter.filter_html.admin.js } + dependencies: + - core/jquery + - core/jquery.once + - core/underscore +drupal.filter: + version: VERSION + js: + - { file: filter.js } + css: + - { file: css/filter.admin.css } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once +caption: + version: VERSION + css: + - { file: css/filter.caption.css } diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index 4962044..e85c269 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -1438,63 +1438,3 @@ function theme_filter_html_image_secure_image(&$variables) { function filter_page_build(&$page) { $page['#attached']['library'][] = array('filter', 'caption'); } - -/** - * Implements hook_library_info(). - */ -function filter_library_info() { - $path = drupal_get_path('module', 'filter'); - - $libraries['drupal.filter.admin'] = array( - 'title' => 'Filter', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/filter.admin.js' => array(), - ), - 'css' => array( - $path . '/css/filter.admin.css' - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - array('system', 'drupal.form'), - ), - ); - $libraries['drupal.filter.filter_html.admin'] = array( - 'title' => 'Automatic "Limit allowed HTML tags" filter setting updating.', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/filter.filter_html.admin.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'jquery.once'), - array('system', 'underscore'), - ), - ); - $libraries['drupal.filter'] = array( - 'title' => 'Filter', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/filter.js' => array(), - ), - 'css' => array( - $path . '/css/filter.admin.css' - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - ), - ); - $libraries['caption'] = array( - 'title' => 'Captions for images and alignments', - 'version' => \Drupal::VERSION, - 'css' => array( - $path . '/css/filter.caption.css', - ), - ); - - return $libraries; -} diff --git a/core/modules/forum/forum.library.yml b/core/modules/forum/forum.library.yml new file mode 100644 index 0000000..45e5ebf --- /dev/null +++ b/core/modules/forum/forum.library.yml @@ -0,0 +1,4 @@ +forum.index: + version: VERSION + css: + - { file: css/forum.module.css } diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 95ebe76..7bde8b1 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -876,20 +876,3 @@ function template_preprocess_forum_submitted(&$variables) { function theme_forum_form(array $variables) { return drupal_render_children($variables['form']); } - -/** - * Implements hook_library_info(). - * - * Forum specific libraries. - */ -function forum_library_info() { - $libraries['forum.index'] = array( - 'title' => 'Forum index', - 'version' => \Drupal::VERSION, - 'css' => array( - drupal_get_path('module', 'forum') . '/css/forum.module.css' => array(), - ), - ); - - return $libraries; -} diff --git a/core/modules/history/history.library.yml b/core/modules/history/history.library.yml new file mode 100644 index 0000000..8154bf7 --- /dev/null +++ b/core/modules/history/history.library.yml @@ -0,0 +1,9 @@ +drupal.history: + version: VERSION + js: + - { file: js/history.js } + dependencies: + - core/jquery + - core/drupalSettings + - core/drupal + - core/drupal.ajax diff --git a/core/modules/history/history.module b/core/modules/history/history.module index 19056ad..b45074a 100644 --- a/core/modules/history/history.module +++ b/core/modules/history/history.module @@ -182,24 +182,3 @@ function history_user_delete($account) { ->condition('uid', $account->id()) ->execute(); } - -/** - * Implements hook_library_info(). - */ -function history_library_info() { - $libraries['drupal.history'] = array( - 'title' => 'History', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'history') . '/js/history.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupalSettings'), - array('system', 'drupal'), - array('system', 'drupal.ajax'), - ), - ); - - return $libraries; -} diff --git a/core/modules/language/language.library.yml b/core/modules/language/language.library.yml new file mode 100644 index 0000000..4e46d3c --- /dev/null +++ b/core/modules/language/language.library.yml @@ -0,0 +1,8 @@ +language.admin: + version: VERSION + js: + - { file: language.admin.js } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once diff --git a/core/modules/language/language.module b/core/modules/language/language.module index b0dd216..c4c3a81 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -535,26 +535,6 @@ function language_delete($langcode) { } /** - * Implements hook_library_info(). - */ -function language_library_info() { - $libraries['language.admin'] = array( - 'title' => 'Language detection admin', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'language') . '/language.admin.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - ), - ); - - return $libraries; -} - -/** * Implements hook_language_types_info(). * * Defines the three core language types: diff --git a/core/modules/locale/locale.library.yml b/core/modules/locale/locale.library.yml new file mode 100644 index 0000000..106ffcc --- /dev/null +++ b/core/modules/locale/locale.library.yml @@ -0,0 +1,16 @@ +drupal.locale.admin: + version: VERSION + js: + - { file: locale.admin.js } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once +drupal.locale.datepicker: + version: VERSION + js: + - { file: locale.datepicker.js } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index e9b539c..17591ec 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -631,38 +631,6 @@ function locale_js_translate(array $files = array()) { } /** - * Implements hook_library_info(). - */ -function locale_library_info() { - $libraries['drupal.locale.admin'] = array( - 'title' => 'Locale', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'locale') . '/locale.admin.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - ), - ); - $libraries['drupal.locale.datepicker'] = array( - 'title' => 'Locale Datepicker UI', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'locale') . '/locale.datepicker.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - ), - ); - - return $libraries; -} - -/** * Implement hook_library_info_alter(). * * Provides the language support for the jQuery UI Date Picker. diff --git a/core/modules/menu/menu.library.yml b/core/modules/menu/menu.library.yml new file mode 100644 index 0000000..32dc303 --- /dev/null +++ b/core/modules/menu/menu.library.yml @@ -0,0 +1,15 @@ +drupal.menu: + version: VERSION + js: + - { file: menu.js } + dependencies: + - core/jquery + - core/drupal + - core/drupal.form +drupal.menu.admin: + version: VERSION + js: + - { file: menu.admin.js } + dependencies: + - core/jquery + - core/drupal diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module index 7fce53c..5903c81 100644 --- a/core/modules/menu/menu.module +++ b/core/modules/menu/menu.module @@ -686,34 +686,3 @@ function menu_preprocess_block(&$variables) { $variables['attributes']['role'] = 'navigation'; } } - -/** - * Implements hook_library_info(). - */ -function menu_library_info() { - $libraries['drupal.menu'] = array( - 'title' => 'Menu', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'menu') . '/menu.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupal.form'), - ), - ); - $libraries['drupal.menu.admin'] = array( - 'title' => 'Menu admin', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'menu') . '/menu.admin.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - ), - ); - - return $libraries; -} diff --git a/core/modules/node/node.library.yml b/core/modules/node/node.library.yml new file mode 100644 index 0000000..e0fd4e9 --- /dev/null +++ b/core/modules/node/node.library.yml @@ -0,0 +1,24 @@ +drupal.node: + version: VERSION + js: + - { file: node.js } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/drupal.form +drupal.node.preview: + version: VERSION + js: + - { file: node.preview.js } + dependencies: + - core/jquery + - core/drupal +drupal.content_types: + version: VERSION + js: + - { file: content_types.js } + dependencies: + - core/jquery + - core/drupal + - core/drupal.form diff --git a/core/modules/node/node.module b/core/modules/node/node.module index a850c8a..f15c218 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -2000,50 +2000,6 @@ function node_language_delete($language) { } /** - * Implements hook_library_info(). - */ -function node_library_info() { - $libraries['drupal.node'] = array( - 'title' => 'Node', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'node') . '/node.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'drupal.form'), - ), - ); - $libraries['drupal.node.preview'] = array( - 'title' => 'Node preview', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'node') . '/node.preview.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - ), - ); - $libraries['drupal.content_types'] = array( - 'title' => 'Content types', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'node') . '/content_types.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupal.form'), - ), - ); - - return $libraries; -} - -/** * Marks a node to be re-indexed by the node_search plugin. * * @param int $nid diff --git a/core/modules/path/path.library.yml b/core/modules/path/path.library.yml new file mode 100644 index 0000000..c42039d --- /dev/null +++ b/core/modules/path/path.library.yml @@ -0,0 +1,8 @@ +drupal.path: + version: VERSION + js: + - { file: path.js } + dependencies: + - core/jquery + - core/drupal + - core/drupal.form diff --git a/core/modules/path/path.module b/core/modules/path/path.module index 8e96610..5abff31 100644 --- a/core/modules/path/path.module +++ b/core/modules/path/path.module @@ -265,23 +265,3 @@ function path_entity_predelete(EntityInterface $entity) { \Drupal::service('path.crud')->delete(array('source' => $uri['path'])); } } - -/** - * Implements hook_library_info(). - */ -function path_library_info() { - $libraries['drupal.path'] = array( - 'title' => 'Path', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'path') . '/path.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupal.form'), - ), - ); - - return $libraries; -} diff --git a/core/modules/picture/picture.library.yml b/core/modules/picture/picture.library.yml new file mode 100644 index 0000000..eba44f5 --- /dev/null +++ b/core/modules/picture/picture.library.yml @@ -0,0 +1,6 @@ +picturefill: + version: VERSION + js: + - { file: picturefill/picturefill.js, type: file, weight: -10, group: 0 } + dependencies: + - core/matchmedia diff --git a/core/modules/picture/picture.module b/core/modules/picture/picture.module index 72f52a5..ba1ed96 100644 --- a/core/modules/picture/picture.module +++ b/core/modules/picture/picture.module @@ -72,24 +72,6 @@ function picture_menu() { } /** - * Implements hook_library_info(). - */ -function picture_library_info() { - $libraries['picturefill'] = array( - 'title' => t('Picturefill'), - 'website' => 'http://drupal.org/node/1775530', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'picture') . '/picturefill/picturefill.js' => array('type' => 'file', 'weight' => -10, 'group' => JS_DEFAULT), - ), - 'dependencies' => array( - array('system', 'matchmedia'), - ), - ); - return $libraries; -} - -/** * Load one picture by its identifier. * * @param int $id diff --git a/core/modules/shortcut/shortcut.library.yml b/core/modules/shortcut/shortcut.library.yml new file mode 100644 index 0000000..087784d --- /dev/null +++ b/core/modules/shortcut/shortcut.library.yml @@ -0,0 +1,13 @@ +drupal.shortcut.admin: + version: VERSION + js: + - { file: shortcut.admin.js } + dependencies: + - core/jquery + - core/drupal +drupal.shortcut: + version: VERSION + css: + - { file: css/shortcut.module.css } + - { file: css/shortcut.theme.css } + - { file: css/shortcut.icons.css } diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index 8c7c869..d2957a0 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -475,32 +475,3 @@ function shortcut_toolbar() { return $items; } - -/** - * Implements hook_library_info(). - */ -function shortcut_library_info() { - $path = drupal_get_path('module', 'shortcut'); - $libraries['drupal.shortcut.admin'] = array( - 'title' => 'Shortcut configuration', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/shortcut.admin.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - ), - ); - $libraries['drupal.shortcut'] = array( - 'title' => 'Shortcut UI', - 'version' => \Drupal::VERSION, - 'css' => array( - $path . '/css/shortcut.module.css' => array(), - $path . '/css/shortcut.theme.css' => array(), - $path . '/css/shortcut.icons.css' => array(), - ), - ); - - return $libraries; -} diff --git a/core/modules/simpletest/simpletest.library.yml b/core/modules/simpletest/simpletest.library.yml new file mode 100644 index 0000000..b934485 --- /dev/null +++ b/core/modules/simpletest/simpletest.library.yml @@ -0,0 +1,13 @@ +drupal.simpletest: + version: VERSION + js: + - { file: simpletest.js } + css: + - { file: css/simpletest.module.css } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once + - core/drupal.tableselect + - core/drupal.debounce diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module index bd50676..04657af 100644 --- a/core/modules/simpletest/simpletest.module +++ b/core/modules/simpletest/simpletest.module @@ -698,32 +698,6 @@ function simpletest_mail_alter(&$message) { } /** - * Implements hook_library_info(). - */ -function simpletest_library_info() { - $libraries['drupal.simpletest'] = array( - 'title' => 'Simpletest', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'simpletest') . '/simpletest.js' => array(), - ), - 'css' => array( - drupal_get_path('module', 'simpletest') . '/css/simpletest.module.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - array('system', 'drupal.tableselect'), - array('system', 'drupal.debounce'), - ), - ); - - return $libraries; -} - -/** * Gets PHPUnit Classes. * * @param string $module diff --git a/core/modules/statistics/statistics.library.yml b/core/modules/statistics/statistics.library.yml new file mode 100644 index 0000000..b241fdb --- /dev/null +++ b/core/modules/statistics/statistics.library.yml @@ -0,0 +1,8 @@ +drupal.statistics: + version: VERSION + js: + - { file: statistics.js, scope: footer } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings diff --git a/core/modules/statistics/statistics.module b/core/modules/statistics/statistics.module index a5fad17..12857ce 100644 --- a/core/modules/statistics/statistics.module +++ b/core/modules/statistics/statistics.module @@ -252,28 +252,6 @@ function statistics_preprocess_block(&$variables) { } /** - * Implements hook_library_info(). - */ -function statistics_library_info() { - $libraries['drupal.statistics'] = array( - 'title' => 'Statistics', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'statistics') . '/statistics.js' => array( - 'scope' => 'footer' - ), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - ), - ); - - return $libraries; -} - -/** * Implements hook_block_alter(). * * Removes the "popular" block from display if the module is not configured diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/NoJavaScriptAnonymousTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/NoJavaScriptAnonymousTest.php index 76b941a..a13e38a 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/NoJavaScriptAnonymousTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/NoJavaScriptAnonymousTest.php @@ -65,16 +65,11 @@ protected function assertNoJavaScriptExceptHtml5Shiv() { $this->assertNoRaw('var drupalSettings = {', 'drupalSettings is not set.'); // Ensure the HTML5 shiv exists. - $system_libraries = system_library_info(); - $html5_shiv_version = $system_libraries['html5shiv']['version']; - $html5_shiv_markup = 'core/assets/vendor/html5shiv/html5.js?v=' . $html5_shiv_version . '">'; - $this->assertRaw($html5_shiv_markup, 'HTML5 shiv JavaScript exists.'); + $this->assertRaw('html5shiv/html5.js', 'HTML5 shiv JavaScript exists.'); // Ensure no other JavaScript file exists on the page, while ignoring the // HTML5 shiv. - $content = $this->drupalGetContent(); - $this->drupalSetContent(str_replace($html5_shiv_markup, '', $content)); - $this->assertNoRaw('.js', "No other JavaScript exists."); + $this->assertNoPattern('/(? 'setting', and the actual settings must be contained in a 'data' - * element of the value. - * - 'css': Like 'js', an array of CSS elements passed to drupal_add_css(). - * - 'dependencies': An array of libraries that are required for a library. Each - * element is an array listing the module and name of another library. Note - * that all dependencies for each dependent library will also be added when - * this library is added. - * - * Registered information for a library should contain re-usable data only. - * Module- or implementation-specific data and integration logic should be added - * separately. - * - * @return - * An array defining libraries associated with a module. - * - * @see system_library_info() - * @see drupal_add_library() - * @see drupal_get_library() - */ -function hook_library_info() { - // Library One. - $libraries['library-1'] = array( - 'title' => 'Library One', - 'website' => 'http://example.com/library-1', - 'version' => '1.2', - 'js' => array( - drupal_get_path('module', 'my_module') . '/library-1.js' => array(), - ), - 'css' => array( - drupal_get_path('module', 'my_module') . '/library-2.css' => array( - 'type' => 'file', - 'media' => 'screen', - ), - ), - ); - // Library Two. - $libraries['library-2'] = array( - 'title' => 'Library Two', - 'website' => 'http://example.com/library-2', - 'version' => '3.1-beta1', - 'js' => array( - // JavaScript settings may use the 'data' key. - array( - 'type' => 'setting', - 'data' => array('library2' => TRUE), - ), - ), - 'dependencies' => array( - // Require jQuery UI core by System module. - array('system', 'jquery.ui.core'), - // Require our other library. - array('my_module', 'library-1'), - // Require another library. - array('other_module', 'library-3'), - ), - ); - return $libraries; -} - -/** * Alters the JavaScript/CSS library registry. * * Allows certain, contributed modules to update libraries to newer versions @@ -367,8 +292,6 @@ function hook_library_info() { * name and passed by reference. * @param $module * The name of the module that registered the libraries. - * - * @see hook_library_info() */ function hook_library_info_alter(&$libraries, $module) { // Update Farbtastic to version 2.0. diff --git a/core/modules/system/system.library.yml b/core/modules/system/system.library.yml new file mode 100644 index 0000000..fcd4fcb --- /dev/null +++ b/core/modules/system/system.library.yml @@ -0,0 +1,17 @@ +drupal.system: + version: VERSION + js: + - { file: system.js } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once +drupal.system.modules: + version: VERSION + js: + - { file: system.modules.js } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once diff --git a/core/modules/taxonomy/taxonomy.library.yml b/core/modules/taxonomy/taxonomy.library.yml new file mode 100644 index 0000000..300f5d5 --- /dev/null +++ b/core/modules/taxonomy/taxonomy.library.yml @@ -0,0 +1,11 @@ +drupal.taxonomy: + version: VERSION + js: + - { file: taxonomy.js } + css: + - { file: css/taxonomy.module.css } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/drupal.tabledrag diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index 978ac62..1656bc0 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -950,27 +950,3 @@ function taxonomy_taxonomy_term_delete(Term $term) { /** * @} End of "defgroup taxonomy_index". */ - -/** - * Implements hook_library_info(). - */ -function taxonomy_library_info() { - $libraries['drupal.taxonomy'] = array( - 'title' => 'Taxonomy', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'taxonomy') . '/taxonomy.js' => array(), - ), - 'css' => array( - drupal_get_path('module', 'taxonomy') . '/css/taxonomy.module.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'drupal.tabledrag'), - ), - ); - - return $libraries; -} diff --git a/core/modules/text/text.library.yml b/core/modules/text/text.library.yml new file mode 100644 index 0000000..8328f09 --- /dev/null +++ b/core/modules/text/text.library.yml @@ -0,0 +1,8 @@ +drupal.text: + version: VERSION + js: + - { file: text.js } + dependencies: + - core/jquery + - core/jquery.once + - core/drupal diff --git a/core/modules/text/text.module b/core/modules/text/text.module index 675c63e..81d46a9 100644 --- a/core/modules/text/text.module +++ b/core/modules/text/text.module @@ -8,26 +8,6 @@ use Drupal\Core\Entity\EntityInterface; /** - * Implements hook_library_info(). - */ -function text_library_info() { - $libraries['drupal.text'] = array( - 'title' => 'Text', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'text') . '/text.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'jquery.once'), - array('system', 'drupal'), - ), - ); - - return $libraries; -} - -/** * Implements hook_help(). */ function text_help($path, $arg) { diff --git a/core/modules/toolbar/toolbar.library.yml b/core/modules/toolbar/toolbar.library.yml new file mode 100644 index 0000000..f7ef629 --- /dev/null +++ b/core/modules/toolbar/toolbar.library.yml @@ -0,0 +1,38 @@ +toolbar: + version: VERSION + js: + - { file: js/toolbar.js } + css: + - { file: css/toolbar.module.css } + - { file: css/toolbar.theme.css } + - { file: css/toolbar.icons.css } + dependencies: + - core/modernizr + - core/jquery + - core/drupal + - core/drupalSettings + - core/drupal.announce + - core/backbone + - core/matchmedia + - core/jquery.once + - core/drupal.displace + - toolbar/toolbar.menu +toolbar.menu: + version: VERSION + js: + - { file: js/toolbar.menu.js } + css: + - { file: css/toolbar.menu.css } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once +toolbar.escapeAdmin: + version: VERSION + js: + - { file: js/escapeAdmin.js } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module index c8612df..c5cb26a 100644 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -559,67 +559,6 @@ function toolbar_get_rendered_subtrees() { } /** - * Implements hook_library_info(). - */ -function toolbar_library_info() { - $libraries['toolbar'] = array( - 'title' => 'Toolbar', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'toolbar') . '/js/toolbar.js' => array(), - ), - 'css' => array( - drupal_get_path('module', 'toolbar') . '/css/toolbar.module.css', - drupal_get_path('module', 'toolbar') . '/css/toolbar.theme.css', - drupal_get_path('module', 'toolbar') . '/css/toolbar.icons.css', - ), - 'dependencies' => array( - array('system', 'modernizr'), - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'drupal.announce'), - array('system', 'backbone'), - array('system', 'matchmedia'), - array('system', 'jquery.once'), - array('system', 'drupal.displace'), - array('toolbar', 'toolbar.menu'), - ), - ); - - $libraries['toolbar.menu'] = array( - 'title' => 'Toolbar nested accordion menus.', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'toolbar') . '/js/toolbar.menu.js' => array(), - ), - 'css' => array( - drupal_get_path('module', 'toolbar') . '/css/toolbar.menu.css', - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - ), - ); - $libraries['toolbar.escapeAdmin'] = array( - 'title' => 'Provides a button to escape the administration area.', - 'version' => \Drupal::VERSION, - 'js' => array( - drupal_get_path('module', 'toolbar') . '/js/escapeAdmin.js', - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - ), - ); - - return $libraries; -} - -/** * Returns the hash of the per-user rendered toolbar subtrees. * * @return string diff --git a/core/modules/tour/tour.library.yml b/core/modules/tour/tour.library.yml new file mode 100644 index 0000000..2ee0fba --- /dev/null +++ b/core/modules/tour/tour.library.yml @@ -0,0 +1,23 @@ +tour: + version: VERSION + js: + - { file: js/tour.js, group: -100 } + dependencies: + - core/jquery + - core/drupal + - core/backbone + - tour/jquery.joyride + - tour/tour-styling +tour-styling: + version: VERSION + css: + - { file: css/tour.module.css, media: screen } +jquery.joyride: + version: VERSION + js: + - { file: js/jquery.joyride-2.0.3.js } + css: + - { file: css/joyride-2.0.3.css, media: screen } + dependencies: + - core/jquery + - core/jquery.cookie diff --git a/core/modules/tour/tour.module b/core/modules/tour/tour.module index 8bd9ec1..e24f5f9 100644 --- a/core/modules/tour/tour.module +++ b/core/modules/tour/tour.module @@ -19,54 +19,6 @@ function tour_permission() { } /** - * Implements hook_library_info(). - */ -function tour_library_info() { - $path = drupal_get_path('module', 'tour'); - - $libraries['tour'] = array( - 'title' => 'Tour', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/tour.js' => array('group' => JS_LIBRARY), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'backbone'), - array('tour', 'jquery.joyride'), - array('tour', 'tour-styling'), - ), - ); - - $libraries['tour-styling'] = array( - 'title' => 'Tour', - 'version' => \Drupal::VERSION, - 'css' => array( - $path . '/css/tour.module.css' => array('media' => 'screen'), - ), - ); - - $libraries['jquery.joyride'] = array( - 'title' => 'Joyride', - 'website' => 'https://github.com/zurb/joyride', - 'version' => '2.0.3', - 'js' => array( - $path . '/js/jquery.joyride-2.0.3.js' => array(), - ), - 'css' => array( - $path . '/css/joyride-2.0.3.css' => array('media' => 'screen'), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'jquery.cookie'), - ), - ); - - return $libraries; -} - -/** * Implements hook_toolbar(). */ function tour_toolbar() { diff --git a/core/modules/user/user.library.yml b/core/modules/user/user.library.yml new file mode 100644 index 0000000..9311d2a --- /dev/null +++ b/core/modules/user/user.library.yml @@ -0,0 +1,22 @@ +drupal.user: + version: VERSION + js: + - { file: user.js } + css: + - { file: css/user.module.css } + dependencies: + - core/jquery + - core/drupal + - core/jquery.once +drupal.user.permissions: + version: VERSION + js: + - { file: user.permissions.js } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings +drupal.user.icons: + version: VERSION + css: + - { file: css/user.icons.css } diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 6744e9e..31407f2 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1905,51 +1905,6 @@ function user_toolbar() { } /** - * Implements hook_library_info(). - */ -function user_library_info() { - $path = drupal_get_path('module', 'user'); - $libraries['drupal.user'] = array( - 'title' => 'User', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/user.js' => array(), - ), - 'css' => array( - $path . '/css/user.module.css' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'jquery.once'), - ), - ); - - $libraries['drupal.user.permissions'] = array( - 'title' => 'User permissions', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/user.permissions.js' => array(), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - ), - ); - - $libraries['drupal.user.icons'] = array( - 'title' => 'User icon styling', - 'version' => \Drupal::VERSION, - 'css' => array( - $path . '/css/user.icons.css' => array(), - ), - ); - - return $libraries; -} - -/** * Logs the current user out. */ function user_logout() { diff --git a/core/modules/views/views.library.yml b/core/modules/views/views.library.yml new file mode 100644 index 0000000..80467bf --- /dev/null +++ b/core/modules/views/views.library.yml @@ -0,0 +1,27 @@ +views.module: + version: VERSION + css: + - { file: css/views.module.css } +views.ajax: + version: VERSION + js: + - { file: js/base.js, group: 0 } + - { file: js/ajax_view.js, group: 0 } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once + - core/jquery.form + - core/drupal.ajax +views.contextual-links: + version: VERSION + js: + - { file: js/views-contextual.js, group: -100, weight: -10 } + dependencies: + - core/jquery + - core/drupal +views.exposed-form: + version: VERSION + css: + - { file: css/views.exposed_form.css } diff --git a/core/modules/views/views.module b/core/modules/views/views.module index 4ac7613..2772951 100644 --- a/core/modules/views/views.module +++ b/core/modules/views/views.module @@ -742,57 +742,6 @@ function views_hook_info() { } /** - * Implements hook_library_info(). - */ -function views_library_info() { - $path = drupal_get_path('module', 'views'); - $libraries['views.module'] = array( - 'title' => 'Views base', - 'version' => \Drupal::VERSION, - 'css' => array( - "$path/css/views.module.css" - ), - ); - $libraries['views.ajax'] = array( - 'title' => 'Views AJAX', - 'version' => \Drupal::VERSION, - 'js' => array( - "$path/js/base.js" => array('group' => JS_DEFAULT), - "$path/js/ajax_view.js" => array('group' => JS_DEFAULT), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - array('system', 'jquery.form'), - array('system', 'drupal.ajax'), - ), - ); - $libraries['views.contextual-links'] = array( - 'title' => 'Views Contextual links', - 'version' => \Drupal::VERSION, - 'js' => array( - // Set to -10 to move it before the contextual links javascript file. - "$path/js/views-contextual.js" => array('group' => JS_LIBRARY, 'weight' => -10), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - ), - ); - $libraries['views.exposed-form'] = array( - 'title' => 'Views exposed form', - 'version' => \Drupal::VERSION, - 'css' => array( - "$path/css/views.exposed_form.css", - ), - ); - - return $libraries; -} - -/** * Fetch a list of all base tables available * * @param $type diff --git a/core/modules/views_ui/views_ui.library.yml b/core/modules/views_ui/views_ui.library.yml new file mode 100644 index 0000000..214e325 --- /dev/null +++ b/core/modules/views_ui/views_ui.library.yml @@ -0,0 +1,18 @@ +views_ui.admin: + version: VERSION + js: + - { file: js/ajax.js, group: 0 } + - { file: js/dialog.views.js, group: 0 } + - { file: js/views-admin.js, group: 0 } + dependencies: + - core/jquery + - core/drupal + - core/drupalSettings + - core/jquery.once + - core/jquery.form + - core/drupal.ajax + - views/views.ajax +views_ui.listing: + version: VERSION + js: + - { file: js/views_ui.listing.js, group: 0 } diff --git a/core/modules/views_ui/views_ui.module b/core/modules/views_ui/views_ui.module index c175caa..27ac0ca 100644 --- a/core/modules/views_ui/views_ui.module +++ b/core/modules/views_ui/views_ui.module @@ -129,44 +129,6 @@ function views_ui_permission() { } /** - * Implements hook_library_info(). - */ -function views_ui_library_info() { - $libraries = array(); - - $path = drupal_get_path('module', 'views_ui') . '/js/'; - - $libraries['views_ui.admin'] = array( - 'title' => 'Views UI ADMIN', - 'version' => \Drupal::VERSION, - 'js' => array( - $path . 'ajax.js' => array('group' => JS_DEFAULT), - $path . 'dialog.views.js' => array('group' => JS_DEFAULT), - $path . 'views-admin.js' => array('group' => JS_DEFAULT), - ), - 'dependencies' => array( - array('system', 'jquery'), - array('system', 'drupal'), - array('system', 'drupalSettings'), - array('system', 'jquery.once'), - array('system', 'jquery.form'), - array('system', 'drupal.ajax'), - array('views', 'views.ajax'), - ), - ); - - $libraries['views_ui.listing'] = array( - 'title' => 'Views UI listing', - 'version' => Drupal::VERSION, - 'js' => array( - $path . 'views_ui.listing.js' => array('group' => JS_DEFAULT), - ), - ); - - return $libraries; -} - -/** * Implements hook_preprocess_HOOK() for views templates. */ function views_ui_preprocess_views_view(&$variables) { diff --git a/core/themes/bartik/bartik.library.yml b/core/themes/bartik/bartik.library.yml new file mode 100644 index 0000000..c20e1e1 --- /dev/null +++ b/core/themes/bartik/bartik.library.yml @@ -0,0 +1,4 @@ +maintenance_page: + version: VERSION + css: + - { file: css/maintenance-page.css, group: 100 } diff --git a/core/themes/bartik/bartik.theme b/core/themes/bartik/bartik.theme index e334125..b1e17bb 100644 --- a/core/themes/bartik/bartik.theme +++ b/core/themes/bartik/bartik.theme @@ -131,23 +131,6 @@ function bartik_preprocess_maintenance_page(&$variables) { } /** - * Implements hook_library_info(). - */ -function bartik_library_info() { - $path = drupal_get_path('theme', 'bartik'); - $libraries['maintenance_page'] = array( - 'version' => \DRUPAL::VERSION, - 'css' => array( - $path . '/css/maintenance-page.css' => array( - 'group' => CSS_AGGREGATE_THEME, - ), - ), - ); - - return $libraries; -} - -/** * Implements hook_preprocess_HOOK() for node templates. */ function bartik_preprocess_node(&$variables) { diff --git a/core/themes/seven/seven.library.yml b/core/themes/seven/seven.library.yml new file mode 100644 index 0000000..01c3763 --- /dev/null +++ b/core/themes/seven/seven.library.yml @@ -0,0 +1,6 @@ +install-page: + version: VERSION + js: + - { file: js/mobile.install.js, group: 100 } + css: + - { file: install-page.css, group: 100 } diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 7defd49..27262ae 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -8,29 +8,6 @@ use Drupal\Core\Template\RenderWrapper; /** - * Implements hook_library_info(). - */ -function seven_library_info() { - $path = drupal_get_path('theme', 'seven'); - - $libraries['install-page'] = array( - 'version' => \Drupal::VERSION, - 'js' => array( - $path . '/js/mobile.install.js' => array( - 'group' => JS_THEME, - ), - ), - 'css' => array( - $path . '/install-page.css' => array( - 'group' => CSS_AGGREGATE_THEME, - ), - ), - ); - - return $libraries; -} - -/** * Implements hook_preprocess_HOOK() for HTML document templates. */ function seven_preprocess_html(&$variables) {