@innovastudio/contentbox 1.2.10 → 1.2.11
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 +2 -2
- package/public/contentbox/contentbox.esm.js +33 -3
- package/public/contentbox/contentbox.min.js +2 -2
- package/public/contentbox/lang/en.js +466 -466
- package/readme.txt +25 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@innovastudio/contentbox",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "public/contentbox/contentbox.esm.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"webpack-dev-server": "^4.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@innovastudio/contentbuilder": "^1.1.
|
|
43
|
+
"@innovastudio/contentbuilder": "^1.1.13",
|
|
44
44
|
"axios": "^0.21.4",
|
|
45
45
|
"cors": "^2.8.5",
|
|
46
46
|
"express": "^4.17.1",
|
|
@@ -57219,6 +57219,12 @@ class Image {
|
|
|
57219
57219
|
elm = imageTool.querySelector('.image-edit');
|
|
57220
57220
|
dom$A.addEventListener(elm, 'click', () => {
|
|
57221
57221
|
let img = this.builder.activeImage;
|
|
57222
|
+
|
|
57223
|
+
if (this.builder.onImageEditClick) {
|
|
57224
|
+
let result = this.builder.onImageEditClick(img);
|
|
57225
|
+
if (!result) return;
|
|
57226
|
+
}
|
|
57227
|
+
|
|
57222
57228
|
util.showModal(modalImageEdit, true);
|
|
57223
57229
|
let preview = modalImageEdit.querySelector('.imageedit-preview');
|
|
57224
57230
|
const maxW = 800;
|
|
@@ -57241,9 +57247,15 @@ class Image {
|
|
|
57241
57247
|
preview.innerHTML = '<img src="" style="max-width:100%;object-fit:contain;height:100%;"/>';
|
|
57242
57248
|
let imagePreview = modalImageEdit.querySelector('img');
|
|
57243
57249
|
imagePreview.src = img.src;
|
|
57244
|
-
|
|
57245
|
-
|
|
57246
|
-
|
|
57250
|
+
|
|
57251
|
+
if (this.builder.setCropperConfig) {
|
|
57252
|
+
this.cropper = new Cropper(imagePreview, this.builder.setCropperConfig);
|
|
57253
|
+
} else {
|
|
57254
|
+
this.cropper = new Cropper(imagePreview, {
|
|
57255
|
+
zoomable: false
|
|
57256
|
+
});
|
|
57257
|
+
}
|
|
57258
|
+
|
|
57247
57259
|
document.querySelector('.moveable-control-box').style.display = 'none'; //needed by Safari (prevent z-index problem)
|
|
57248
57260
|
}); // Set crop proportion
|
|
57249
57261
|
|
|
@@ -76571,6 +76583,22 @@ class ContentBuilder {
|
|
|
76571
76583
|
// onPluginsLoaded: function () { },
|
|
76572
76584
|
// onImageBrowseClick: function () { },
|
|
76573
76585
|
// onImageSettingClick: function () { },
|
|
76586
|
+
|
|
76587
|
+
/*
|
|
76588
|
+
// onImageEditClick: function () { }, // used in elementimage.js
|
|
76589
|
+
// Example:
|
|
76590
|
+
onImageEditClick: (activeImage)=>{
|
|
76591
|
+
activeImage.setAttribute('crossorigin', 'anonymous');
|
|
76592
|
+
const cropperConfig = {
|
|
76593
|
+
checkCrossOrigin:false,
|
|
76594
|
+
checkOrientation:false,
|
|
76595
|
+
crossOrigin:'anonymous'
|
|
76596
|
+
};
|
|
76597
|
+
builder.setCropperConfig = cropperConfig;
|
|
76598
|
+
return true;
|
|
76599
|
+
},
|
|
76600
|
+
*/
|
|
76601
|
+
// setCropperConfig: {}, // used in elementimage.js
|
|
76574
76602
|
imageEmbed: true,
|
|
76575
76603
|
imageselect: '',
|
|
76576
76604
|
fileselect: '',
|
|
@@ -83435,6 +83463,8 @@ class ContentBox {
|
|
|
83435
83463
|
onVideoSelectClick: this.settings.onVideoSelectClick,
|
|
83436
83464
|
onImageBrowseClick: this.settings.onImageBrowseClick,
|
|
83437
83465
|
onImageSettingClick: this.settings.onImageSettingClick,
|
|
83466
|
+
onImageEditClick: this.settings.onImageEditClick,
|
|
83467
|
+
setCropperConfig: this.settings.setCropperConfig,
|
|
83438
83468
|
onPluginsLoaded: this.settings.onPluginsLoaded,
|
|
83439
83469
|
imageselect: this.settings.imageselect,
|
|
83440
83470
|
fileselect: this.settings.fileselect,
|