core/modules/node/css/node.preview.css | 14 ++++------ core/modules/node/node.module | 6 ++--- .../node/src/Access/NodePreviewAccessCheck.php | 4 +-- .../node/src/Controller/NodePreviewController.php | 2 +- core/modules/node/src/Form/NodePreviewForm.php | 10 +++---- core/themes/bartik/css/style.css | 31 +++++++--------------- 6 files changed, 26 insertions(+), 41 deletions(-) diff --git a/core/modules/node/css/node.preview.css b/core/modules/node/css/node.preview.css index b648db7..9aca68a 100644 --- a/core/modules/node/css/node.preview.css +++ b/core/modules/node/css/node.preview.css @@ -9,13 +9,9 @@ width: 100%; padding: 10px; } -.node-preview-container .form-type-select { - margin-left: 25%; -} -.node-preview-backlink::before { - content: '<'; - display: inline-block; - width: 10px; - height: 10px; - color: #000; + +@media only screen and (min-width: 36em) { + .node-preview-container .form-type-select { + margin-left: 25%; + } } diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 6639300..5f1197c 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -622,8 +622,8 @@ function template_preprocess_node(&$variables) { )); $variables['label'] = $variables['elements']['title']; unset($variables['elements']['title']); - // The variable page is set to TRUE in two occasions: - // - The view mode is 'full' and we are on /node/{nid} path. + // The 'page' variable is set to TRUE in two occasions: + // - The view mode is 'full' and we are on the 'node.view' route. // - The node is in preview and view mode is either 'full' or 'default'. $variables['page'] = ($variables['view_mode'] == 'full' && (node_is_page($node)) || (isset($node->in_preview) && in_array($node->preview_view_mode, array('full', 'default')))); @@ -1046,7 +1046,7 @@ function node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL) { * Implements hook_page_build(). */ function node_page_build(&$page) { - // Add 'Back to content edit editing' link on preview page. + // Add 'Back to content editing' link on preview page. $route_match = \Drupal::routeMatch(); if ($route_match->getRouteName() == 'node.preview') { $page['page_top']['node_preview'] = array( diff --git a/core/modules/node/src/Access/NodePreviewAccessCheck.php b/core/modules/node/src/Access/NodePreviewAccessCheck.php index 3aa5934..18bbcd1 100644 --- a/core/modules/node/src/Access/NodePreviewAccessCheck.php +++ b/core/modules/node/src/Access/NodePreviewAccessCheck.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\node\Access\NodeAddAccessCheck. + * Contains \Drupal\node\Access\NodePreviewAccessCheck. */ namespace Drupal\node\Access; @@ -13,7 +13,7 @@ use Drupal\node\NodeInterface; /** - * Determines access to for node preview pages. + * Determines access to node previews. */ class NodePreviewAccessCheck implements AccessInterface { diff --git a/core/modules/node/src/Controller/NodePreviewController.php b/core/modules/node/src/Controller/NodePreviewController.php index 71acc53..9fb8d13 100644 --- a/core/modules/node/src/Controller/NodePreviewController.php +++ b/core/modules/node/src/Controller/NodePreviewController.php @@ -31,7 +31,7 @@ public function view(EntityInterface $node_preview, $view_mode_id = 'full', $lan $build['#title'] = $build['nodes']['#title']; unset($build['nodes']['#title']); - // Do not use render cache for preview. + // Don't render cache previews. unset($build['nodes']['#cache']); foreach ($node_preview->uriRelationships() as $rel) { diff --git a/core/modules/node/src/Form/NodePreviewForm.php b/core/modules/node/src/Form/NodePreviewForm.php index d85e92d..f88de15 100644 --- a/core/modules/node/src/Form/NodePreviewForm.php +++ b/core/modules/node/src/Form/NodePreviewForm.php @@ -70,14 +70,14 @@ public function buildForm(array $form, FormStateInterface $form_state, EntityInt $query_options = $node->isNew() ? array('query' => array('uuid' => $node->uuid())) : array(); $form['backlink'] = array( '#type' => 'link', - '#title' => t('Back to content editing'), + '#title' => $this->t('Back to content editing'), '#href' => $node->isNew() ? 'node/add/' . $node->bundle() : 'node/' . $node->id() . '/edit', - '#options' => array('attributes' => array('class' => array('node-preview-backlink button-action'))) + $query_options, + '#options' => array('attributes' => array('class' => array('node-preview-backlink'))) + $query_options, ); $view_mode_options = $this->entityManager->getViewModeOptions('node'); foreach ($view_mode_options as $key => $value) { - $view_mode_options[$key] = t('@value view mode', array('@value' => $value)); + $view_mode_options[$key] = $this->t('@value view mode', array('@value' => $value)); } $form['uuid'] = array( @@ -87,7 +87,7 @@ public function buildForm(array $form, FormStateInterface $form_state, EntityInt $form['view_mode'] = array( '#type' => 'select', - '#title' => t('Select a view mode'), + '#title' => $this->t('Select a view mode'), '#title_display' => 'invisible', '#options' => $view_mode_options, '#default_value' => $view_mode, @@ -98,7 +98,7 @@ public function buildForm(array $form, FormStateInterface $form_state, EntityInt $form['submit'] = array( '#type' => 'submit', - '#value' => t('Switch'), + '#value' => $this->t('Switch'), '#attributes' => array( 'class' => array('js-hide'), ), diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index 5101ed3..06d6a4e 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -849,12 +849,8 @@ ul.links { } .node-preview-container { background: #d1e8f5; - background-image: -webkit-linear-gradient(top, #d1e8f5, #d3e8f4); - background-image: -moz-linear-gradient(top, #d1e8f5, #d3e8f4); - background-image: -o-linear-gradient(top, #d1e8f5, #d3e8f4); background-image: linear-gradient(to bottom, #d1e8f5, #d3e8f4); - -webkit-box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.3333); - font-family: "Source Sans Pro", "Lucida Grande", Verdana, sans-serif; + font-family: Arial, sans-serif; box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.3333); position: fixed; z-index: 499; @@ -862,14 +858,10 @@ ul.links { padding: 10px; } .node-preview-backlink { - background: #419ff1; - background-image: -webkit-linear-gradient(top, #419ff1, #1076d5); - background-image: -moz-linear-gradient(top, #419ff1, #1076d5); - background-image: -o-linear-gradient(top, #419ff1, #1076d5); - background-image: linear-gradient(to bottom, #419ff1, #1076d5); + background-color: #419ff1; + background: url(../../..//misc/icons/000000/chevron-left.svg) left no-repeat, linear-gradient(to bottom, #419ff1, #1076d5); border: 1px solid #0048c8; border-radius: .4em; - -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); color: #fff; font-size: 0.9em; @@ -881,25 +873,22 @@ ul.links { .node-preview-backlink:focus, .node-preview-backlink:hover { background-color: #419cf1; - background-image: -webkit-linear-gradient(top, #59abf3, #2a90ef); - background-image: -moz-linear-gradient(top, #59abf3, #2a90ef); - background-image: -o-linear-gradient(top, #59abf3, #2a90ef); - background-image: linear-gradient(to bottom, #59abf3, #2a90ef); + background: url(../../..//misc/icons/000000/chevron-left.svg) left no-repeat, linear-gradient(to bottom, #59abf3, #2a90ef); border: 1px solid #0048c8; text-decoration: none; color: #fff; } .node-preview-backlink:active { background-color: #0e69be; - background-image: -webkit-linear-gradient(top, #0e69be, #2a93ef); - background-image: -moz-linear-gradient(top, #0e69be, #2a93ef); - background-image: -o-linear-gradient(top, #0e69be, #2a93ef); - background-image: -ms-linear-gradient(top, #0e69be, #2a93ef); - background-image: linear-gradient(to bottom, #0e69be, #2a93ef); + background: url(../../..//misc/icons/000000/chevron-left.svg) left no-repeat, linear-gradient(to bottom, #0e69be, #2a93ef); border: 1px solid #0048c8; - -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); } +.node-preview-backlink::before { + content: ''; + width: 10px; + display: inline-block; +} /* ----------------- Comments ----------------- */