diff --git a/core/misc/machine-name.js b/core/misc/machine-name.js index b9e87a6..cccfdfe 100644 --- a/core/misc/machine-name.js +++ b/core/misc/machine-name.js @@ -81,7 +81,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 680e86e..e9579fe 100644 --- a/core/misc/states.js +++ b/core/misc/states.js @@ -509,7 +509,7 @@ if (e.trigger) { $(e.target) .prop('disabled', e.value) - .closest('.form-item, .form-submit, .form-wrapper').toggleClass('form-disabled', e.value) + .closest('.js-form-item, .form-submit, .form-wrapper').toggleClass('form-disabled', e.value) .find('select, input, textarea').prop('disabled', e.value); // Note: WebKit nightlies don't reflect that change correctly. @@ -520,21 +520,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, .form-wrapper').find('label'); + var $label = $(e.target).attr({'required': 'required', 'aria-required': 'aria-required'}).closest('.js-form-item, .form-wrapper').find('label'); // Avoids duplicate required markers on initialization. if (!$label.hasClass('form-required').length) { $label.addClass('form-required'); } } else { - $(e.target).removeAttr('required aria-required').closest('.form-item, .form-wrapper').find('label.form-required').removeClass('form-required'); + $(e.target).removeAttr('required aria-required').closest('.js-form-item, .form-wrapper').find('label.form-required').removeClass('form-required'); } } }); $(document).on('state:visible', function (e) { if (e.trigger) { - $(e.target).closest('.form-item, .form-submit, .form-wrapper').toggle(e.value); + $(e.target).closest('.js-form-item, .form-submit, .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 a74b938..1bcc5d7 100644 --- a/core/modules/filter/filter.filter_html.admin.js +++ b/core/modules/filter/filter.filter_html.admin.js @@ -57,7 +57,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 ce3ba55..67f90eb 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 8e1c8f5..46a0f3d 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 550e40e..5efd13b 100644 --- a/core/modules/locale/locale.admin.js +++ b/core/modules/locale/locale.admin.js @@ -25,7 +25,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..a2cbeba 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 ab6796c..f84f970 100644 --- a/core/modules/system/templates/fieldset.html.twig +++ b/core/modules/system/templates/fieldset.html.twig @@ -21,7 +21,13 @@ * @ingroup themeable */ #} - +{% + set classes = [ + 'js-form-item', + 'form-wrapper', + ] +%} + {% set legend_span_classes = [ 'fieldset-legend', diff --git a/core/modules/system/templates/form-element.html.twig b/core/modules/system/templates/form-element.html.twig index a961801..4f31285 100644 --- a/core/modules/system/templates/form-element.html.twig +++ b/core/modules/system/templates/form-element.html.twig @@ -47,7 +47,7 @@ #} {% set classes = [ - 'form-item', + 'js-form-item', 'form-type-' ~ type|clean_class, 'form-item-' ~ name|clean_class, title_display not in ['after', 'before'] ? 'form-no-label', diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php index 47fd573..4fc792e 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 2ab1d0a..f607519 100644 --- a/core/modules/text/text.js +++ b/core/modules/text/text.js @@ -12,7 +12,7 @@ var $summary = $widget.find('.text-summary-wrapper'); var $summaryLabel = $summary.find('label').eq(0); - var $full = $widget.find('.text-full').closest('.form-item'); + var $full = $widget.find('.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 290d1a7..b9652bd 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -1543,7 +1543,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' => '
', ); @@ -1580,7 +1580,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'))), ); @@ -1652,7 +1652,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'))), ); @@ -1700,7 +1700,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'))), ); @@ -1767,7 +1767,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', @@ -1795,7 +1795,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'))), ); @@ -1831,7 +1831,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 27905b8..62da060 100644 --- a/core/modules/views/src/Plugin/views/display/Page.php +++ b/core/modules/views/src/Plugin/views/display/Page.php @@ -315,7 +315,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 dea6f0f..6783f88 100644 --- a/core/modules/views/src/Plugin/views/style/Table.php +++ b/core/modules/views/src/Plugin/views/style/Table.php @@ -412,7 +412,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 da54d50..621063e 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 b8e0250..50dc8dd 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 f7460cf..c801128 100644 --- a/core/themes/classy/templates/form/fieldset.html.twig +++ b/core/themes/classy/templates/form/fieldset.html.twig @@ -19,7 +19,14 @@ * @see template_preprocess_fieldset() */ #} - +{% + set classes = [ + 'js-form-item', + 'form-item', + 'form-wrapper', + ] +%} + {% set legend_span_classes = [ 'fieldset-legend', diff --git a/core/themes/classy/templates/form/form-element.html.twig b/core/themes/classy/templates/form/form-element.html.twig index cf54c20..762206d 100644 --- a/core/themes/classy/templates/form/form-element.html.twig +++ b/core/themes/classy/templates/form/form-element.html.twig @@ -45,6 +45,7 @@ #} {% set classes = [ + 'js-form-item', 'form-item', 'form-type-' ~ type|clean_class, 'form-item-' ~ name|clean_class,