diff --git a/core/misc/machine-name.js b/core/misc/machine-name.js index 2b304bf..688c4b6 100644 --- a/core/misc/machine-name.js +++ b/core/misc/machine-name.js @@ -92,7 +92,7 @@ var $source = $context.find(source_id).addClass('machine-name-source').once('machine-name'); var $target = $context.find(options.target).addClass('machine-name-target'); var $suffix = $context.find(options.suffix); - var $wrapper = $target.closest('.form-item'); + var $wrapper = $target.closest('.js-form-item'); // All elements have to exist. if (!$source.length || !$target.length || !$suffix.length || !$wrapper.length) { return; diff --git a/core/misc/states.js b/core/misc/states.js index b308a13..a9f20d5 100644 --- a/core/misc/states.js +++ b/core/misc/states.js @@ -596,7 +596,7 @@ if (e.trigger) { $(e.target) .prop('disabled', e.value) - .closest('.form-item, .js-form-submit, .js-form-wrapper').toggleClass('form-disabled', e.value) + .closest('.js-form-item, .js-form-submit, .js-form-wrapper').toggleClass('form-disabled', e.value) .find('select, input, textarea').prop('disabled', e.value); // Note: WebKit nightlies don't reflect that change correctly. @@ -607,21 +607,21 @@ $(document).on('state:required', function (e) { if (e.trigger) { if (e.value) { - var $label = $(e.target).attr({'required': 'required', 'aria-required': 'aria-required'}).closest('.form-item, .js-form-wrapper').find('label'); + var $label = $(e.target).attr({'required': 'required', 'aria-required': 'aria-required'}).closest('.js-form-item, .js-form-wrapper').find('label'); // Avoids duplicate required markers on initialization. if (!$label.hasClass('js-form-required').length) { $label.addClass('js-form-required form-required'); } } else { - $(e.target).removeAttr('required aria-required').closest('.form-item, .js-form-wrapper').find('label.js-form-required').removeClass('js-form-required form-required'); + $(e.target).removeAttr('required aria-required').closest('.js-form-item, .js-form-wrapper').find('label.js-form-required').removeClass('js-form-required form-required'); } } }); $(document).on('state:visible', function (e) { if (e.trigger) { - $(e.target).closest('.form-item, .js-form-submit, .js-form-wrapper').toggle(e.value); + $(e.target).closest('.js-form-item, .js-form-submit, .js-form-wrapper').toggle(e.value); } }); diff --git a/core/modules/filter/filter.filter_html.admin.js b/core/modules/filter/filter.filter_html.admin.js index 1a20cfa..fa04df5 100644 --- a/core/modules/filter/filter.filter_html.admin.js +++ b/core/modules/filter/filter.filter_html.admin.js @@ -71,7 +71,7 @@ var that = this; $(context).find('[name="filters[filter_html][settings][allowed_html]"]').once('filter-filter_html-updating').each(function () { that.$allowedHTMLFormItem = $(this); - that.$allowedHTMLDescription = that.$allowedHTMLFormItem.closest('.form-item').find('.description'); + that.$allowedHTMLDescription = that.$allowedHTMLFormItem.closest('.js-form-item').find('.description'); that.userTags = that._parseSetting(this.value); // Update the new allowed tags based on added text editor features. diff --git a/core/modules/filter/templates/text-format-wrapper.html.twig b/core/modules/filter/templates/text-format-wrapper.html.twig index 367de09..de61d92 100644 --- a/core/modules/filter/templates/text-format-wrapper.html.twig +++ b/core/modules/filter/templates/text-format-wrapper.html.twig @@ -15,7 +15,7 @@ * @ingroup themeable */ #} -
+
{{ children }} {% if description %} {{ description }}
diff --git a/core/modules/language/templates/language-negotiation-configure-form.html.twig b/core/modules/language/templates/language-negotiation-configure-form.html.twig index 8bddb46..12528ac 100644 --- a/core/modules/language/templates/language-negotiation-configure-form.html.twig +++ b/core/modules/language/templates/language-negotiation-configure-form.html.twig @@ -23,6 +23,7 @@ {% for language_type in language_types %} {% set language_classes = [ + 'js-form-item', 'form-item', 'table-language-group', 'table-' ~ language_type.type ~ '-wrapper', diff --git a/core/modules/locale/locale.admin.js b/core/modules/locale/locale.admin.js index c7bac21..fc4329d 100644 --- a/core/modules/locale/locale.admin.js +++ b/core/modules/locale/locale.admin.js @@ -31,7 +31,7 @@ $row.addClass('changed'); // Add an asterisk only once if row changed. if ($rowToMark.length) { - $rowToMark.find('td:first-child .form-item').append(marker); + $rowToMark.find('td:first-child .js-form-item').append(marker); } }); } diff --git a/core/modules/system/templates/field-multiple-value-form.html.twig b/core/modules/system/templates/field-multiple-value-form.html.twig index f18a853..348621c 100644 --- a/core/modules/system/templates/field-multiple-value-form.html.twig +++ b/core/modules/system/templates/field-multiple-value-form.html.twig @@ -20,7 +20,7 @@ */ #} {% if multiple %} -
+
{{ table }} {% if description %}
{{ description }}
diff --git a/core/modules/system/templates/fieldset.html.twig b/core/modules/system/templates/fieldset.html.twig index d8372a7..b67ec85 100644 --- a/core/modules/system/templates/fieldset.html.twig +++ b/core/modules/system/templates/fieldset.html.twig @@ -24,6 +24,7 @@ #} {% set classes = [ + 'js-form-item', 'form-item', 'js-form-wrapper', 'form-wrapper', diff --git a/core/modules/system/templates/form-element.html.twig b/core/modules/system/templates/form-element.html.twig index 9292fd7..2599e34 100644 --- a/core/modules/system/templates/form-element.html.twig +++ b/core/modules/system/templates/form-element.html.twig @@ -48,6 +48,7 @@ #} {% set classes = [ + 'js-form-item', 'form-item', 'js-form-type-' ~ type|clean_class, 'form-item-' ~ name|clean_class, diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php index 7adaa16..38c0f2d 100644 --- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php @@ -154,7 +154,7 @@ protected function valueForm(&$form, FormStateInterface $form_state) { $vocabulary = $this->vocabularyStorage->load($this->options['vid']); if (empty($vocabulary) && $this->options['limit']) { $form['markup'] = array( - '#markup' => '
' . $this->t('An invalid vocabulary is selected. Please change it in the options.') . '
', + '#markup' => '
' . $this->t('An invalid vocabulary is selected. Please change it in the options.') . '
', ); return; } diff --git a/core/modules/text/text.js b/core/modules/text/text.js index 82fdf2a..7f65615 100644 --- a/core/modules/text/text.js +++ b/core/modules/text/text.js @@ -19,7 +19,7 @@ var $summary = $widget.find('.js-text-summary-wrapper'); var $summaryLabel = $summary.find('label').eq(0); - var $full = $widget.find('.js-text-full').closest('.form-item'); + var $full = $widget.find('.js-text-full').closest('.js-form-item'); var $fullLabel = $full.find('label').eq(0); // Create a placeholder label when the field cardinality is greater diff --git a/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php b/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php index cdd235e..2f6fab1 100644 --- a/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php +++ b/core/modules/views/src/Plugin/views/BrokenHandlerTrait.php @@ -69,7 +69,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $form['description'] = array( '#type' => 'container', '#attributes' => array( - 'class' => array('form-item', 'description'), + 'class' => array('js-form-item', 'form-item', 'description'), ), 'description_top' => array( '#markup' => '

' . $description_top . '

', diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index f9ae57a..0864bfe 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -1544,7 +1544,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $access_plugin = $this->getPlugin('access'); if ($access_plugin->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected access restriction.', array('!settings' => $this->optionLink(t('settings'), 'access_options'))), '#suffix' => '
', ); @@ -1581,7 +1581,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $cache_plugin = $this->getPlugin('cache'); if ($cache_plugin->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected cache mechanism.', array('!settings' => $this->optionLink(t('settings'), 'cache_options'))), ); @@ -1653,7 +1653,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { if ($style_plugin->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'style_options'))), ); @@ -1701,7 +1701,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { if ($row_plugin_instance->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected row style.', array('!settings' => $this->optionLink(t('settings'), 'row_options'))), ); @@ -1768,7 +1768,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { case 'exposed_block': $form['#title'] .= $this->t('Put the exposed form in a block'); $form['description'] = array( - '#markup' => '
' . $this->t('If set, any exposed widgets will not appear with this view. Instead, a block will be made available to the Drupal block administration system, and the exposed form will appear there. Note that this block must be enabled manually, Views will not enable it for you.') . '
', + '#markup' => '
' . $this->t('If set, any exposed widgets will not appear with this view. Instead, a block will be made available to the Drupal block administration system, and the exposed form will appear there. Note that this block must be enabled manually, Views will not enable it for you.') . '
', ); $form['exposed_block'] = array( '#type' => 'radios', @@ -1796,7 +1796,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $exposed_form_plugin = $this->getPlugin('exposed_form'); if ($exposed_form_plugin->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected style.', array('!settings' => $this->optionLink(t('settings'), 'exposed_form_options'))), ); @@ -1832,7 +1832,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { $pager_plugin = $this->getPlugin('pager'); if ($pager_plugin->usesOptions()) { $form['markup'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $this->t('You may also adjust the !settings for the currently selected pager.', array('!settings' => $this->optionLink(t('settings'), 'pager_options'))), ); diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php index 7ec3560..85ccb4c 100644 --- a/core/modules/views/src/Plugin/views/display/Page.php +++ b/core/modules/views/src/Plugin/views/display/Page.php @@ -368,7 +368,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { } $form['tab_markup'] = array( - '#markup' => '
' . $this->t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is foo/bar/baz, the parent path would be foo/bar.') . '
', + '#markup' => '
' . $this->t('When providing a menu item as a tab, Drupal needs to know what the parent menu item of that tab will be. Sometimes the parent will already exist, but other times you will need to have one created. The path of a parent item will always be the same path with the last part left off. i.e, if the path to this view is foo/bar/baz, the parent path would be foo/bar.') . '
', ); $form['tab_options'] = array( diff --git a/core/modules/views/src/Plugin/views/style/Table.php b/core/modules/views/src/Plugin/views/style/Table.php index 8a594cf..65e2251 100644 --- a/core/modules/views/src/Plugin/views/style/Table.php +++ b/core/modules/views/src/Plugin/views/style/Table.php @@ -413,7 +413,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ); $form['description_markup'] = array( - '#markup' => '
' . $this->t('Place fields into columns; you may combine multiple fields into the same column. If you do, the separator in the column specified will be used to separate the fields. Check the sortable box to make that column click sortable, and check the default sort radio to determine which column will be sorted by default, if any. You may control column order and field labels in the fields section.') . '
', + '#markup' => '
' . $this->t('Place fields into columns; you may combine multiple fields into the same column. If you do, the separator in the column specified will be used to separate the fields. Check the sortable box to make that column click sortable, and check the default sort radio to determine which column will be sorted by default, if any. You may control column order and field labels in the fields section.') . '
', ); } diff --git a/core/modules/views_ui/src/Form/Ajax/AddHandler.php b/core/modules/views_ui/src/Form/Ajax/AddHandler.php index a60da37..eef8f7d 100644 --- a/core/modules/views_ui/src/Form/Ajax/AddHandler.php +++ b/core/modules/views_ui/src/Form/Ajax/AddHandler.php @@ -162,7 +162,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { } else { $form['options']['markup'] = array( - '#markup' => '
' . $this->t('There are no @types available to add.', array('@types' => $ltitle)) . '
', + '#markup' => '
' . $this->t('There are no @types available to add.', array('@types' => $ltitle)) . '
', ); } // Add a div to show the selected items diff --git a/core/modules/views_ui/src/Form/Ajax/Analyze.php b/core/modules/views_ui/src/Form/Ajax/Analyze.php index 95e126a..b53800d 100644 --- a/core/modules/views_ui/src/Form/Ajax/Analyze.php +++ b/core/modules/views_ui/src/Form/Ajax/Analyze.php @@ -44,7 +44,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { $messages = $analyzer->getMessages($view->getExecutable()); $form['analysis'] = array( - '#prefix' => '
', + '#prefix' => '
', '#suffix' => '
', '#markup' => $analyzer->formatMessages($messages), ); diff --git a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php index e290789..8df344a 100644 --- a/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php +++ b/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php @@ -160,7 +160,7 @@ public function buildForm(array $form, FormStateInterface $form_state, Request $ $form['options']['form_description'] = array( '#markup' => $handler->definition['help'], '#theme_wrappers' => array('container'), - '#attributes' => array('class' => array('form-item description')), + '#attributes' => array('class' => array('js-form-item form-item description')), '#weight' => -1000, ); } diff --git a/core/themes/classy/templates/content-edit/text-format-wrapper.html.twig b/core/themes/classy/templates/content-edit/text-format-wrapper.html.twig index 4bd1566..08a88ca 100644 --- a/core/themes/classy/templates/content-edit/text-format-wrapper.html.twig +++ b/core/themes/classy/templates/content-edit/text-format-wrapper.html.twig @@ -13,7 +13,7 @@ * @see template_preprocess_text_format_wrapper() */ #} -
+
{{ children }} {% if description %} {% diff --git a/core/themes/classy/templates/form/field-multiple-value-form.html.twig b/core/themes/classy/templates/form/field-multiple-value-form.html.twig index 1eac971..bcc7b89 100644 --- a/core/themes/classy/templates/form/field-multiple-value-form.html.twig +++ b/core/themes/classy/templates/form/field-multiple-value-form.html.twig @@ -18,7 +18,7 @@ */ #} {% if multiple %} -
+
{{ table }} {% if description %}
{{ description }}
diff --git a/core/themes/classy/templates/form/fieldset.html.twig b/core/themes/classy/templates/form/fieldset.html.twig index e507d4c..4bd7d0a 100644 --- a/core/themes/classy/templates/form/fieldset.html.twig +++ b/core/themes/classy/templates/form/fieldset.html.twig @@ -22,6 +22,7 @@ #} {% set classes = [ + 'js-form-item', 'form-item', 'js-form-wrapper', 'form-wrapper', diff --git a/core/themes/classy/templates/form/form-element.html.twig b/core/themes/classy/templates/form/form-element.html.twig index 65028fa..7e28b64 100644 --- a/core/themes/classy/templates/form/form-element.html.twig +++ b/core/themes/classy/templates/form/form-element.html.twig @@ -46,6 +46,7 @@ #} {% set classes = [ + 'js-form-item', 'form-item', 'js-form-type-' ~ type|clean_class, 'form-type-' ~ type|clean_class,