diff --git a/core/modules/editor/editor.libraries.yml b/core/modules/editor/editor.libraries.yml index bd46f6e8649198c3680fb4c39ab70e1484519d21..7fe5bf56219eb3f23ca5df9f1fa6265997f30af2 100644 --- a/core/modules/editor/editor.libraries.yml +++ b/core/modules/editor/editor.libraries.yml @@ -6,6 +6,7 @@ drupal.editor.admin: - core/jquery - core/once - core/drupal + deprecated: The %library_id% asset library is deprecated in Drupal 10.3.0 and will be removed in Drupal 11.0.0. See https://www.drupal.org/node/3422372 drupal.editor: version: VERSION diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module index 6925eea7b1406e24e4ad4fc6d23e6707b69789d0..d8ec411e9aeb55e2491648aab38cf716525654b0 100644 --- a/core/modules/editor/editor.module +++ b/core/modules/editor/editor.module @@ -149,11 +149,6 @@ function editor_form_filter_format_form_alter(&$form, FormStateInterface $form_s '#weight' => -8, '#type' => 'container', '#id' => 'editor-settings-wrapper', - '#attached' => [ - 'library' => [ - 'editor/drupal.editor.admin', - ], - ], ]; // Add editor-specific validation and submit handlers. diff --git a/core/modules/editor/js/editor.admin.js b/core/modules/editor/js/editor.admin.js index 6f8aa9dce28dd5a84348304884b1219a3978da6c..b4fa10e3d67ab89b520597d3d02cd512fcdc1360 100644 --- a/core/modules/editor/js/editor.admin.js +++ b/core/modules/editor/js/editor.admin.js @@ -27,6 +27,10 @@ * @fires event:drupalEditorFeatureAdded */ addedFeature(feature) { + Drupal.deprecationError({ + message: + 'Drupal.editorConfiguration.addedFeature is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); $(document).trigger('drupalEditorFeatureAdded', feature); }, @@ -43,6 +47,10 @@ * @fires event:drupalEditorFeatureRemoved */ removedFeature(feature) { + Drupal.deprecationError({ + message: + 'Drupal.editorConfiguration.removedFeature is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); $(document).trigger('drupalEditorFeatureRemoved', feature); }, @@ -62,6 +70,10 @@ * @fires event:drupalEditorFeatureModified */ modifiedFeature(feature) { + Drupal.deprecationError({ + message: + 'Drupal.editorConfiguration.modifiedFeature is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); $(document).trigger('drupalEditorFeatureModified', feature); }, @@ -657,6 +669,11 @@ return true; } + Drupal.deprecationError({ + message: + 'Drupal.editorConfiguration.featureIsAllowedByFilters is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + // If any filter's current status forbids the editor feature, return // false. Drupal.filterConfiguration.update(); @@ -702,6 +719,11 @@ * @see Drupal.EditorFeature */ Drupal.EditorFeatureHTMLRule = function () { + Drupal.deprecationError({ + message: + 'Drupal.EditorFeatureHTMLRule is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + /** * * @type {Object} @@ -768,6 +790,11 @@ * @see Drupal.EditorFeatureHTMLRule */ Drupal.EditorFeature = function (name) { + Drupal.deprecationError({ + message: + 'Drupal.EditorFeature is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + this.name = name; this.rules = []; }; @@ -779,6 +806,11 @@ * A text editor feature HTML rule. */ Drupal.EditorFeature.prototype.addHTMLRule = function (rule) { + Drupal.deprecationError({ + message: + 'Drupal.EditorFeature.prototype.addHTMLRule is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + this.rules.push(rule); }; @@ -806,6 +838,11 @@ * @see Drupal.FilterHTMLRule */ Drupal.FilterStatus = function (name) { + Drupal.deprecationError({ + message: + 'Drupal.FilterStatus is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + /** * * @type {string} @@ -832,6 +869,11 @@ * A text filter HTML rule. */ Drupal.FilterStatus.prototype.addHTMLRule = function (rule) { + Drupal.deprecationError({ + message: + 'Drupal.FilterStatus.prototype.addHTMLRule is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + this.rules.push(rule); }; @@ -911,6 +953,11 @@ * @see Drupal.FilterStatus */ Drupal.FilterHTMLRule = function () { + Drupal.deprecationError({ + message: + 'Drupal.FilterHTMLRule is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + // Allow or forbid tags. this.tags = []; this.allow = null; @@ -926,6 +973,11 @@ }; Drupal.FilterHTMLRule.prototype.clone = function () { + Drupal.deprecationError({ + message: + 'Drupal.FilterHTMLRule.prototype.clone is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + const clone = new Drupal.FilterHTMLRule(); clone.tags = this.tags.slice(0); clone.allow = this.allow; @@ -984,6 +1036,11 @@ * up-to-date. */ update() { + Drupal.deprecationError({ + message: + 'Drupal.filterConfiguration.update is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + Object.keys(Drupal.filterConfiguration.statuses || {}).forEach( (filterID) => { // Update status. @@ -1013,6 +1070,11 @@ */ Drupal.behaviors.initializeFilterConfiguration = { attach(context, settings) { + Drupal.deprecationError({ + message: + 'Drupal.behaviors.initializeFilterConfiguration is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + once( 'filter-editor-status', '#filters-status-wrapper input.form-checkbox', diff --git a/core/modules/filter/filter.filter_html.admin.js b/core/modules/filter/filter.filter_html.admin.js index c830879743ade8133e390de2948d79cbb14deb8f..87eef5bb93c817381c68812e255fe8d5ecc07206 100644 --- a/core/modules/filter/filter.filter_html.admin.js +++ b/core/modules/filter/filter.filter_html.admin.js @@ -18,6 +18,10 @@ * An array of filter rules. */ getRules() { + Drupal.deprecationError({ + message: + 'Drupal.filterConfiguration.liveSettingParsers.filter_html.getRules() is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); const currentValue = document.querySelector( '#edit-filters-filter-html-settings-allowed-html', ).value; @@ -82,6 +86,11 @@ newFeatures: {}, attach(context, settings) { + Drupal.deprecationError({ + message: + 'Drupal.behaviors.filterFilterHtmlUpdating is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); + const that = this; once( 'filter-filter_html-updating', @@ -393,6 +402,10 @@ * The corresponding HTML. */ Drupal.theme.filterFilterHTMLUpdateMessage = function (tags) { + Drupal.deprecationError({ + message: + 'Drupal.theme.filterFilterHTMLUpdateMessage() is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3422372.', + }); let html = ''; const tagList = Drupal.behaviors.filterFilterHtmlUpdating._generateSetting(tags); diff --git a/core/modules/filter/filter.libraries.yml b/core/modules/filter/filter.libraries.yml index 108d6b92dc103beed62fad676de6058bccdc5933..7dc9b01536812348ab4444aa6954db4c683f08f6 100644 --- a/core/modules/filter/filter.libraries.yml +++ b/core/modules/filter/filter.libraries.yml @@ -15,6 +15,7 @@ drupal.filter.filter_html.admin: dependencies: - core/jquery - core/once + deprecated: The %library_id% asset library is deprecated in Drupal 10.3.0 and will be removed in Drupal 11.0.0. See https://www.drupal.org/node/3422372 drupal.filter: version: VERSION diff --git a/core/modules/filter/src/Plugin/Filter/FilterHtml.php b/core/modules/filter/src/Plugin/Filter/FilterHtml.php index 4bee00b5741c95cfd528572797aab01f5192622b..f1a037ba07aedafde53b37b31df0a7fc601c24a9 100644 --- a/core/modules/filter/src/Plugin/Filter/FilterHtml.php +++ b/core/modules/filter/src/Plugin/Filter/FilterHtml.php @@ -50,11 +50,6 @@ public function settingsForm(array $form, FormStateInterface $form_state) { '#title' => $this->t('Allowed HTML tags'), '#default_value' => $this->settings['allowed_html'], '#description' => $this->t('A list of HTML tags that can be used. By default only the <em>lang</em> and <em>dir</em> attributes are allowed for all HTML tags. Each HTML tag may have attributes which are treated as allowed attribute names for that HTML tag. Each attribute may allow all values, or only allow specific values. Attribute names or values may be written as a prefix and wildcard like <em>jump-*</em>. JavaScript event attributes, JavaScript URLs, and CSS are always stripped.'), - '#attached' => [ - 'library' => [ - 'filter/drupal.filter.filter_html.admin', - ], - ], ]; $form['filter_html_help'] = [ '#type' => 'checkbox', diff --git a/core/modules/filter/tests/src/FunctionalJavascript/FilterHtmlTest.php b/core/modules/filter/tests/src/FunctionalJavascript/FilterHtmlTest.php deleted file mode 100644 index 15fa2c72cf2bf5bd08a3a4ff61e0f84391d0b914..0000000000000000000000000000000000000000 --- a/core/modules/filter/tests/src/FunctionalJavascript/FilterHtmlTest.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php - -declare(strict_types=1); - -namespace Drupal\Tests\filter\FunctionalJavascript; - -use Drupal\filter\Entity\FilterFormat; -use Drupal\FunctionalJavascriptTests\WebDriverTestBase; - -/** - * Tests the 'filter_html' plugin javascript functionality. - * - * @group filter - */ -class FilterHtmlTest extends WebDriverTestBase { - - /** - * {@inheritdoc} - */ - protected static $modules = ['editor', 'filter']; - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * Tests restricting HTML to table tags. - */ - public function testTableTags() { - FilterFormat::create([ - 'format' => 'some_html', - 'name' => 'Some HTML', - 'filters' => [ - 'filter_html' => [ - 'status' => 1, - 'settings' => [ - 'allowed_html' => '<caption> <tbody> <thead> <tfoot> <th> <td> <tr>', - ], - ], - ], - ])->save(); - - $this->drupalLogin($this->drupalCreateUser(['administer filters'])); - $this->drupalGet('admin/config/content/formats/manage/some_html'); - - $js_condition = "Drupal.behaviors.filterFilterHtmlUpdating._parseSetting( - jQuery('#edit-filters-filter-html-settings-allowed-html').val() - )['td'].tags.length >= 0"; - - $this->assertJsCondition($js_condition); - } - -}