[FIX] web_editor: deny videos in mass mailing
Create a new mass mailing, add a video via youtube embed link, save. Send email. Embedding a video can't work because it embeds an iframe, which is not supported by most email clients for security reasons. Extending the noVideo flag also to mass_mailing opw-2179665 closes odoo/odoo#45104 X-original-commit: f9f8c9cc4075fdc5fd4556aa49c914054469198a Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is contained in:
@@ -187,6 +187,7 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, {
|
||||
* @returns {Object}
|
||||
*/
|
||||
_getWysiwygOptions: function () {
|
||||
var self = this;
|
||||
return Object.assign({}, this.nodeOptions, {
|
||||
recordInfo: {
|
||||
context: this.record.getContext(this.recordParams),
|
||||
@@ -221,6 +222,9 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, {
|
||||
toolbar.splice(-1, 0, ['view', ['codeview']]);
|
||||
}
|
||||
}
|
||||
if ("mailing.mailing" === self.model) {
|
||||
options.noVideos = true;
|
||||
}
|
||||
options.prettifyHtml = false;
|
||||
return options;
|
||||
},
|
||||
|
||||
@@ -422,7 +422,9 @@ eventHandler.modules.imageDialog.showImageDialog = function ($editable) {
|
||||
options: {
|
||||
lastFilters: ['background'],
|
||||
onUpload: $editable.data('callbacks').onUpload,
|
||||
noVideos: $editable.data('oe-model') === "mail.compose.message",
|
||||
noVideos:
|
||||
$editable.data('oe-model') === "mail.compose.message" ||
|
||||
($editable.data('options') && $editable.data('options').noVideos),
|
||||
},
|
||||
onSave: function (media) {
|
||||
if(!document.body.contains(media)) {
|
||||
|
||||
Reference in New Issue
Block a user