@innovastudio/contentbuilder 1.0.52 → 1.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -57185,6 +57185,7 @@ class ContentBuilder {
|
|
|
57185
57185
|
zoom: 1,
|
|
57186
57186
|
useLightbox: false,
|
|
57187
57187
|
imageRenameOnEdit: true,
|
|
57188
|
+
disableAutoEmbedVideo: false,
|
|
57188
57189
|
|
|
57189
57190
|
/*
|
|
57190
57191
|
onZoomStart: () => {
|
|
@@ -59473,26 +59474,29 @@ class ContentBuilder {
|
|
|
59473
59474
|
let contentword = document.querySelector('#idContentWord'); //Check video embed
|
|
59474
59475
|
|
|
59475
59476
|
var bPasteObject = false;
|
|
59476
|
-
var src = contentword.innerText;
|
|
59477
|
+
var src = contentword.innerText;
|
|
59477
59478
|
|
|
59478
|
-
|
|
59479
|
-
|
|
59480
|
-
|
|
59481
|
-
|
|
59479
|
+
if (!this.opts.disableAutoEmbedVideo) {
|
|
59480
|
+
//var youRegex = /^http[s]?:\/\/(((www.youtube.com\/watch\?(feature=player_detailpage&)?)v=)|(youtu.be\/))([^#\&\?]*)/;
|
|
59481
|
+
var youRegex = /^http[s]?:\/\/(((www.youtube.com\/watch\?(feature=player_detailpage&)?)v=)|(youtu.be\/))([^#&?]*)/;
|
|
59482
|
+
var vimeoRegex = /^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/)|(video\/))?([0-9]+)\/?/;
|
|
59483
|
+
var youRegexMatches = youRegex.exec(src);
|
|
59484
|
+
var vimeoRegexMatches = vimeoRegex.exec(src);
|
|
59482
59485
|
|
|
59483
|
-
|
|
59484
|
-
|
|
59485
|
-
|
|
59486
|
-
|
|
59487
|
-
|
|
59486
|
+
if (youRegexMatches !== null || vimeoRegexMatches !== null) {
|
|
59487
|
+
if (youRegexMatches !== null && youRegexMatches.length >= 7) {
|
|
59488
|
+
var youMatch = youRegexMatches[6];
|
|
59489
|
+
src = 'https://www.youtube.com/embed/' + youMatch + '?rel=0';
|
|
59490
|
+
}
|
|
59488
59491
|
|
|
59489
|
-
|
|
59490
|
-
|
|
59491
|
-
|
|
59492
|
-
|
|
59492
|
+
if (vimeoRegexMatches !== null && vimeoRegexMatches.length >= 7) {
|
|
59493
|
+
var vimeoMatch = vimeoRegexMatches[6];
|
|
59494
|
+
src = 'https://player.vimeo.com/video/' + vimeoMatch;
|
|
59495
|
+
}
|
|
59493
59496
|
|
|
59494
|
-
|
|
59495
|
-
|
|
59497
|
+
sPastedText = '<div class="embed-responsive embed-responsive-16by9"><iframe width="560" height="315" src="' + src + '" frameborder="0" allowfullscreen=""></iframe></div>';
|
|
59498
|
+
bPasteObject = true;
|
|
59499
|
+
}
|
|
59496
59500
|
}
|
|
59497
59501
|
|
|
59498
59502
|
if (!bPasteObject) {
|