diff --cc core/includes/batch.inc index 597ab43,c72fa91..0000000 --- a/core/includes/batch.inc +++ b/core/includes/batch.inc @@@ -150,46 -150,30 +150,47 @@@ function _batch_progress_page() $batch['url_options']['query']['op'] = $new_op; $url = url($batch['url'], $batch['url_options']); - $element = array( - // Redirect through a 'Refresh' meta tag if JavaScript is disabled. - '#prefix' => '', - '#tag' => 'meta', - '#attributes' => array( - 'http-equiv' => 'Refresh', - 'content' => '0; URL=' . $url, - ), - ); - drupal_add_html_head($element, 'batch_progress_meta_refresh'); - - // Adds JavaScript code and settings for clients where JavaScript is enabled. - $js_setting = array( - 'batch' => array( - 'errorMessage' => $current_set['error_message'] . '
' . $batch['error_message'], - 'initMessage' => $current_set['init_message'], - 'uri' => $url, + + $build = array( + '#theme' => 'progress_bar', + '#percent' => $percentage, + '#message' => $message, + '#label' => $label, + '#attached' => array( + 'drupal_add_html_head' => array( + array( + array( + // Redirect through a 'Refresh' meta tag if JavaScript is disabled. + '#tag' => 'meta', + '#noscript' => TRUE, + '#attributes' => array( + 'http-equiv' => 'Refresh', + 'content' => '0; URL=' . $url, + ), + ), + 'batch_progress_meta_refresh', + ), + ), + // Adds JavaScript code and settings for clients where JavaScript is enabled. + 'js' => array( + array( + 'type' => 'setting', + 'data' => array( + 'batch' => array( + 'errorMessage' => $current_set['error_message'] . '
' . $batch['error_message'], + 'initMessage' => $current_set['init_message'], + 'uri' => $url, + ), + ), + ), + ), + 'library' => array( - array('system', 'drupal.batch'), ++ array('core', 'drupal.batch'), + ), ), ); - drupal_add_js($js_setting, 'setting'); - drupal_add_library('core', 'drupal.batch'); + - return theme('progress_bar', array('percent' => $percentage, 'message' => $message, 'label' => $label)); + return drupal_render($build); } /** diff --cc core/includes/common.inc index 86fd220,a9c194d..0000000 --- a/core/includes/common.inc +++ b/core/includes/common.inc diff --cc core/includes/install.core.inc index e6a5338,a0c9565..0000000 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@@ -2104,13 -2103,12 +2104,14 @@@ function install_configure_form($form, drupal_set_message(t('All necessary changes to %dir and %file have been made, so you should remove write permissions to them now in order to avoid security risks. If you are unsure how to do so, consult the online handbook.', array('%dir' => $settings_dir, '%file' => $settings_file, '@handbook_url' => 'http://drupal.org/server-permissions')), 'warning'); } - drupal_add_library('system', 'drupal.system'); + $form['#attached']['library'][] = array('system', 'drupal.system'); // Add JavaScript time zone detection. - $form['#attached']['library'][] = array('system', 'drupal.timezone'); - drupal_add_library('core', 'drupal.timezone'); ++ $form['#attached']['library'][] = array('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'); + $js = array('copyFieldValue' => array('edit-site-mail' => array('edit-account-mail'))); + $form['#attached']['js'][] = array('data' => $js, 'type' => 'setting'); // Cache a fully-built schema. This is necessary for any invocation of // index.php because: (1) setting cache table entries requires schema diff --cc core/modules/config_translation/config_translation.module index 33a2ee7,8718423..0000000 --- a/core/modules/config_translation/config_translation.module +++ b/core/modules/config_translation/config_translation.module @@@ -161,17 -161,12 +161,3 @@@ function config_translation_config_tran $definitions['text']['form_element_class'] = '\Drupal\config_translation\FormElement\Textarea'; $definitions['date_format']['form_element_class'] = '\Drupal\config_translation\FormElement\DateFormat'; } -- --/** - * 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) { - // Alters in tab_root_ids onto the config translation local tasks. - $derivative = ConfigTranslationLocalTasks::create(\Drupal::getContainer(), 'config_translation.local_tasks'); - $derivative->alterLocalTasks($local_tasks); -} diff --cc core/modules/edit/edit.module index 3eaabcc,a47f3f3..0000000 --- a/core/modules/edit/edit.module +++ b/core/modules/edit/edit.module diff --cc core/modules/system/system.module index 1a0be69,02520d2..0000000 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module diff --cc core/modules/toolbar/toolbar.module index f6eaa41,c5cb26a..0000000 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module diff --cc core/themes/seven/seven.theme index fa99324,234a26b..0000000 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@@ -8,47 -8,23 +8,24 @@@ 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 page templates. + * Implements hook_preprocess_HOOK() for HTML document templates. */ -function seven_preprocess_html(&$variables) { +function seven_preprocess_page(&$variables) { + /** @var \Drupal\Core\Page\HtmlPage $page_object */ + $page_object = $variables['page']['#page']; + $attributes = $page_object->getBodyAttributes(); + $classes = $attributes['class']; // Add information about the number of sidebars. + if (!empty($variables['page']['sidebar_first'])) { - $variables['attributes']['class'][] = 'one-sidebar'; - $variables['attributes']['class'][] = 'sidebar-first'; + $classes[] = 'one-sidebar'; + $classes[] = 'sidebar-first'; } else { - $variables['attributes']['class'][] = 'no-sidebars'; + $classes[] = 'no-sidebars'; } -} + $attributes['class'] = $classes; -/** - * Implements hook_preprocess_HOOK() for page templates. - */ -function seven_preprocess_page(&$variables) { $variables['primary_local_tasks'] = $variables['tabs']; unset($variables['primary_local_tasks']['#secondary']); $variables['secondary_local_tasks'] = array( diff --git a/core/core.library.yml b/core/core.library.yml index cf99afd..ccd614b 100644 --- a/core/core.library.yml +++ b/core/core.library.yml @@ -1,6 +1,6 @@ backbone: remote: https://github.com/jashkenas/backbone - version: 0.9.2 + version: 1.1.0 js: - { file: assets/vendor/backbone/backbone.js, weight: -19 } dependencies: diff --git a/core/modules/edit/edit.library.yml b/core/modules/edit/edit.library.yml index c46d4c4..65739b0 100644 --- a/core/modules/edit/edit.library.yml +++ b/core/modules/edit/edit.library.yml @@ -5,6 +5,7 @@ edit: - { file: js/edit.js, scope: footer } - { file: js/util.js, scope: footer } # Models. + - { file: 'js/models/BaseModel.js', scope: footer } - { file: js/models/AppModel.js, scope: footer } - { file: js/models/EntityModel.js, scope: footer } - { file: js/models/FieldModel.js, scope: footer } diff --git a/core/modules/toolbar/toolbar.library.yml b/core/modules/toolbar/toolbar.library.yml index bd17dc3..5434935 100644 --- a/core/modules/toolbar/toolbar.library.yml +++ b/core/modules/toolbar/toolbar.library.yml @@ -2,6 +2,12 @@ toolbar: version: VERSION js: - { file: js/toolbar.js } + - { file: 'js/models/MenuModel.js' } + - { file: 'js/models/ToolbarModel.js' } + - { file: 'js/views/BodyVisualView.js' } + - { file: 'js/views/MenuVisualView.js' } + - { file: 'js/views/ToolbarAuralView.js' } + - { file: 'js/views/ToolbarVisualView.js' } css: - { file: css/toolbar.module.css } - { file: css/toolbar.theme.css }