From 5d4e75ae581cc3efc781dc5e4850a0eba30272bd Mon Sep 17 00:00:00 2001 From: Kishan Gajjar Date: Mon, 24 Jun 2019 09:40:37 +0000 Subject: [FIX] web_editor: restore broken VideoDialog options - To enable loop on a video, only setting the 'loop' URL parameter to 1 will not work anymore. We also need to set the playlist parameter to the video ID. - Sound is no longer allowed in autoplay because of new autoplay policies of most browsers. To make autoplay work, the video must be explicitely muted. closes odoo/odoo#34323 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/widgets/widgets.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'addons/web_editor/static/src/js') diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js index b0ff59cec96..43700765049 100644 --- a/addons/web_editor/static/src/js/widgets/widgets.js +++ b/addons/web_editor/static/src/js/widgets/widgets.js @@ -795,7 +795,7 @@ var VideoDialog = Widget.extend({ return {errorCode: 0}; } - var autoplay = options.autoplay ? '?autoplay=1' : '?autoplay=0'; + var autoplay = options.autoplay ? '?autoplay=1&mute=1' : '?autoplay=0'; if (ytMatch && ytMatch[2].length === 11) { $video.attr('src', '//www.youtube' + (ytMatch[1] || '') + '.com/embed/' + ytMatch[2] + autoplay); @@ -824,7 +824,8 @@ var VideoDialog = Widget.extend({ $video.attr('src', $video.attr('src') + '&rel=0'); } if (options.loop && (ytMatch || vimMatch)) { - $video.attr('src', $video.attr('src') + '&loop=1'); + var videoSrc = _.str.sprintf('%s&loop=1', $video.attr('src')); + $video.attr('src', ytMatch ? _.str.sprintf('%s&playlist=%s', videoSrc, ytMatch[2]) : videoSrc); } if (options.hide_controls && (ytMatch || dmMatch)) { $video.attr('src', $video.attr('src') + '&controls=0'); -- cgit v1.2.3 From 56ce29e71f75a657d4b518d86c1d7084891e898e Mon Sep 17 00:00:00 2001 From: Jorge Pinna Puissant Date: Thu, 4 Jul 2019 11:43:57 +0000 Subject: [FIX] web_editor: tel url in werkzeug parser Before 8557bcf the URLs were never rewritten for multilang, which was an error and could duplicated the number of requests on frontend. Since 8557bcf the URLs are rewritten. In Odoo the werkzeug library is used to parse the URLs (this is similar to python parsing URL but works in python2 and python3 the same), and in this particular instance it chooses that tel:800800 is website http://tel:800800 and not a telephone number. The problem is when the url uses the uri 'tel:' and only numbers as a phone number, if the user uses the global format for telephone number (with the +) or using a separator for the numbers (e.g. '-' , '/'), in these cases there are no problems parsing the url (phone number RFC: https://tools.ietf.org/html/rfc3966). This commit changes the uri 'tel:' to 'tel://' this one is correctly parsed by the werkzeug library. opw-2029844 closes #34306 closes odoo/odoo#34586 Signed-off-by: Nicolas Lempereur (nle) --- addons/web_editor/static/src/js/editor/summernote.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web_editor/static/src/js') diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js index 59124d63403..cf7b370b0fa 100644 --- a/addons/web_editor/static/src/js/editor/summernote.js +++ b/addons/web_editor/static/src/js/editor/summernote.js @@ -2296,7 +2296,7 @@ $.summernote.pluginEvents.backColor = function (event, editor, layoutInfo, backC options.onCreateLink = function (sLinkUrl) { if (sLinkUrl.indexOf('mailto:') === 0 || sLinkUrl.indexOf('tel:') === 0) { - // pass + sLinkUrl = sLinkUrl.replace(/^tel:([0-9]+)$/, 'tel://$1'); } else if (sLinkUrl.indexOf('@') !== -1 && sLinkUrl.indexOf(':') === -1) { sLinkUrl = 'mailto:' + sLinkUrl; } else if (sLinkUrl.indexOf('://') === -1 && sLinkUrl[0] !== '/' -- cgit v1.2.3