[IMP] web_editor: remove quality optimization warning
It creates confusion for no good reason task-2502679 Closes #69340
This commit is contained in:
@@ -4497,27 +4497,10 @@ const ImageHandlerOption = SnippetOptionWidget.extend({
|
||||
* @override
|
||||
*/
|
||||
async _renderCustomXML(uiFragment) {
|
||||
const isLocalURL = href => new URL(href, window.location.origin).origin === window.location.origin;
|
||||
|
||||
const img = this._getImg();
|
||||
if (!this.originalSrc || !['image/png', 'image/jpeg'].includes(img.dataset.mimetype)) {
|
||||
return [...uiFragment.childNodes].forEach(node => {
|
||||
if (node.matches('.o_we_external_warning')) {
|
||||
node.classList.remove('d-none');
|
||||
if (isLocalURL(img.getAttribute('src'))) {
|
||||
const title = node.querySelector('we-title');
|
||||
title.textContent = ` ${_t("Quality options unavailable")}`;
|
||||
$(title).prepend('<i class="fa fa-warning" />');
|
||||
if (img.dataset.mimetype) {
|
||||
title.setAttribute('title', _t("Only PNG and JPEG images support quality options and image filtering"));
|
||||
} else {
|
||||
title.setAttribute('title', _t("Due to technical limitations, you can only change optimization settings on this image by choosing it again in the media-dialog or reuploading it (double click on the image)"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
node.remove();
|
||||
}
|
||||
});
|
||||
[...uiFragment.childNodes].forEach(node => node.remove());
|
||||
return;
|
||||
}
|
||||
const $select = $(uiFragment).find('we-select[data-name=width_select_opt]');
|
||||
(await this._computeAvailableWidths()).forEach(([value, label]) => {
|
||||
|
||||
@@ -1526,10 +1526,6 @@ body.editor_enable.editor_has_snippets {
|
||||
margin-left: $o-we-sidebar-content-field-label-spacing * 2;
|
||||
}
|
||||
|
||||
.o_we_external_warning {
|
||||
margin-top: $o-we-sidebar-content-field-spacing;
|
||||
}
|
||||
|
||||
.o_we_tag {
|
||||
background-color: $o-we-bg-darkest;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -48,12 +48,6 @@
|
||||
</template>
|
||||
|
||||
<template id="snippet_options_image_optimization_widgets">
|
||||
<div class="o_we_external_warning d-none">
|
||||
<we-title title="Quality options are unavailable for external images. If you want to change this image's quality, please first download it from the original source and upload it in Odoo.">
|
||||
<i class="fa fa-warning" /> External Image
|
||||
</we-title>
|
||||
</div>
|
||||
|
||||
<t t-set="filter_label">Filter</t>
|
||||
<we-select t-att-string="indent and (' ⌙ %s' % filter_label) or filter_label">
|
||||
<we-button data-gl-filter="">None</we-button>
|
||||
|
||||
Reference in New Issue
Block a user