diff --git a/addons/project/__manifest__.py b/addons/project/__manifest__.py
index 223913431fb..b0353bf3ddf 100644
--- a/addons/project/__manifest__.py
+++ b/addons/project/__manifest__.py
@@ -191,7 +191,6 @@
'web_editor/static/src/js/common/**/*',
'web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js',
'web_editor/static/src/js/wysiwyg/fonts.js',
- 'web_editor/static/src/xml/ace.xml',
'web_editor/static/src/components/**/*',
'web_editor/static/src/scss/web_editor.common.scss',
diff --git a/addons/test_website/static/tests/tours/reset_views.js b/addons/test_website/static/tests/tours/reset_views.js
index 8adb5f8fa39..9a1f59156fa 100644
--- a/addons/test_website/static/tests/tours/reset_views.js
+++ b/addons/test_website/static/tests/tours/reset_views.js
@@ -39,13 +39,13 @@ wTourUtils.registerWebsitePreviewTour('test_reset_page_view_complete_flow_part1'
content: "add a broken t-field in page DOM",
trigger: 'div.ace_line .ace_xml:contains("placeholder")',
run: function () {
- ace.edit('ace-view-editor').getSession().insert({row: 4, column: 1}, '\n');
+ ace.edit(document.querySelector('#resource-editor div')).getSession().insert({row: 4, column: 1}, '\n');
},
},
{
content: "save the html editor",
extra_trigger: '.ace_content:contains("not.exist")',
- trigger: ".o_ace_view_editor button[data-action=save]",
+ trigger: ".o_resource_editor button:contains(Save)",
},
BROKEN_STEP
]
@@ -77,22 +77,22 @@ wTourUtils.registerWebsitePreviewTour('test_reset_page_view_complete_flow_part2'
},
{
content: "select oe_structure view",
- trigger: '#s2id_ace-view-list', // use select2 version
- run: function () {
- var viewId = $('#ace-view-list option:contains("oe_structure_test_website_page")').val();
- $('#ace-view-list').val(viewId).trigger('change');
- },
+ trigger: '.o_resource_editor_title .o_select_menu_toggler',
+ },
+ {
+ content: "select oe_structure view",
+ trigger: '.o_resource_editor_title .o_select_menu_item:contains(Test Page View)',
},
{
content: "add a broken t-field in page DOM",
trigger: 'div.ace_line .ace_xml:contains("oe_structure_test_website_page")',
run: function () {
- ace.edit('ace-view-editor').getSession().insert({row: 4, column: 1}, '\n');
+ ace.edit(document.querySelector('#resource-editor div')).getSession().insert({row: 4, column: 1}, '\n');
},
},
{
content: "save the html editor",
- trigger: ".o_ace_view_editor button[data-action=save]",
+ trigger: ".o_resource_editor button:contains(Save)",
},
BROKEN_STEP
]
diff --git a/addons/web_editor/__manifest__.py b/addons/web_editor/__manifest__.py
index 2cd8663fa1e..11e247195b9 100644
--- a/addons/web_editor/__manifest__.py
+++ b/addons/web_editor/__manifest__.py
@@ -175,7 +175,6 @@ Odoo Web Editor widget.
'web_editor/static/src/js/common/**/*',
'web_editor/static/src/js/editor/odoo-editor/src/utils/utils.js',
'web_editor/static/src/js/wysiwyg/fonts.js',
- 'web_editor/static/src/xml/ace.xml',
('include', 'web_editor.assets_media_dialog'),
diff --git a/addons/web_editor/static/src/js/backend/ace.js b/addons/web_editor/static/src/js/backend/ace.js
deleted file mode 100644
index 725407e673c..00000000000
--- a/addons/web_editor/static/src/js/backend/ace.js
+++ /dev/null
@@ -1,1067 +0,0 @@
-/** @odoo-module **/
-
-import { Mutex } from "@web/core/utils/concurrency";
-import { _t } from "@web/core/l10n/translation";
-import dom from "@web/legacy/js/core/dom";
-import Widget from "@web/legacy/js/core/widget";
-import { browser } from "@web/core/browser/browser";
-import { debounce } from "@web/core/utils/timing";
-import { sortBy } from "@web/core/utils/arrays";
-import { omit, pick } from "@web/core/utils/objects";
-import { AlertDialog, ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
-import { markup } from "@odoo/owl";
-
-/**
- * Formats a content-check result (@see checkXML, checkSCSS).
- *
- * @param {boolean} isValid
- * @param {integer} [errorLine] needed if isValid is false
- * @param {string} [errorMessage] needed if isValid is false
- * @returns {Object}
- */
-function _getCheckReturn(isValid, errorLine, errorMessage) {
- return {
- isValid: isValid,
- error: isValid ? null : {
- line: errorLine,
- message: errorMessage,
- },
- };
-}
-/**
- * Checks the syntax validity of some XML.
- *
- * @param {string} xml
- * @returns {Object} @see _getCheckReturn
- */
-function checkXML(xml) {
- if (typeof window.DOMParser != 'undefined') {
- var xmlDoc = (new window.DOMParser()).parseFromString(xml, 'text/xml');
- var error = xmlDoc.getElementsByTagName('parsererror');
- if (error.length > 0) {
- const errorEl = error[0];
- const sourceTextEls = errorEl.querySelectorAll('sourcetext');
- let codeEls = null;
- if (sourceTextEls.length) {
- codeEls = [...sourceTextEls].map(el => {
- const codeEl = document.createElement('code');
- codeEl.textContent = el.textContent;
- const brEl = document.createElement('br');
- brEl.classList.add('o_we_source_text_origin');
- el.parentElement.insertBefore(brEl, el);
- return codeEl;
- });
- for (const el of sourceTextEls) {
- el.remove();
- }
- }
- for (const el of [...errorEl.querySelectorAll(':not(code):not(pre):not(br)')]) {
- const pEl = document.createElement('p');
- for (const cEl of [...el.childNodes]) {
- pEl.appendChild(cEl);
- }
- el.parentElement.insertBefore(pEl, el);
- el.remove();
- }
- errorEl.innerHTML = errorEl.innerHTML.replace(/\r?\n/g, '
');
- errorEl.querySelectorAll('.o_we_source_text_origin').forEach((el, i) => {
- el.after(codeEls[i]);
- });
- return _getCheckReturn(false, parseInt(error[0].innerHTML.match(/[Ll]ine[^\d]+(\d+)/)[1], 10), errorEl.innerHTML);
- }
- } else if (typeof window.ActiveXObject != 'undefined' && new window.ActiveXObject('Microsoft.XMLDOM')) {
- var xmlDocIE = new window.ActiveXObject('Microsoft.XMLDOM');
- xmlDocIE.async = 'false';
- xmlDocIE.loadXML(xml);
- if (xmlDocIE.parseError.line > 0) {
- return _getCheckReturn(false, xmlDocIE.parseError.line, xmlDocIE.parseError.reason);
- }
- }
- return _getCheckReturn(true);
-}
-/**
- * Formats some XML so that it has proper indentation and structure.
- *
- * @param {string} xml
- * @returns {string} formatted xml
- */
-function formatXML(xml) {
- // do nothing if an inline script is present to avoid breaking it
- if (/