diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-04-08 19:52:29 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-04-08 19:52:29 +0200 |
| commit | fef49061ead4a437bac922d9d32270f76addd014 (patch) | |
| tree | 5d38892041e4a47c83dbc54366bd5d6bd41b6604 /addons/web_editor/static/src | |
| parent | ebba721130b9887f67d4fefc9ec4855d12634cb6 (diff) | |
| parent | 4c61621efbb079a4298db99d5c0b30b90e072bb9 (diff) | |
[MERGE] forward port branch saas-11.3 up to 4c61621efbb
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/rte.summernote.js | 5 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/widgets/widgets.js | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/editor/rte.summernote.js b/addons/web_editor/static/src/js/editor/rte.summernote.js index 62586a53b5c..464c58ed4ee 100644 --- a/addons/web_editor/static/src/js/editor/rte.summernote.js +++ b/addons/web_editor/static/src/js/editor/rte.summernote.js @@ -963,7 +963,10 @@ eventHandler.attach = function (oLayoutInfo, options) { show_tooltip = true; setTimeout(function () { - if (!show_tooltip) return; + // Do not show tooltip on double-click and if there is already one + if (!show_tooltip || $target.attr('title') !== undefined) { + return; + } $target.tooltip({title: _t('Double-click to edit'), trigger: 'manuel', container: 'body'}).tooltip('show'); setTimeout(function () { $target.tooltip('dispose'); diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js index 34a45f7193d..7fda9238f34 100644 --- a/addons/web_editor/static/src/js/widgets/widgets.js +++ b/addons/web_editor/static/src/js/widgets/widgets.js @@ -912,7 +912,7 @@ var VideoWidget = MediaWidget.extend({ options = options || {}; // Video url patterns(youtube, instagram, vimeo, dailymotion, youku, ...) - var ytRegExp = /^(?:(?:https?:)?\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/; + var ytRegExp = /^(?:(?:https?:)?\/\/)?(?:www\.)?(?:youtu\.be\/|youtube(-nocookie)?\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((?:\w|-){11})(?:\S+)?$/; var ytMatch = url.match(ytRegExp); var insRegExp = /(.*)instagram.com\/p\/(.[a-zA-Z0-9]*)/; @@ -939,8 +939,8 @@ var VideoWidget = MediaWidget.extend({ var autoplay = options.autoplay ? '?autoplay=1' : '?autoplay=0'; - if (ytMatch && ytMatch[1].length === 11) { - $video.attr('src', '//www.youtube.com/embed/' + ytMatch[1] + autoplay); + if (ytMatch && ytMatch[2].length === 11) { + $video.attr('src', '//www.youtube' + (ytMatch[1] || '') + '.com/embed/' + ytMatch[2] + autoplay); } else if (insMatch && insMatch[2].length) { $video.attr('src', '//www.instagram.com/p/' + insMatch[2] + '/embed/'); videoType = 'ins'; |
