@innovastudio/contentbuilder 1.4.121 → 1.4.123
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -10713,7 +10713,7 @@ class HtmlUtil {
|
|
10713
10713
|
// Do not use imgUrl directly, change base to [%PATH%] instead
|
10714
10714
|
// (to prevent auto converting back to relative path)
|
10715
10715
|
|
10716
|
-
let urlBase = location.href.substring(0, location.href.lastIndexOf('/'));
|
10716
|
+
let urlBase = window.location.href.substring(0, window.location.href.lastIndexOf('/'));
|
10717
10717
|
return imgUrl.replace(urlBase, '[%PATH%]');
|
10718
10718
|
|
10719
10719
|
// Example:
|
@@ -19014,7 +19014,7 @@ function getOffset(element) {
|
|
19014
19014
|
top: box.top + (window.pageYOffset - document.documentElement.clientTop)
|
19015
19015
|
};
|
19016
19016
|
}
|
19017
|
-
var location
|
19017
|
+
var location = WINDOW.location;
|
19018
19018
|
var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
|
19019
19019
|
/**
|
19020
19020
|
* Check if the given URL is a cross origin URL.
|
@@ -19024,7 +19024,7 @@ var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
|
|
19024
19024
|
|
19025
19025
|
function isCrossOriginURL(url) {
|
19026
19026
|
var parts = url.match(REGEXP_ORIGINS);
|
19027
|
-
return parts !== null && (parts[1] !== location
|
19027
|
+
return parts !== null && (parts[1] !== location.protocol || parts[2] !== location.hostname || parts[3] !== location.port);
|
19028
19028
|
}
|
19029
19029
|
/**
|
19030
19030
|
* Add timestamp to the given URL.
|
@@ -69909,7 +69909,7 @@ class Lightbox {
|
|
69909
69909
|
|
69910
69910
|
// in case opened in an iframe (ex. preview)
|
69911
69911
|
if (window.frameElement && !lightbox) {
|
69912
|
-
lightbox = parent.document.querySelector('.is-lightbox.lightbox-edit');
|
69912
|
+
lightbox = window.parent.document.querySelector('.is-lightbox.lightbox-edit');
|
69913
69913
|
}
|
69914
69914
|
if (!this.programmatically) {
|
69915
69915
|
const list = this.getList();
|
@@ -69982,7 +69982,7 @@ class Lightbox {
|
|
69982
69982
|
|
69983
69983
|
// in case opened in an iframe (ex. preview)
|
69984
69984
|
if (window.frameElement && !lightbox) {
|
69985
|
-
lightbox = parent.document.querySelector('.is-lightbox.lightbox-edit');
|
69985
|
+
lightbox = window.parent.document.querySelector('.is-lightbox.lightbox-edit');
|
69986
69986
|
}
|
69987
69987
|
if (!this.programmatically) {
|
69988
69988
|
const list = this.getList();
|
@@ -70059,7 +70059,7 @@ class Lightbox {
|
|
70059
70059
|
|
70060
70060
|
// in case opened in an iframe (ex. preview)
|
70061
70061
|
if (window.frameElement && !lightbox) {
|
70062
|
-
lightbox = parent.document.querySelector('.is-lightbox.lightbox-edit');
|
70062
|
+
lightbox = window.parent.document.querySelector('.is-lightbox.lightbox-edit');
|
70063
70063
|
}
|
70064
70064
|
if (!this.programmatically) {
|
70065
70065
|
const list = this.getList();
|
@@ -72705,7 +72705,11 @@ class LivePreview {
|
|
72705
72705
|
if (this.modal.classList.contains('active')) {
|
72706
72706
|
// let html = this.builder.html();
|
72707
72707
|
// localStorage.setItem('preview-html', html);
|
72708
|
-
|
72708
|
+
try {
|
72709
|
+
if (this.builder.onPreviewOpen) this.builder.onPreviewOpen();
|
72710
|
+
} catch (e) {
|
72711
|
+
return;
|
72712
|
+
}
|
72709
72713
|
const iframe = this.modal.querySelector('iframe');
|
72710
72714
|
if (!this.builder.doc.querySelector('.is-wrapper')) {
|
72711
72715
|
// ContentBuilder
|
@@ -72869,7 +72873,11 @@ class LivePreview {
|
|
72869
72873
|
this.builder.livePreviewAlwaysReload = oriVal;
|
72870
72874
|
}
|
72871
72875
|
iframe.onload = () => {
|
72872
|
-
|
72876
|
+
try {
|
72877
|
+
if (this.builder.onPreviewContentLoad && !disableOnContentLoad) this.builder.onPreviewContentLoad();
|
72878
|
+
} catch (e) {
|
72879
|
+
// Do Nothing
|
72880
|
+
}
|
72873
72881
|
iframe.contentWindow.document.addEventListener('click', () => {
|
72874
72882
|
iframe.focus();
|
72875
72883
|
});
|
@@ -72879,7 +72887,8 @@ class LivePreview {
|
|
72879
72887
|
openPreview() {
|
72880
72888
|
// if(!this.builder.previewURL) return;
|
72881
72889
|
|
72882
|
-
if
|
72890
|
+
// if(this.modal.classList.contains('active')) return;
|
72891
|
+
|
72883
72892
|
const util = this.util;
|
72884
72893
|
const modal = this.modal;
|
72885
72894
|
modal.classList.add('active');
|
@@ -74920,7 +74929,9 @@ class Dictation {
|
|
74920
74929
|
let lang = this.builder.speechRecognitionLang;
|
74921
74930
|
this.recognition.lang = lang;
|
74922
74931
|
this.recognition.start();
|
74923
|
-
|
74932
|
+
|
74933
|
+
// this.speechTimeout;
|
74934
|
+
|
74924
74935
|
this.builder.commandText = '';
|
74925
74936
|
let finalTranscripts = '';
|
74926
74937
|
this.recognition.onresult = event => {
|
@@ -77679,7 +77690,7 @@ class ContentBuilder {
|
|
77679
77690
|
output = output.replaceAll('[%PATH%]', options.path);
|
77680
77691
|
} else {
|
77681
77692
|
let urlBase;
|
77682
|
-
urlBase = location.href.substring(0, location.href.lastIndexOf('/'));
|
77693
|
+
urlBase = window.location.href.substring(0, window.location.href.lastIndexOf('/'));
|
77683
77694
|
output = output.replaceAll('[%PATH%]', urlBase);
|
77684
77695
|
}
|
77685
77696
|
|