@innovastudio/contentbuilder 1.3.34 → 1.3.35
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
|
@@ -49415,6 +49415,12 @@ class Image$1 {
|
|
|
49415
49415
|
</div>
|
|
49416
49416
|
</div>
|
|
49417
49417
|
|
|
49418
|
+
<div class="is-modal mediaselect" style="z-index:10005" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
|
49419
|
+
<div style="max-width:800px;height:80%;padding:0;">
|
|
49420
|
+
<iframe tabindex="0" style="width:100%;height:100%;border: none;display: block;" src="about:blank"></iframe>
|
|
49421
|
+
</div>
|
|
49422
|
+
</div>
|
|
49423
|
+
|
|
49418
49424
|
<div id="divImageResizerOverlay" class="is-tool">
|
|
49419
49425
|
</div>
|
|
49420
49426
|
<div id="divImageResizer" data-x=0 data-y=0 class="is-tool moveable resizable">
|
|
@@ -58607,7 +58613,7 @@ class ColumnTool {
|
|
|
58607
58613
|
} // Select image (opens Asset Manager plugin or custom dialog)
|
|
58608
58614
|
|
|
58609
58615
|
|
|
58610
|
-
if (this.builder.opts.
|
|
58616
|
+
if (this.builder.opts.onMediaSelectClick || this.builder.opts.mediaSelect || this.builder.opts.onImageSelectClick || this.builder.opts.imageselect) {
|
|
58611
58617
|
const inpSrc = this.cellSettings.querySelector('.input-src');
|
|
58612
58618
|
elm = this.divCellClick.querySelector('.input-select');
|
|
58613
58619
|
if (elm) dom.addEventListener(elm, 'click', () => {
|
|
@@ -58620,36 +58626,34 @@ class ColumnTool {
|
|
|
58620
58626
|
|
|
58621
58627
|
this.builder.targetAssetType = 'media'; //---/default
|
|
58622
58628
|
|
|
58623
|
-
if (this.builder.opts.
|
|
58624
|
-
this.builder.opts.
|
|
58629
|
+
if (this.builder.opts.onMediaSelectClick) {
|
|
58630
|
+
this.builder.opts.onMediaSelectClick({
|
|
58625
58631
|
targetInput: inpSrc,
|
|
58626
58632
|
theTrigger: elm
|
|
58627
|
-
});
|
|
58628
|
-
|
|
58629
|
-
|
|
58630
|
-
});
|
|
58633
|
+
}); // dom.observeElement(inpSrc, 'value', () => {
|
|
58634
|
+
// this.applyClick();
|
|
58635
|
+
// });
|
|
58631
58636
|
} else if (this.builder.opts.onImageSelectClick) {
|
|
58632
58637
|
this.builder.opts.onImageSelectClick({
|
|
58633
58638
|
targetInput: inpSrc,
|
|
58634
58639
|
theTrigger: elm
|
|
58635
|
-
});
|
|
58636
|
-
|
|
58637
|
-
|
|
58638
|
-
|
|
58639
|
-
|
|
58640
|
-
let
|
|
58641
|
-
let iframe = modalFileSelect.querySelector('iframe');
|
|
58640
|
+
}); // dom.observeElement(inpSrc, 'value', () => {
|
|
58641
|
+
// this.applyClick();
|
|
58642
|
+
// });
|
|
58643
|
+
} else if (this.builder.opts.mediaSelect) {
|
|
58644
|
+
let modalMediaSelect = builderStuff.querySelector('.is-modal.mediaselect');
|
|
58645
|
+
let iframe = modalMediaSelect.querySelector('iframe');
|
|
58642
58646
|
|
|
58643
58647
|
if (this.builder.opts.assetRefresh) {
|
|
58644
|
-
iframe.src = this.builder.opts.
|
|
58648
|
+
iframe.src = this.builder.opts.mediaSelect;
|
|
58645
58649
|
this.builder.opts.assetRefresh = false;
|
|
58646
58650
|
}
|
|
58647
58651
|
|
|
58648
58652
|
if (iframe.src === 'about:blank') {
|
|
58649
|
-
iframe.src = this.builder.opts.
|
|
58653
|
+
iframe.src = this.builder.opts.mediaSelect;
|
|
58650
58654
|
}
|
|
58651
58655
|
|
|
58652
|
-
util.showModal(
|
|
58656
|
+
util.showModal(modalMediaSelect, false, () => {
|
|
58653
58657
|
elm.removeAttribute('data-focus');
|
|
58654
58658
|
elm.focus();
|
|
58655
58659
|
});
|
|
@@ -58706,7 +58710,9 @@ class ColumnTool {
|
|
|
58706
58710
|
dom.addClass(frmUpload, 'please-wait');
|
|
58707
58711
|
this.cellSettings.querySelector('#hidRefId4').value = this.builder.opts.customval;
|
|
58708
58712
|
|
|
58709
|
-
if (this.builder.opts.
|
|
58713
|
+
if (this.builder.opts.onMediaUpload) {
|
|
58714
|
+
this.builder.opts.onMediaUpload(e);
|
|
58715
|
+
} else if (this.builder.opts.onLargerImageUpload) {
|
|
58710
58716
|
this.builder.opts.onLargerImageUpload(e);
|
|
58711
58717
|
} else {
|
|
58712
58718
|
frmUpload.submit();
|
|
@@ -74128,6 +74134,12 @@ class ContentBuilder {
|
|
|
74128
74134
|
// onAdd: function(){},
|
|
74129
74135
|
largerImageHandler: '',
|
|
74130
74136
|
// onLargerImageUpload: function(){},
|
|
74137
|
+
imageHandler: '',
|
|
74138
|
+
// NEW: for image
|
|
74139
|
+
// onImageUpload: function(){}, // NEW: for image
|
|
74140
|
+
fileHandler: '',
|
|
74141
|
+
// NEW: for file/document
|
|
74142
|
+
// onFileUpload: function(){}, // NEW: for file/document
|
|
74131
74143
|
mediaHandler: '',
|
|
74132
74144
|
// onMediaUpload: function(){},
|
|
74133
74145
|
videoHandler: '',
|
|
@@ -74157,6 +74169,7 @@ class ContentBuilder {
|
|
|
74157
74169
|
// onFileSelectClick: function () { },
|
|
74158
74170
|
// onVideoSelectClick: function () { },
|
|
74159
74171
|
// onAudioSelectClick: function () { },
|
|
74172
|
+
// onMediaSelectClick: function () { }, // NEW: for image & video
|
|
74160
74173
|
// onPluginsLoaded: function () { },
|
|
74161
74174
|
// onImageBrowseClick: function () { },
|
|
74162
74175
|
// onImageSettingClick: function () { },
|
|
@@ -74185,6 +74198,8 @@ class ContentBuilder {
|
|
|
74185
74198
|
fileSelect: '',
|
|
74186
74199
|
videoSelect: '',
|
|
74187
74200
|
audioSelect: '',
|
|
74201
|
+
mediaSelect: '',
|
|
74202
|
+
// NEW: for image & video
|
|
74188
74203
|
assetRefresh: false,
|
|
74189
74204
|
// asset manager specified in imageSelect, fileSelect & videoSelect will always refreshed on click/open
|
|
74190
74205
|
customTags: [],
|
|
@@ -74646,18 +74661,34 @@ class ContentBuilder {
|
|
|
74646
74661
|
this.opts.videoselect = this.opts.videoSelect;
|
|
74647
74662
|
} else if (this.opts.videoselect !== '') {
|
|
74648
74663
|
this.opts.videoSelect = this.opts.videoselect;
|
|
74664
|
+
} // if(this.opts.largerImageHandler!=='') {
|
|
74665
|
+
// this.opts.mediaHandler = this.opts.largerImageHandler;
|
|
74666
|
+
// } else if(this.opts.mediaHandler!=='') {
|
|
74667
|
+
// this.opts.largerImageHandler = this.opts.mediaHandler;
|
|
74668
|
+
// }
|
|
74669
|
+
// if(this.opts.onLargerImageUpload) {
|
|
74670
|
+
// this.opts.onMediaUpload = this.opts.onLargerImageUpload;
|
|
74671
|
+
// } else if(this.opts.onMediaUpload) {
|
|
74672
|
+
// this.opts.onLargerImageUpload = this.opts.onMediaUpload;
|
|
74673
|
+
// }
|
|
74674
|
+
// Just in case
|
|
74675
|
+
|
|
74676
|
+
|
|
74677
|
+
if (!this.opts.onImageUpload && !this.opts.onLargerImageUpload) {
|
|
74678
|
+
this.opts.onImageUpload = this.opts.onMediaUpload;
|
|
74649
74679
|
}
|
|
74650
74680
|
|
|
74651
|
-
if (this.opts.
|
|
74652
|
-
this.opts.
|
|
74653
|
-
}
|
|
74654
|
-
|
|
74681
|
+
if (!this.opts.imageHandler && !this.opts.largerImageHandler) {
|
|
74682
|
+
this.opts.imageHandler = this.opts.mediaHandler;
|
|
74683
|
+
} // Currently used: largerImageHandler & onLargerImageUpload (as in elementimage.js)
|
|
74684
|
+
|
|
74685
|
+
|
|
74686
|
+
if (this.opts.imageHandler !== '') {
|
|
74687
|
+
this.opts.largerImageHandler = this.opts.imageHandler;
|
|
74655
74688
|
}
|
|
74656
74689
|
|
|
74657
|
-
if (this.opts.
|
|
74658
|
-
this.opts.
|
|
74659
|
-
} else if (this.opts.onMediaUpload) {
|
|
74660
|
-
this.opts.onLargerImageUpload = this.opts.onMediaUpload;
|
|
74690
|
+
if (this.opts.onImageUpload) {
|
|
74691
|
+
this.opts.onLargerImageUpload = this.opts.onImageUpload;
|
|
74661
74692
|
} // useButtonPlugin
|
|
74662
74693
|
|
|
74663
74694
|
|
|
@@ -75868,6 +75899,8 @@ class ContentBuilder {
|
|
|
75868
75899
|
if (modal) this.hideModal(modal);
|
|
75869
75900
|
modal = document.querySelector('.is-modal.audioselect.active');
|
|
75870
75901
|
if (modal) this.hideModal(modal);
|
|
75902
|
+
modal = document.querySelector('.is-modal.mediaselect.active');
|
|
75903
|
+
if (modal) this.hideModal(modal);
|
|
75871
75904
|
}
|
|
75872
75905
|
}
|
|
75873
75906
|
|
|
@@ -75936,9 +75969,9 @@ class ContentBuilder {
|
|
|
75936
75969
|
}
|
|
75937
75970
|
|
|
75938
75971
|
openAsset(targetInput, targetAssetType, theTrigger) {
|
|
75939
|
-
if (targetAssetType === 'media' && (this.opts.
|
|
75940
|
-
if (this.opts.
|
|
75941
|
-
this.opts.
|
|
75972
|
+
if (targetAssetType === 'media' && (this.opts.onMediaSelectClick || this.opts.onImageSelectClick)) {
|
|
75973
|
+
if (this.opts.onMediaSelectClick) {
|
|
75974
|
+
this.opts.onMediaSelectClick({
|
|
75942
75975
|
targetInput: targetInput,
|
|
75943
75976
|
theTrigger: theTrigger
|
|
75944
75977
|
});
|
|
@@ -75958,6 +75991,11 @@ class ContentBuilder {
|
|
|
75958
75991
|
targetInput: targetInput,
|
|
75959
75992
|
theTrigger: theTrigger
|
|
75960
75993
|
});
|
|
75994
|
+
} else if (targetAssetType === 'audio' && this.opts.onAudioSelectClick) {
|
|
75995
|
+
this.opts.onAudioSelectClick({
|
|
75996
|
+
targetInput: targetInput,
|
|
75997
|
+
theTrigger: theTrigger
|
|
75998
|
+
});
|
|
75961
75999
|
} else if (targetAssetType === 'all' && this.opts.onFileSelectClick) {
|
|
75962
76000
|
this.opts.onFileSelectClick({
|
|
75963
76001
|
targetInput: targetInput,
|
|
@@ -75968,9 +76006,12 @@ class ContentBuilder {
|
|
|
75968
76006
|
let modal;
|
|
75969
76007
|
|
|
75970
76008
|
if (targetAssetType === 'media') {
|
|
75971
|
-
modal = this.builderStuff.querySelector('.is-modal.
|
|
76009
|
+
modal = this.builderStuff.querySelector('.is-modal.mediaselect');
|
|
75972
76010
|
iframe = modal.querySelector('iframe');
|
|
75973
|
-
|
|
76011
|
+
|
|
76012
|
+
if (iframe.src === 'about:blank') {
|
|
76013
|
+
if (this.opts.mediaSelect) iframe.src = this.opts.mediaSelect;else if (this.opts.imageSelect) iframe.src = this.opts.imageSelect;
|
|
76014
|
+
}
|
|
75974
76015
|
} else if (targetAssetType === 'video') {
|
|
75975
76016
|
modal = this.builderStuff.querySelector('.is-modal.videoselect');
|
|
75976
76017
|
iframe = modal.querySelector('iframe');
|
|
@@ -75979,6 +76020,10 @@ class ContentBuilder {
|
|
|
75979
76020
|
modal = this.builderStuff.querySelector('.is-modal.imageselect');
|
|
75980
76021
|
iframe = modal.querySelector('iframe');
|
|
75981
76022
|
if (iframe.src === 'about:blank') iframe.src = this.opts.imageSelect;
|
|
76023
|
+
} else if (targetAssetType === 'audio') {
|
|
76024
|
+
modal = this.builderStuff.querySelector('.is-modal.audioselect');
|
|
76025
|
+
iframe = modal.querySelector('iframe');
|
|
76026
|
+
if (iframe.src === 'about:blank') iframe.src = this.opts.audioSelect;
|
|
75982
76027
|
} else if (targetAssetType === 'all') {
|
|
75983
76028
|
modal = this.builderStuff.querySelector('.is-modal.fileselect');
|
|
75984
76029
|
iframe = modal.querySelector('iframe');
|