summaryrefslogtreecommitdiff
path: root/addons/web_editor
diff options
context:
space:
mode:
Diffstat (limited to 'addons/web_editor')
-rw-r--r--addons/web_editor/static/src/js/editor/rte.summernote.js5
-rw-r--r--addons/web_editor/static/src/js/widgets/widgets.js6
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 614ab4bfcf0..fc4241689e7 100644
--- a/addons/web_editor/static/src/js/editor/rte.summernote.js
+++ b/addons/web_editor/static/src/js/editor/rte.summernote.js
@@ -883,7 +883,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('destroy');
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js
index b9e2a3289a0..27a5e41d06a 100644
--- a/addons/web_editor/static/src/js/widgets/widgets.js
+++ b/addons/web_editor/static/src/js/widgets/widgets.js
@@ -900,7 +900,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]*)/;
@@ -927,8 +927,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';