diff --git a/core/modules/ckeditor5/ckeditor5.libraries.yml b/core/modules/ckeditor5/ckeditor5.libraries.yml index cff3acc4efb..57a5a0b472a 100644 --- a/core/modules/ckeditor5/ckeditor5.libraries.yml +++ b/core/modules/ckeditor5/ckeditor5.libraries.yml @@ -90,7 +90,6 @@ ie11.user.warnings: - core/drupal - core/drupal.message - editor/drupal.editor - - core/modernizr ie11.filter.warnings: js: @@ -99,7 +98,6 @@ ie11.filter.warnings: - core/drupal - core/drupal.message - core/once - - core/modernizr drupal.ckeditor5.filter.admin: js: diff --git a/core/modules/ckeditor5/js/ie11.filter.warnings.es6.js b/core/modules/ckeditor5/js/ie11.filter.warnings.es6.js index 8d92b66f48b..5ca4c4d9e52 100644 --- a/core/modules/ckeditor5/js/ie11.filter.warnings.es6.js +++ b/core/modules/ckeditor5/js/ie11.filter.warnings.es6.js @@ -3,7 +3,7 @@ * Provides IE11 compatibility warnings when choosing a text editor. */ -((Drupal, once, Modernizr) => { +((Drupal, once) => { /** * Presents a warning when selecting CKEditor 5 as a text format's text editor. * @@ -11,9 +11,7 @@ */ Drupal.behaviors.ckEditor5warn = { attach: function attach() { - const isIE11 = Modernizr.mq( - '(-ms-high-contrast: active), (-ms-high-contrast: none)', - ); + const isIE11 = !!document.documentMode; const editorSelect = once( 'editor-ie11-warning', '[data-drupal-selector="filter-format-edit-form"] [data-drupal-selector="edit-editor-editor"], [data-drupal-selector="filter-format-add-form"] [data-drupal-selector="edit-editor-editor"]', @@ -120,4 +118,4 @@ } }, }; -})(Drupal, once, Modernizr); +})(Drupal, once); diff --git a/core/modules/ckeditor5/js/ie11.filter.warnings.js b/core/modules/ckeditor5/js/ie11.filter.warnings.js index 6723e2bb983..61ca106cefb 100644 --- a/core/modules/ckeditor5/js/ie11.filter.warnings.js +++ b/core/modules/ckeditor5/js/ie11.filter.warnings.js @@ -5,10 +5,10 @@ * @preserve **/ -(function (Drupal, once, Modernizr) { +(function (Drupal, once) { Drupal.behaviors.ckEditor5warn = { attach: function attach() { - var isIE11 = Modernizr.mq('(-ms-high-contrast: active), (-ms-high-contrast: none)'); + var isIE11 = !!document.documentMode; var editorSelect = once('editor-ie11-warning', '[data-drupal-selector="filter-format-edit-form"] [data-drupal-selector="edit-editor-editor"], [data-drupal-selector="filter-format-add-form"] [data-drupal-selector="edit-editor-editor"]'); if (typeof editorSelect[0] !== 'undefined') { @@ -66,4 +66,4 @@ } } }; -})(Drupal, once, Modernizr); \ No newline at end of file +})(Drupal, once); \ No newline at end of file diff --git a/core/modules/ckeditor5/js/ie11.user.warnings.es6.js b/core/modules/ckeditor5/js/ie11.user.warnings.es6.js index 6879f077a03..d71502f17a0 100644 --- a/core/modules/ckeditor5/js/ie11.user.warnings.es6.js +++ b/core/modules/ckeditor5/js/ie11.user.warnings.es6.js @@ -3,10 +3,8 @@ * Provide warnings when attempting to load CKEditor 5 on IE11. */ -((Drupal, Modernizr) => { - const isIE11 = Modernizr.mq( - '(-ms-high-contrast: active), (-ms-high-contrast: none)', - ); +((Drupal) => { + const isIE11 = !!document.documentMode; // If the browser is IE11, create an alternate version of // Drupal.editors.ckeditor5 that provides warnings. In IE11, the incompatible @@ -143,4 +141,4 @@ }, }; } -})(Drupal, Modernizr); +})(Drupal); diff --git a/core/modules/ckeditor5/js/ie11.user.warnings.js b/core/modules/ckeditor5/js/ie11.user.warnings.js index ad8988ffc0f..0356cc95ccc 100644 --- a/core/modules/ckeditor5/js/ie11.user.warnings.js +++ b/core/modules/ckeditor5/js/ie11.user.warnings.js @@ -5,8 +5,8 @@ * @preserve **/ -(function (Drupal, Modernizr) { - var isIE11 = Modernizr.mq('(-ms-high-contrast: active), (-ms-high-contrast: none)'); +(function (Drupal) { + var isIE11 = !!document.documentMode; if (isIE11) { window.CKEditor5 = null; @@ -64,4 +64,4 @@ } }; } -})(Drupal, Modernizr); \ No newline at end of file +})(Drupal); \ No newline at end of file