diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php index 516b0cf..55e027c 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -125,6 +125,7 @@ public function form(array $form, array &$form_state, EntityInterface $node) { '#type' => 'item', '#wrapper_attributes' => array('class' => array('published')), '#markup' => !empty($node->status) ? t('Published') : t('Not published'), + '#access' => !empty($node->nid), ), 'changed' => array( '#type' => 'item', @@ -148,9 +149,6 @@ public function form(array $form, array &$form_state, EntityInterface $node) { '#attributes' => array( 'class' => array('node-form-revision-information'), ), - '#attached' => array( - 'js' => array(drupal_get_path('module', 'node') . '/node.js'), - ), '#weight' => 20, '#access' => $node->isNewRevision() || user_access('administer nodes'), ); @@ -186,15 +184,6 @@ public function form(array $form, array &$form_state, EntityInterface $node) { '#attributes' => array( 'class' => array('node-form-author'), ), - '#attached' => array( - 'js' => array( - drupal_get_path('module', 'node') . '/node.js', - array( - 'type' => 'setting', - 'data' => array('anonymous' => $user_config->get('anonymous')), - ), - ), - ), '#weight' => 90, ); @@ -227,9 +216,6 @@ public function form(array $form, array &$form_state, EntityInterface $node) { '#attributes' => array( 'class' => array('node-form-options'), ), - '#attached' => array( - 'js' => array(drupal_get_path('module', 'node') . '/node.js'), - ), '#weight' => 95, ); diff --git a/core/modules/node/node.js b/core/modules/node/node.js deleted file mode 100644 index cdc8cbe..0000000 --- a/core/modules/node/node.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file - * Defines Javascript behaviors for the node module. - */ - -(function ($) { - -"use strict"; - -Drupal.behaviors.nodeDetailsSummaries = { - attach: function (context) { - var $context = $(context); - $context.find('.node-form-revision-information').drupalSetSummary(function (context) { - var $context = $(context); - var revisionCheckbox = $context.find('.form-item-revision input'); - - // Return 'New revision' if the 'Create new revision' checkbox is checked, - // or if the checkbox doesn't exist, but the revision log does. For users - // without the "Administer content" permission the checkbox won't appear, - // but the revision log will if the content type is set to auto-revision. - if (revisionCheckbox.is(':checked') || (!revisionCheckbox.length && $context.find('.form-item-log textarea').length)) { - return Drupal.t('New revision'); - } - - return Drupal.t('No revision'); - }); - - $context.find('.node-form-author').drupalSetSummary(function (context) { - var $context = $(context); - var name = $context.find('.form-item-name input').val() || Drupal.settings.anonymous, - date = $context.find('.form-item-date input').val(); - return date ? - Drupal.t('By @name on @date', { '@name': name, '@date': date }) : - Drupal.t('By @name', { '@name': name }); - }); - - $context.find('.node-form-options').drupalSetSummary(function (context) { - var $context = $(context); - var vals = []; - - $context.find('input:checked').parent().each(function () { - vals.push(Drupal.checkPlain($.trim($(this).text()))); - }); - - if (!$context.find('.form-item-status input').is(':checked')) { - vals.unshift(Drupal.t('Not published')); - } - return vals.join(', '); - }); - - $context.find('fieldset.node-translation-options').drupalSetSummary(function (context) { - var $context = $(context); - var translate; - var $checkbox = $context.find('.form-item-translation-translate input'); - - if ($checkbox.size()) { - translate = $checkbox.is(':checked') ? Drupal.t('Needs to be updated') : Drupal.t('Does not need to be updated'); - } - else { - $checkbox = $context.find('.form-item-translation-retranslate input'); - translate = $checkbox.is(':checked') ? Drupal.t('Flag other translations as outdated') : Drupal.t('Do not flag other translations as outdated'); - } - - return translate; - }); - } -}; - -})(jQuery); diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 9e8fbd3..94941d7 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -3667,19 +3667,6 @@ function node_language_delete($language) { * Implements hook_library_info(). */ function node_library_info() { - $libraries['drupal.node'] = array( - 'title' => 'Node', - 'version' => 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' => VERSION, diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php index 6804b6a..dcf18f7 100644 --- a/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php +++ b/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php @@ -500,12 +500,12 @@ function testOnOffCheckbox() { $this->drupalGet($fieldEditUrl); $this->assertText( - 'Use field label instead of the "On value" as label ', + 'Use field label instead of the "On value" as label', t('Display setting checkbox available.') ); $this->assertFieldByXPath( - '*//label[@for="edit-' . $this->bool['field_name'] . '-und" and text()="MyOnValue "]', + '*//label[@for="edit-' . $this->bool['field_name'] . '-und" and text()="MyOnValue"]', TRUE, t('Default case shows "On value"') ); @@ -519,7 +519,7 @@ function testOnOffCheckbox() { // is stored and has the expected effect $this->drupalGet($fieldEditUrl); $this->assertText( - 'Use field label instead of the "On value" as label ', + 'Use field label instead of the "On value" as label', t('Display setting checkbox is available') ); $this->assertFieldChecked( @@ -527,7 +527,7 @@ function testOnOffCheckbox() { t('Display settings checkbox checked') ); $this->assertFieldByXPath( - '*//label[@for="edit-' . $this->bool['field_name'] . '-und" and text()="' . $this->bool['field_name'] . ' "]', + '*//label[@for="edit-' . $this->bool['field_name'] . '-und" and text()="' . $this->bool['field_name'] . '"]', TRUE, t('Display label changes label of the checkbox') );