@innovastudio/contentbox 1.5.74 → 1.5.75
Sign up to get free protection for your applications and to get access to all the features.
@@ -11104,7 +11104,7 @@ class EditBox {
|
|
11104
11104
|
// '</div>';
|
11105
11105
|
|
11106
11106
|
html += `
|
11107
|
-
<form class="is-cover-upload-central" data-tooltip-top title="${out('Background
|
11107
|
+
<form class="is-cover-upload-central" data-tooltip-top title="${out('Change Background')}" data-title="${out('Change Background')}" style="opacity:1;position:absolute;width:40px;height:40px;" target="target-upload-cover" method="post" action="${this.builder.coverImageHandler}" enctype="multipart/form-data" style="position:relative;width:40px;height:40px;display:inline-block;float:left;background: rgb(90, 156, 38);">
|
11108
11108
|
<input type="file" tabindex="-1" class="input-file-cover-central" name="fileCover" accept="image/*" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;"/>
|
11109
11109
|
<input tabindex="-1" class="input-custom-value-central" name="hidcustomval" type="hidden" value="${this.builder.customval}" />
|
11110
11110
|
</form>
|
@@ -11134,7 +11134,7 @@ class EditBox {
|
|
11134
11134
|
html += '<div style="display:flex;flex-direction: row;">' + '<div style="display:flex;flex-direction: column;margin-right:25px">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Vertical Adjustment') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Decrease') + '" class="cmd-box-content-edge-y" data-value="-" style="width:40px;">-</button>' + '<button title="' + out('Increase') + '" class="cmd-box-content-edge-y" data-value="+" style="width:40px;border-left:none;">+</button>' + '<button title="' + out('Not Set') + '" class="cmd-box-content-edge-y" data-value="" style="display:none;width:40px;border-left:none;min-width:100px;">' + out('Not Set') + '</button>' + '</div>' + '</div>' + '<div style="display:flex;flex-direction: column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Horizontal Adjustment') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Decrease') + '" class="cmd-box-content-edge-x" data-value="-" style="width:40px;">-</button>' + '<button title="' + out('Increase') + '" class="cmd-box-content-edge-x" data-value="+" style="width:40px;border-left:none;">+</button>' + '<button title="' + out('Not Set') + '" class="cmd-box-content-edge-x" data-value="" style="display:none;width:40px;border-left:none;min-width:100px;">' + out('Not Set') + '</button>' + '</div>' + '</div>' + '</div>' + '<div style="display:none;flex-direction: column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Content Spacing') + ':</div>' + '<div style="display:flex">' + '<button title="0" class="cmd-box-content-spacing on" data-value="0" style="width:40px;">0</button>' + '<button title="10" class="cmd-box-content-spacing" data-value="10" style="width:40px;border-left:none;">10</button>' + '<button title="20" class="cmd-box-content-spacing" data-value="20" style="width:40px;border-left:none;">20</button>' + '<button title="30" class="cmd-box-content-spacing" data-value="30" style="width:40px;border-left:none;">30</button>' + '<button title="40" class="cmd-box-content-spacing" data-value="40" style="width:40px;border-left:none;">40</button>' + '<button title="50" class="cmd-box-content-spacing" data-value="50" style="width:40px;border-left:none;">50</button>' + '<button title="60" class="cmd-box-content-spacing" data-value="60" style="width:40px;border-left:none;">60</button>' + '<button title="80" class="cmd-box-content-spacing" data-value="80" style="width:40px;border-left:none;">80</button>' + '<button title="' + out('Not Set') + '" class="cmd-box-content-spacing" data-value="">' + out('Not Set') + '</button>' + '</div>' + '</div>' + '<div style="padding-top:20px;padding-bottom:0;">' + out('Content Spacing') + ':</div>' + '<div style="display:flex;flex-direction: column;">' + '<div style="padding-top:10px;padding-bottom: 3px;">' + out('Top') + ':</div>' + '<div style="display:flex">' + '<button title="0" class="cmd-box-content-topspacing on" data-value="0" style="width:40px">0</button>' + '<button title="10" class="cmd-box-content-topspacing" data-value="10" style="width:40px">10</button>' + '<button title="20" class="cmd-box-content-topspacing" data-value="20" style="width:40px">20</button>' + '<button title="30" class="cmd-box-content-topspacing" data-value="30" style="width:40px">30</button>' + '<button title="40" class="cmd-box-content-topspacing" data-value="40" style="width:40px">40</button>' + '<button title="50" class="cmd-box-content-topspacing" data-value="50" style="width:40px">50</button>' + '<button title="60" class="cmd-box-content-topspacing" data-value="60" style="width:40px">60</button>' + // '<button title="80" class="cmd-box-content-topspacing" data-value="80" style="width:40px">80</button>' +
|
11135
11135
|
'<button title="' + out('Not Set') + '" class="cmd-box-content-topspacing" data-value="" style="width:40px"><svg class="is-icon-flex" style="width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '</div>' + '<div style="display:flex;flex-direction: column;">' + '<div style="padding-top:10px;padding-bottom: 3px;">' + out('Bottom') + ':</div>' + '<div style="display:flex">' + '<button title="0" class="cmd-box-content-bottomspacing on" data-value="0" style="width:40px;">0</button>' + '<button title="10" class="cmd-box-content-bottomspacing" data-value="10" style="width:40px">10</button>' + '<button title="20" class="cmd-box-content-bottomspacing" data-value="20" style="width:40px">20</button>' + '<button title="30" class="cmd-box-content-bottomspacing" data-value="30" style="width:40px">30</button>' + '<button title="40" class="cmd-box-content-bottomspacing" data-value="40" style="width:40px">40</button>' + '<button title="50" class="cmd-box-content-bottomspacing" data-value="50" style="width:40px">50</button>' + '<button title="60" class="cmd-box-content-bottomspacing" data-value="60" style="width:40px">60</button>' + // '<button title="80" class="cmd-box-content-bottomspacing" data-value="80" style="width:40px">80</button>' +
|
11136
11136
|
'<button title="' + out('Not Set') + '" class="cmd-box-content-bottomspacing" data-value="" style="width:40px"><svg class="is-icon-flex" style="width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '</div>' + '</div>';
|
11137
|
-
html += '<div id="divBoxImage" class="is-tab-content" data-group="boxsettings" style="padding-top:0">' +
|
11137
|
+
html += '<div id="divBoxImage" class="is-tab-content" data-group="boxsettings" style="padding-top:0">' + '<div style="padding-top:20px;">' + '<label for="chkAnimateBg" style="margin:0;"><input id="chkAnimateBg" type="checkbox" /> ' + out('Ken Burns Effect') + '</label>' + '</div>' +
|
11138
11138
|
/*
|
11139
11139
|
'<label for="rdoKenBurns" style="display:flex;align-items:center;margin-bottom:10px;">' +
|
11140
11140
|
'<input type="radio" id="rdoKenBurns" name="boxbganim" value="1" style="margin: 0 10px 0 5px;">' +
|
@@ -12421,13 +12421,7 @@ class EditBox {
|
|
12421
12421
|
|
12422
12422
|
this.builder.settings.onChange();
|
12423
12423
|
});
|
12424
|
-
});
|
12425
|
-
|
12426
|
-
const btnBoxSelectAsset = modalEditBox.querySelector('.cmd-box-selectasset');
|
12427
|
-
if (btnBoxSelectAsset) btnBoxSelectAsset.addEventListener('click', () => {
|
12428
|
-
this.boxSelectAsset();
|
12429
|
-
}); //end of added by jack
|
12430
|
-
|
12424
|
+
});
|
12431
12425
|
const selBoxAnimate = modalEditBox.querySelector('.cmd-box-animate');
|
12432
12426
|
selBoxAnimate.addEventListener('change', () => {
|
12433
12427
|
const activeBox = this.builder.activeBox;
|
@@ -14294,6 +14288,8 @@ class EditBox {
|
|
14294
14288
|
activeBox.classList.remove('box-active');
|
14295
14289
|
}, 1000);
|
14296
14290
|
modalEditBox.style.display = 'flex';
|
14291
|
+
document.body.classList.add('box-modal-open'); // see .box-modal-open (gives outline to div.is-container when Box Settings is opened)
|
14292
|
+
|
14297
14293
|
/*
|
14298
14294
|
// Experimental
|
14299
14295
|
modalEditBox.style.display = 'flex';
|
@@ -14992,23 +14988,7 @@ class EditBox {
|
|
14992
14988
|
}
|
14993
14989
|
|
14994
14990
|
return false;
|
14995
|
-
}
|
14996
|
-
|
14997
|
-
|
14998
|
-
boxSelectAsset() {
|
14999
|
-
let activeBox = this.builder.activeBox;
|
15000
|
-
let overlay = activeBox.querySelector('.is-overlay');
|
15001
|
-
if (!overlay) return;
|
15002
|
-
let overlayBg = overlay.querySelector('.is-overlay-bg');
|
15003
|
-
if (!overlayBg) return;
|
15004
|
-
|
15005
|
-
if (this.builder.settings.onCoverImageSelectClick) {
|
15006
|
-
this.builder.settings.onCoverImageSelectClick(overlayBg);
|
15007
|
-
}
|
15008
|
-
|
15009
|
-
return false;
|
15010
|
-
} //end of added by jack
|
15011
|
-
|
14991
|
+
}
|
15012
14992
|
|
15013
14993
|
boxImage(url, err) {
|
15014
14994
|
// Remove Waiting Indicator
|
@@ -20691,13 +20671,13 @@ class Util$1 {
|
|
20691
20671
|
localStorage.removeItem('_dictation');
|
20692
20672
|
localStorage.removeItem('_mic');
|
20693
20673
|
localStorage.removeItem('_autosendcommand');
|
20694
|
-
localStorage.removeItem('_sampleshown');
|
20695
20674
|
localStorage.removeItem('_disclaimershown');
|
20696
20675
|
localStorage.removeItem('_temp');
|
20697
20676
|
localStorage.removeItem('_top_p');
|
20698
20677
|
localStorage.removeItem('_autosend_delay');
|
20699
20678
|
localStorage.removeItem('_auto_editblock');
|
20700
20679
|
localStorage.removeItem('_command_lang');
|
20680
|
+
localStorage.removeItem('_ai_panel_open');
|
20701
20681
|
|
20702
20682
|
//NOT USED
|
20703
20683
|
localStorage.removeItem('_scrollableeditor');
|
@@ -20708,6 +20688,7 @@ class Util$1 {
|
|
20708
20688
|
localStorage.removeItem('_advancedhtmleditor');
|
20709
20689
|
localStorage.removeItem('_hidecolhtmleditor');
|
20710
20690
|
localStorage.removeItem('_hiderowhtmleditor');
|
20691
|
+
localStorage.removeItem('_sampleshown');
|
20711
20692
|
}
|
20712
20693
|
|
20713
20694
|
// source: http://stackoverflow.com/questions/6690752/insert-html-at-caret-in-a-contenteditable-div */
|
@@ -29541,9 +29522,9 @@ class HtmlUtil {
|
|
29541
29522
|
</div>
|
29542
29523
|
|
29543
29524
|
<div class="is-modal viewhtmlmonaco" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
29544
|
-
<div class="is-modal-content" style="max-width
|
29525
|
+
<div class="is-modal-content" style="width:${this.builder.blockCodeEditorWidth};max-width:${this.builder.blockCodeEditorMaxWidth};padding:0">
|
29545
29526
|
<textarea style="position:absolute;display:none;"></textarea>
|
29546
|
-
<div class="input-code-editor" style="width:100%;height
|
29527
|
+
<div class="input-code-editor" style="width:100%;height:${this.builder.blockCodeEditorHeight};"></div>
|
29547
29528
|
<div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">
|
29548
29529
|
<button title="${util.out('Cancel')}" class="input-cancel classic-secondary">${util.out('Cancel')}</button>
|
29549
29530
|
<button title="${util.out('Ok')}" class="input-ok classic-primary">${util.out('Ok')}</button>
|
@@ -29552,8 +29533,8 @@ class HtmlUtil {
|
|
29552
29533
|
</div>
|
29553
29534
|
|
29554
29535
|
<div class="is-modal viewhtmlexternal" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
29555
|
-
<div class="is-modal-content" style="max-width
|
29556
|
-
<div class="input-code-editor" style="width:100%;height
|
29536
|
+
<div class="is-modal-content" style="width:${this.builder.codeEditorWidth};max-width:${this.builder.codeEditorMaxWidth};padding:0">
|
29537
|
+
<div class="input-code-editor" style="width:100%;height:${this.builder.codeEditorHeight};"></div>
|
29557
29538
|
<div class="is-modal-footer" style="display:flex;justify-content:flex-end;border-top:1px solid ${this.builder.styleSeparatorColor};">
|
29558
29539
|
<button title="${util.out('Cancel')}" class="input-cancel classic-secondary">${util.out('Cancel')}</button>
|
29559
29540
|
<button title="${util.out('Ok')}" class="input-ok classic-primary">${util.out('Ok')}</button>
|
@@ -29920,6 +29901,16 @@ class HtmlUtil {
|
|
29920
29901
|
this.builder.codeEditorArea = area;
|
29921
29902
|
let codeEditor = viewhtml.querySelector('.input-code-editor');
|
29922
29903
|
codeEditor.style.opacity = '';
|
29904
|
+
let modelContent = viewhtml.querySelector('.is-modal-content');
|
29905
|
+
if (mode === 'full') {
|
29906
|
+
modelContent.style.width = this.builder.codeEditorWidth;
|
29907
|
+
modelContent.style.maxWidth = this.builder.codeEditorMaxWidth;
|
29908
|
+
codeEditor.style.height = this.builder.codeEditorHeight;
|
29909
|
+
} else {
|
29910
|
+
modelContent.style.width = this.builder.blockCodeEditorWidth;
|
29911
|
+
modelContent.style.maxWidth = this.builder.blockCodeEditorMaxWidth;
|
29912
|
+
codeEditor.style.height = this.builder.blockCodeEditorHeight;
|
29913
|
+
}
|
29923
29914
|
}
|
29924
29915
|
fromViewToActual(html) {
|
29925
29916
|
for (var key in hash$1) {
|
@@ -31023,10 +31014,6 @@ const prepareSvgIcons = builder => {
|
|
31023
31014
|
<path d="M4 12h4"></path>
|
31024
31015
|
<path d="M4 18h4"></path>
|
31025
31016
|
</symbol>
|
31026
|
-
<symbol id="icon-folder" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
31027
|
-
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
31028
|
-
<path d="M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2"></path>
|
31029
|
-
</symbol>
|
31030
31017
|
<symbol id="icon-folder-media" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
31031
31018
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
31032
31019
|
<path d="M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2"></path>
|
@@ -31095,6 +31082,23 @@ const prepareSvgIcons = builder => {
|
|
31095
31082
|
<path d="M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"></path>
|
31096
31083
|
<path d="M20.2 20.2l1.8 1.8"></path>
|
31097
31084
|
</symbol>
|
31085
|
+
|
31086
|
+
<symbol id="icon-folder-old" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
31087
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
31088
|
+
<path d="M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2"></path>
|
31089
|
+
</symbol>
|
31090
|
+
<symbol id="icon-folder" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
31091
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
31092
|
+
<path d="M11 19h-6a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2.5"></path>
|
31093
|
+
<path d="M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"></path>
|
31094
|
+
<path d="M20.2 20.2l1.8 1.8"></path>
|
31095
|
+
</symbol>
|
31096
|
+
<symbol id="icon-folder2" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
31097
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
31098
|
+
<path d="M11 19h-6a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2.5"></path>
|
31099
|
+
<path d="M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"></path>
|
31100
|
+
<path d="M20.2 20.2l1.8 1.8"></path>
|
31101
|
+
</symbol>
|
31098
31102
|
|
31099
31103
|
</defs>
|
31100
31104
|
</svg>`;
|
@@ -64688,6 +64692,7 @@ class Image$1 {
|
|
64688
64692
|
<input title="${util.out('Change Image')}" data-title="${util.out('Change Image')}" id="fileEmbedImage" type="file" accept="image/*" style="position:absolute;top:-20px;left:0;width:40px;height:60px;opacity: 0;cursor: pointer;"/>
|
64689
64693
|
</div>
|
64690
64694
|
<button tabindex="0" title="${util.out('Link')}" data-title="${util.out('Link')}" class="image-link" style="width:40px;height:40px;"><svg class="is-icon-flex" style="width:17px;height:17px;"><use xlink:href="#ion-link"></use></svg></button>
|
64695
|
+
<button tabindex="0" title="${util.out('Select')}" data-title="${util.out('Select')}" class="open-asset" style="display:none;width:40px;height:40px;"><svg class="is-icon-flex" style="width:17px;height:17px;color:#fff"><use xlink:href="#icon-folder2"></use></svg></button>
|
64691
64696
|
<button tabindex="0" title="${util.out('Edit')}" data-title="${util.out('Edit')}" class="image-edit" style="width:40px;height:40px;"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-android-create"></use></svg></button>
|
64692
64697
|
</div>
|
64693
64698
|
<div id="divImageProgress">
|
@@ -64775,13 +64780,13 @@ class Image$1 {
|
|
64775
64780
|
</div>
|
64776
64781
|
|
64777
64782
|
<div class="is-modal imageselect" style="z-index:10005" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
64778
|
-
<div style="max-width:${this.builder.
|
64783
|
+
<div style="width:${this.builder.imageSelectWidth};max-width:${this.builder.imageSelectMaxWidth};height:${this.builder.imageSelectHeight};padding:0;">
|
64779
64784
|
<iframe tabindex="0" style="width:100%;height:100%;border: none;display: block;" src="about:blank"></iframe>
|
64780
64785
|
</div>
|
64781
64786
|
</div>
|
64782
64787
|
|
64783
64788
|
<div class="is-modal mediaselect" style="z-index:10005" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
64784
|
-
<div style="max-width:${this.builder.
|
64789
|
+
<div style="width:${this.builder.mediaSelectWidth};max-width:${this.builder.mediaSelectMaxWidth};height:${this.builder.mediaSelectHeight};padding:0;">
|
64785
64790
|
<iframe tabindex="0" style="width:100%;height:100%;border: none;display: block;" src="about:blank"></iframe>
|
64786
64791
|
</div>
|
64787
64792
|
</div>
|
@@ -65204,6 +65209,37 @@ class Image$1 {
|
|
65204
65209
|
util.hideModal(modalImageLink);
|
65205
65210
|
this.builder.elmTool.refresh();
|
65206
65211
|
});
|
65212
|
+
const btnOpenAsset = imageTool.querySelector('.open-asset');
|
65213
|
+
if (this.builder.opts.onImageSelectClick || this.builder.opts.imageselect) {
|
65214
|
+
btnOpenAsset.style.display = 'block';
|
65215
|
+
dom.addEventListener(btnOpenAsset, 'click', () => {
|
65216
|
+
let img = this.builder.activeImage;
|
65217
|
+
let currentSrc = img ? img.getAttribute('src') : '';
|
65218
|
+
this.builder.openImageSelect(src => {
|
65219
|
+
this.builder.uo.saveForUndo();
|
65220
|
+
let img = this.builder.activeImage;
|
65221
|
+
img.setAttribute('src', src);
|
65222
|
+
setTimeout(() => {
|
65223
|
+
img.click();
|
65224
|
+
let divImageResizer = document.querySelector('#divImageResizer');
|
65225
|
+
if (divImageResizer) divImageResizer.click();
|
65226
|
+
setTimeout(() => {
|
65227
|
+
img.click();
|
65228
|
+
let divImageResizer = document.querySelector('#divImageResizer');
|
65229
|
+
if (divImageResizer) divImageResizer.click();
|
65230
|
+
}, 600);
|
65231
|
+
}, 10);
|
65232
|
+
|
65233
|
+
//Trigger Change event
|
65234
|
+
this.builder.opts.onChange();
|
65235
|
+
|
65236
|
+
//Trigger Render event
|
65237
|
+
this.builder.opts.onRender();
|
65238
|
+
}, currentSrc);
|
65239
|
+
});
|
65240
|
+
} else {
|
65241
|
+
btnOpenAsset.style.display = 'none';
|
65242
|
+
}
|
65207
65243
|
|
65208
65244
|
// Select image (opens Asset Manager plugin or custom dialog)
|
65209
65245
|
let divImageSrc = modalImageLink.querySelector('.image-src');
|
@@ -67825,12 +67861,12 @@ class Hyperlink {
|
|
67825
67861
|
</div>
|
67826
67862
|
|
67827
67863
|
<div class="is-modal fileselect" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
67828
|
-
<div class="is-modal-content" style="max-width:${this.builder.
|
67864
|
+
<div class="is-modal-content" style="width:${this.builder.fileSelectWidth};max-width:${this.builder.fileSelectMaxWidth};height:${this.builder.fileSelectHeight};padding:0;">
|
67829
67865
|
<iframe tabindex="0" style="width:100%;height:100%;border: none;display: block;" src="about:blank"></iframe>
|
67830
67866
|
</div>
|
67831
67867
|
</div>
|
67832
67868
|
<div class="is-modal otherselect" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
67833
|
-
<div class="is-modal-content" style="max-width:${this.builder.
|
67869
|
+
<div class="is-modal-content" style="width:${this.builder.otherSelectWidth};max-width:${this.builder.otherSelectMaxWidth};height:${this.builder.otherSelectHeight};padding:0;">
|
67834
67870
|
<iframe tabindex="0" style="width:100%;height:100%;border: none;display: block;" src="about:blank"></iframe>
|
67835
67871
|
</div>
|
67836
67872
|
</div>
|
@@ -69943,7 +69979,7 @@ class Video {
|
|
69943
69979
|
</div>
|
69944
69980
|
|
69945
69981
|
<div class="is-modal videoselect" style="z-index:10005" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
69946
|
-
<div style="max-width:${this.builder.
|
69982
|
+
<div style="width:${this.builder.videoSelectWidth};max-width:${this.builder.videoSelectMaxWidth};height:${this.builder.videoSelectHeight};padding:0;">
|
69947
69983
|
<iframe tabindex="0" style="width:100%;height:100%;border: none;display: block;" src="about:blank"></iframe>
|
69948
69984
|
</div>
|
69949
69985
|
</div>
|
@@ -70154,7 +70190,7 @@ class Audio {
|
|
70154
70190
|
</div>
|
70155
70191
|
|
70156
70192
|
<div class="is-modal audioselect" style="z-index:10005" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
70157
|
-
<div style="max-width:${this.builder.
|
70193
|
+
<div style="width:${this.builder.audioSelectWidth};max-width:${this.builder.audioSelectMaxWidth};height:${this.builder.audioSelectHeight};padding:0;">
|
70158
70194
|
<iframe tabindex="0" style="width:100%;height:100%;border: none;display: block;" src="about:blank"></iframe>
|
70159
70195
|
</div>
|
70160
70196
|
</div>
|
@@ -75206,6 +75242,8 @@ class ColumnTool {
|
|
75206
75242
|
const inpSrc = this.cellSettings.querySelector('.input-src');
|
75207
75243
|
elm = this.divCellClick.querySelector('.input-select');
|
75208
75244
|
if (elm) dom.addEventListener(elm, 'click', () => {
|
75245
|
+
//TODO: Simplify using openAsset
|
75246
|
+
|
75209
75247
|
//---default
|
75210
75248
|
this.builder.targetInput = inpSrc; // used by selectAsset() (see contentbuilder.js)
|
75211
75249
|
this.builder.targetCallback = () => {
|
@@ -92882,6 +92920,7 @@ class Dictation {
|
|
92882
92920
|
<button class="scope-section on" title="${util.out('General')}" data-value="general" style="margin-right:5px">${util.out('General')}</button>
|
92883
92921
|
<button class="scope-others" title="${util.out('Ask Questions')}" data-value="others">${util.out('Ask Questions')}</button>
|
92884
92922
|
<button class="scope-block" title="${util.out('Edit Selected Block')}" data-value="block" style="">${util.out('Edit Selected Block')}</button>
|
92923
|
+
<button class="scope-image" title="${util.out('Image')}" data-value="image" style="display:none;margin-right:5px">${util.out('Image')}</button>
|
92885
92924
|
</div>
|
92886
92925
|
</div>
|
92887
92926
|
<textarea class="inp-command"></textarea>
|
@@ -93013,15 +93052,12 @@ class Dictation {
|
|
93013
93052
|
info += '</ul>';
|
93014
93053
|
divInfo.innerHTML = info;
|
93015
93054
|
const inpCommand = this.builderStuff.querySelector('.inp-command');
|
93016
|
-
if (localStorage.getItem('_sampleshown') === null) {
|
93017
|
-
inpCommand.setAttribute('placeholder', this.builder.commandPlaceholderText);
|
93018
|
-
localStorage.setItem('_sampleshown', true);
|
93019
|
-
}
|
93020
93055
|
this.builder.commandText = '';
|
93021
93056
|
this.builder.autoSendCommand = false;
|
93022
93057
|
if (localStorage.getItem('_dictation') !== null) {
|
93023
93058
|
if (localStorage.getItem('_dictation') === '1') {
|
93024
93059
|
this.modalCommand.classList.add('active');
|
93060
|
+
this.doOpen();
|
93025
93061
|
if (localStorage.getItem('_mic') !== null) {
|
93026
93062
|
if (localStorage.getItem('_mic') === '1') {
|
93027
93063
|
this.startDictation();
|
@@ -93122,28 +93158,34 @@ class Dictation {
|
|
93122
93158
|
btnCommandList.addEventListener('click', () => {
|
93123
93159
|
let htmlList = '';
|
93124
93160
|
const commandInfo = this.builder.commandInfo;
|
93161
|
+
let bImageGeneration = false;
|
93162
|
+
if (this.builder.textToImageUrl) {
|
93163
|
+
bImageGeneration = true;
|
93164
|
+
}
|
93125
93165
|
for (const key in commandInfo) {
|
93126
93166
|
if (Object.prototype.hasOwnProperty.call(commandInfo, key)) {
|
93127
|
-
|
93128
|
-
|
93129
|
-
|
93130
|
-
|
93131
|
-
|
93132
|
-
|
93133
|
-
|
93134
|
-
if (
|
93135
|
-
|
93136
|
-
|
93167
|
+
if (key !== 'image' || key === 'image' && bImageGeneration) {
|
93168
|
+
const {
|
93169
|
+
title,
|
93170
|
+
description,
|
93171
|
+
list,
|
93172
|
+
width
|
93173
|
+
} = commandInfo[key];
|
93174
|
+
if (!this.builder.enableShortCommands) {
|
93175
|
+
if (description) {
|
93176
|
+
htmlList += `<h2>${title}</h2>`;
|
93177
|
+
htmlList += `<p>${description}</p>`;
|
93178
|
+
} else {
|
93179
|
+
htmlList += `<h2 style="margin-bottom:30px">${title}</h2>`;
|
93180
|
+
}
|
93181
|
+
for (const item of list) {
|
93182
|
+
if (width) htmlList += `<div role="button" tabindex="0" class="command-item" style="width:${width}">${item}</div>`;else htmlList += `<div role="button" tabindex="0" class="command-item">${item}</div>`;
|
93183
|
+
}
|
93137
93184
|
} else {
|
93138
|
-
htmlList += `<h2
|
93139
|
-
|
93140
|
-
|
93141
|
-
|
93142
|
-
}
|
93143
|
-
} else {
|
93144
|
-
htmlList += `<h2>${title}</h2>`;
|
93145
|
-
for (const item of list) {
|
93146
|
-
if (width) htmlList += `<div role="button" tabindex="0" class="command-item" style="width:${width}">${item}</div>`;else htmlList += `<div role="button" tabindex="0" class="command-item">${item}</div>`;
|
93185
|
+
htmlList += `<h2>${title}</h2>`;
|
93186
|
+
for (const item of list) {
|
93187
|
+
if (width) htmlList += `<div role="button" tabindex="0" class="command-item" style="width:${width}">${item}</div>`;else htmlList += `<div role="button" tabindex="0" class="command-item">${item}</div>`;
|
93188
|
+
}
|
93147
93189
|
}
|
93148
93190
|
}
|
93149
93191
|
}
|
@@ -93253,7 +93295,10 @@ class Dictation {
|
|
93253
93295
|
const btnScopeSection = this.modalCommand.querySelector('.scope-section');
|
93254
93296
|
const btnScopeBlock = this.modalCommand.querySelector('.scope-block');
|
93255
93297
|
const btnScopeOthers = this.modalCommand.querySelector('.scope-others');
|
93298
|
+
const btnScopeImage = this.modalCommand.querySelector('.scope-image');
|
93256
93299
|
btnScopeBlock.disabled = true;
|
93300
|
+
if (this.builder.textToImageUrl) btnScopeImage.style.display = ''; // show generate image button
|
93301
|
+
|
93257
93302
|
const assistModeBtns = modalCommand.querySelectorAll('.div-assistant-mode button');
|
93258
93303
|
assistModeBtns.forEach(btn => {
|
93259
93304
|
btn.addEventListener('click', () => {
|
@@ -93262,7 +93307,21 @@ class Dictation {
|
|
93262
93307
|
});
|
93263
93308
|
btn.classList.add('on');
|
93264
93309
|
const val = btn.getAttribute('data-value');
|
93265
|
-
this.builder.assistantMode = val; // general, block, others
|
93310
|
+
this.builder.assistantMode = val; // general, block, others, image
|
93311
|
+
|
93312
|
+
if (this.builder.hidePlaceholder) {
|
93313
|
+
inpCommand.setAttribute('placeholder', '');
|
93314
|
+
} else {
|
93315
|
+
if (val === 'general') {
|
93316
|
+
inpCommand.setAttribute('placeholder', this.builder.commandPlaceholders.general || '');
|
93317
|
+
} else if (val === 'block') {
|
93318
|
+
inpCommand.setAttribute('placeholder', this.builder.commandPlaceholders.edit_block || '');
|
93319
|
+
} else if (val === 'others') {
|
93320
|
+
inpCommand.setAttribute('placeholder', this.builder.commandPlaceholders.ask_questions || '');
|
93321
|
+
} else if (val === 'image') {
|
93322
|
+
inpCommand.setAttribute('placeholder', this.builder.commandPlaceholders.generate_image || '');
|
93323
|
+
}
|
93324
|
+
}
|
93266
93325
|
|
93267
93326
|
/*
|
93268
93327
|
// ContentBox
|
@@ -93293,17 +93352,20 @@ class Dictation {
|
|
93293
93352
|
btnScopeBlock.classList.add('on');
|
93294
93353
|
btnScopeSection.classList.remove('on');
|
93295
93354
|
btnScopeOthers.classList.remove('on');
|
93355
|
+
btnScopeImage.classList.remove('on');
|
93296
93356
|
}
|
93297
93357
|
btnScopeBlock.removeAttribute('disabled');
|
93298
93358
|
} else {
|
93299
93359
|
btnScopeBlock.disabled = true;
|
93300
93360
|
if (btnScopeOthers.classList.contains('on')) return;
|
93361
|
+
if (btnScopeImage.classList.contains('on')) return;
|
93301
93362
|
|
93302
93363
|
// change
|
93303
93364
|
this.builder.assistantMode = 'general';
|
93304
93365
|
btnScopeSection.classList.add('on');
|
93305
93366
|
btnScopeBlock.classList.remove('on');
|
93306
93367
|
btnScopeOthers.classList.remove('on');
|
93368
|
+
btnScopeImage.classList.remove('on');
|
93307
93369
|
}
|
93308
93370
|
};
|
93309
93371
|
this.initialStart = false; // for Safari
|
@@ -93378,7 +93440,32 @@ class Dictation {
|
|
93378
93440
|
return true;
|
93379
93441
|
}
|
93380
93442
|
}
|
93443
|
+
doOpen() {
|
93444
|
+
this.builder.hidePlaceholder = false;
|
93445
|
+
const numeOfOpenToHidePlaceholderText = 4;
|
93446
|
+
if (localStorage.getItem('_ai_panel_open') === null) {
|
93447
|
+
localStorage.setItem('_ai_panel_open', 1);
|
93448
|
+
} else {
|
93449
|
+
let count = parseInt(localStorage.getItem('_ai_panel_open'));
|
93450
|
+
if (count < numeOfOpenToHidePlaceholderText) {
|
93451
|
+
count++;
|
93452
|
+
localStorage.setItem('_ai_panel_open', count);
|
93453
|
+
}
|
93454
|
+
}
|
93455
|
+
const inpCommand = this.builderStuff.querySelector('.inp-command');
|
93456
|
+
if (localStorage.getItem('_ai_panel_open') === `${numeOfOpenToHidePlaceholderText}`) {
|
93457
|
+
this.builder.hidePlaceholder = true;
|
93458
|
+
inpCommand.setAttribute('placeholder', '');
|
93459
|
+
} else {
|
93460
|
+
if (!this.builder.commandPlaceholders) {
|
93461
|
+
this.builder.commandPlaceholders = {};
|
93462
|
+
this.builder.commandPlaceholders.general = '';
|
93463
|
+
}
|
93464
|
+
inpCommand.setAttribute('placeholder', this.builder.commandPlaceholders.general || '');
|
93465
|
+
}
|
93466
|
+
}
|
93381
93467
|
openDictation() {
|
93468
|
+
this.doOpen();
|
93382
93469
|
const inpCommand = this.modalCommand.querySelector('.inp-command');
|
93383
93470
|
if (this.modalCommand.classList.contains('active')) {
|
93384
93471
|
setTimeout(() => {
|
@@ -94015,18 +94102,30 @@ class ContentBuilder {
|
|
94015
94102
|
otherSelectCaption: 'Select Document',
|
94016
94103
|
// otherSelectIcon: '<svg class="is-icon-flex"><use xlink:href="#ion-ios-folder-outline"></use></svg>',
|
94017
94104
|
otherSelectIcon: '<svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#icon-list-search"></use></svg>',
|
94018
|
-
imageSelectWidth: '
|
94105
|
+
imageSelectWidth: '80vw',
|
94019
94106
|
imageSelectHeight: '80vh',
|
94020
|
-
fileSelectWidth: '
|
94107
|
+
fileSelectWidth: '80vw',
|
94021
94108
|
fileSelectHeight: '80vh',
|
94022
|
-
videoSelectWidth: '
|
94109
|
+
videoSelectWidth: '80vw',
|
94023
94110
|
videoSelectHeight: '80vh',
|
94024
|
-
audioSelectWidth: '
|
94111
|
+
audioSelectWidth: '80vw',
|
94025
94112
|
audioSelectHeight: '80vh',
|
94026
|
-
mediaSelectWidth: '
|
94113
|
+
mediaSelectWidth: '80vw',
|
94027
94114
|
mediaSelectHeight: '80vh',
|
94028
|
-
otherSelectWidth: '
|
94115
|
+
otherSelectWidth: '80vw',
|
94029
94116
|
otherSelectHeight: '80vh',
|
94117
|
+
imageSelectMaxWidth: '1600px',
|
94118
|
+
fileSelectMaxWidth: '1600px',
|
94119
|
+
videoSelectMaxWidth: '1600px',
|
94120
|
+
audioSelectMaxWidth: '1600px',
|
94121
|
+
mediaSelectMaxWidth: '1600px',
|
94122
|
+
otherSelectMaxWidth: '1600px',
|
94123
|
+
codeEditorWidth: '80vw',
|
94124
|
+
codeEditorHeight: '80vh',
|
94125
|
+
codeEditorMaxWidth: '1600px',
|
94126
|
+
blockCodeEditorWidth: '80vw',
|
94127
|
+
blockCodeEditorHeight: '45vh',
|
94128
|
+
blockCodeEditorMaxWidth: '960px',
|
94030
94129
|
assetRefresh: false,
|
94031
94130
|
// asset manager specified in imageSelect, fileSelect & videoSelect will always refreshed on click/open
|
94032
94131
|
customTags: [],
|
@@ -94462,7 +94561,6 @@ class ContentBuilder {
|
|
94462
94561
|
onlineDemo: false,
|
94463
94562
|
autoSendDelay: 4000,
|
94464
94563
|
autoEditBlock: false,
|
94465
|
-
commandPlaceholderText: '',
|
94466
94564
|
enableShortCommands: true,
|
94467
94565
|
speechRecognitionLang: 'en-US',
|
94468
94566
|
assistantMode: 'general',
|
@@ -95159,6 +95257,7 @@ class ContentBuilder {
|
|
95159
95257
|
window.selectAsset = this.selectAsset.bind(this);
|
95160
95258
|
window.assetType = this.assetType.bind(this);
|
95161
95259
|
window.hideModal = this.hideModal.bind(this);
|
95260
|
+
window.generateImage = this.generateImage.bind(this);
|
95162
95261
|
setTimeout(() => {
|
95163
95262
|
// Remember UI
|
95164
95263
|
if (localStorage.getItem('_livepreview') != null) {
|
@@ -95983,6 +96082,35 @@ class ContentBuilder {
|
|
95983
96082
|
return this.targetAssetType; // not used yet
|
95984
96083
|
}
|
95985
96084
|
|
96085
|
+
openImageSelect(callback, defaultValue) {
|
96086
|
+
const inpUrl = document.createElement('input');
|
96087
|
+
|
96088
|
+
// dummy button (for the openAsset() method, for the old Asset Manager. Not needed for the new.)
|
96089
|
+
const btn = document.createElement('button');
|
96090
|
+
this.openAsset(inpUrl, 'image', btn, defaultValue);
|
96091
|
+
let out = s => this.util.out(s);
|
96092
|
+
const desc = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
|
96093
|
+
Object.defineProperty(inpUrl, 'value', {
|
96094
|
+
get: desc.get,
|
96095
|
+
set: function (s) {
|
96096
|
+
// Additional protection if normal selectAsset() is not used in asset dialog.
|
96097
|
+
// This is used if onImageSelectClick or onFileSelectClick are used.
|
96098
|
+
const filename = s.substring(s.lastIndexOf('/') + 1);
|
96099
|
+
let extension = filename.split('.').pop();
|
96100
|
+
extension = extension.toLowerCase();
|
96101
|
+
let ok = false;
|
96102
|
+
if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'webp') {
|
96103
|
+
ok = true;
|
96104
|
+
} else {
|
96105
|
+
alert(out('Please select an image file.'));
|
96106
|
+
}
|
96107
|
+
if (ok) {
|
96108
|
+
if (callback) callback(s);
|
96109
|
+
}
|
96110
|
+
desc.set.call(this, s);
|
96111
|
+
}
|
96112
|
+
});
|
96113
|
+
}
|
95986
96114
|
renderSelectAsset(btn, targetAssetType, callback) {
|
95987
96115
|
const _id = 'inp_' + this.util.makeId();
|
95988
96116
|
btn.insertAdjacentHTML('afterend', `<input type="hidden" id="${_id}">`);
|
@@ -96052,7 +96180,9 @@ class ContentBuilder {
|
|
96052
96180
|
this.targetAssetType = targetAssetType;
|
96053
96181
|
}
|
96054
96182
|
}
|
96055
|
-
openAsset(targetInput, targetAssetType, theTrigger) {
|
96183
|
+
openAsset(targetInput, targetAssetType, theTrigger, defaultValue) {
|
96184
|
+
let iframe;
|
96185
|
+
let modal;
|
96056
96186
|
if (targetAssetType === 'media' && (this.opts.onMediaSelectClick || this.opts.onImageSelectClick)) {
|
96057
96187
|
if (this.opts.onMediaSelectClick) {
|
96058
96188
|
this.opts.onMediaSelectClick({
|
@@ -96086,8 +96216,6 @@ class ContentBuilder {
|
|
96086
96216
|
theTrigger: theTrigger
|
96087
96217
|
});
|
96088
96218
|
} else {
|
96089
|
-
let iframe;
|
96090
|
-
let modal;
|
96091
96219
|
if (targetAssetType === 'media') {
|
96092
96220
|
modal = this.builderStuff.querySelector('.is-modal.mediaselect');
|
96093
96221
|
iframe = modal.querySelector('iframe');
|
@@ -96116,6 +96244,23 @@ class ContentBuilder {
|
|
96116
96244
|
this.targetCallback = null;
|
96117
96245
|
this.targetAssetType = targetAssetType;
|
96118
96246
|
}
|
96247
|
+
if (!defaultValue) defaultValue = '';
|
96248
|
+
if (targetInput && targetInput.value) {
|
96249
|
+
defaultValue = targetInput.value;
|
96250
|
+
}
|
96251
|
+
if (this.onAssetOpen) {
|
96252
|
+
if (iframe) {
|
96253
|
+
if (iframe.contentWindow.document.body.innerHTML !== '') {
|
96254
|
+
this.onAssetOpen(defaultValue, iframe.contentWindow);
|
96255
|
+
} else {
|
96256
|
+
iframe.addEventListener('load', () => {
|
96257
|
+
this.onAssetOpen(defaultValue, iframe.contentWindow);
|
96258
|
+
});
|
96259
|
+
}
|
96260
|
+
} else {
|
96261
|
+
this.onAssetOpen(defaultValue, iframe);
|
96262
|
+
}
|
96263
|
+
}
|
96119
96264
|
}
|
96120
96265
|
|
96121
96266
|
// Grid
|
@@ -96952,6 +97097,151 @@ class ContentBuilder {
|
|
96952
97097
|
}
|
96953
97098
|
}
|
96954
97099
|
}
|
97100
|
+
async generateImage(prompt, callback) {
|
97101
|
+
this.controller = new AbortController(); // Create a new AbortController
|
97102
|
+
this.signal = this.controller.signal; // Get a new signal object
|
97103
|
+
|
97104
|
+
let model = 'realistic-vision-v3';
|
97105
|
+
let negative_prompt = '';
|
97106
|
+
if (model.includes('realistic-vision')) {
|
97107
|
+
if (negative_prompt === '') negative_prompt = 'duplicate, (deformed iris, deformed pupils, semi-realistic, cgi, 3d, render, sketch, cartoon, drawing, anime:1.4), text, close up, cropped, out of frame, worst quality, low quality, jpeg artifacts, ugly, duplicate, morbid, mutilated, extra fingers, mutated hands, poorly drawn hands, poorly drawn face, mutation, deformed, blurry, dehydrated, bad anatomy, bad proportions, extra limbs, cloned face, disfigured, gross proportions, malformed limbs, missing arms, missing legs, extra arms, extra legs, fused fingers, too many fingers, long neck, bad_prompt_version2, bad-hands-5, badhandv4, bad anatomy, deformed, mutated, amputated, missing finger, extra finger, fused fingers, missing leg, extra leg, fused legs, missing digit, extra digit, fused digits, missing hand, extra hand, fused hands, missing arm, extra arm, fused arms, missing limb, extra limb, fused limbs, fused bodies, merged bodies, extra bodies, dual bodies, extra navel, elongated body, missing joint, extra joint, fused joints, deformed hip, twisted limbs, twisted legs, twisted arms, missing head, extra head, double head, twins, missing ear, extra ear, deformed ear, black and white, monochrome, multiple views, blurry, text, signature, head out of frame, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, grayscale, glans, bad hands, error, extra digit, fewer digits, cropped, jpeg artifacts, watermark, username, bad feet, poorly drawn hands, poorly drawn face, mutation, too many fingers, long neck, long body, long arms, cross-eyed, mutated hands, polar lowres, bad body, bad proportions, gross proportions, cropped head , bad eyes, extra breast, missing breast, fused breasts, unnatural proportions, necklace';
|
97108
|
+
}
|
97109
|
+
let width = 1024;
|
97110
|
+
let height = 1024;
|
97111
|
+
let steps = 25;
|
97112
|
+
let guidance = 7.5;
|
97113
|
+
let scheduler = 'dpmsolver++';
|
97114
|
+
let output_format = 'jpeg';
|
97115
|
+
const messages = {
|
97116
|
+
model: 'realistic-vision-v3',
|
97117
|
+
prompt: prompt,
|
97118
|
+
negative_prompt: negative_prompt,
|
97119
|
+
width: width,
|
97120
|
+
height: height,
|
97121
|
+
steps: steps,
|
97122
|
+
guidance: guidance,
|
97123
|
+
scheduler: scheduler,
|
97124
|
+
output_format: output_format,
|
97125
|
+
folder_path: ''
|
97126
|
+
};
|
97127
|
+
try {
|
97128
|
+
let url = this.textToImageUrl;
|
97129
|
+
const response = await fetch(url, {
|
97130
|
+
signal: this.signal,
|
97131
|
+
// Abort
|
97132
|
+
method: 'POST',
|
97133
|
+
headers: {
|
97134
|
+
'Content-Type': 'application/json'
|
97135
|
+
},
|
97136
|
+
body: JSON.stringify(messages)
|
97137
|
+
});
|
97138
|
+
const result = await response.json();
|
97139
|
+
if (result.error) {
|
97140
|
+
console.log('Error:\n' + result.error);
|
97141
|
+
return;
|
97142
|
+
}
|
97143
|
+
const imageUrl = result.url;
|
97144
|
+
callback([imageUrl]);
|
97145
|
+
} catch (error) {
|
97146
|
+
if (error.name === 'AbortError') ; else {
|
97147
|
+
// CORS or code errors goes here
|
97148
|
+
console.error('Error:', error);
|
97149
|
+
// console.log('Error:\n'+error);
|
97150
|
+
|
97151
|
+
this.dictation.finish(); // Must be called after finished
|
97152
|
+
}
|
97153
|
+
}
|
97154
|
+
}
|
97155
|
+
|
97156
|
+
/* OpenAI
|
97157
|
+
// Requires:
|
97158
|
+
// generateImageUrl: '/generateimage',
|
97159
|
+
// uploadBase64Url:'/uploadbase64',
|
97160
|
+
async generateImage(prompt, num, callback) {
|
97161
|
+
if(!(this.generateImageUrl && this.uploadBase64Url)) return;
|
97162
|
+
this.controller = new AbortController(); // Create a new AbortController
|
97163
|
+
this.signal = this.controller.signal; // Get a new signal object
|
97164
|
+
const messages = { prompt, num };
|
97165
|
+
try {
|
97166
|
+
const response = await fetch(this.generateImageUrl, {
|
97167
|
+
signal: this.signal, // Abort
|
97168
|
+
method: 'POST',
|
97169
|
+
headers: {
|
97170
|
+
'Content-Type': 'application/json',
|
97171
|
+
},
|
97172
|
+
body: JSON.stringify(messages),
|
97173
|
+
});
|
97174
|
+
|
97175
|
+
const result = await response.json();
|
97176
|
+
|
97177
|
+
if(result.error) {
|
97178
|
+
console.log('Error:\n'+result.error);
|
97179
|
+
return;
|
97180
|
+
}
|
97181
|
+
|
97182
|
+
const filename = result.filename;
|
97183
|
+
|
97184
|
+
let images = [];
|
97185
|
+
|
97186
|
+
const numOfImages = result.data.data.length;
|
97187
|
+
|
97188
|
+
const imageList = result.data.data;
|
97189
|
+
imageList.forEach(item=>{
|
97190
|
+
const base64 = item.b64_json;
|
97191
|
+
const src = `data:image/jpeg;base64,${base64}`;
|
97192
|
+
|
97193
|
+
var newWidth = 1024;
|
97194
|
+
var newHeight = 1024;
|
97195
|
+
var img = new Image();
|
97196
|
+
img.src = src;
|
97197
|
+
img.onload = () => {
|
97198
|
+
|
97199
|
+
var canvas = document.createElement('canvas');
|
97200
|
+
canvas.width = newWidth;
|
97201
|
+
canvas.height = newHeight;
|
97202
|
+
|
97203
|
+
var ctx = canvas.getContext('2d');
|
97204
|
+
ctx.drawImage(img, 0, 0, newWidth, newHeight);
|
97205
|
+
var resizedBase64 = canvas.toDataURL('image/jpeg');
|
97206
|
+
|
97207
|
+
let image = resizedBase64;
|
97208
|
+
image = image.replace(/^data:image\/(png|jpeg);base64,/, '');
|
97209
|
+
|
97210
|
+
const reqBody = { image: image, filename: filename };
|
97211
|
+
fetch(this.uploadBase64Url, {
|
97212
|
+
method:'POST',
|
97213
|
+
body: JSON.stringify(reqBody),
|
97214
|
+
headers: {
|
97215
|
+
'Content-Type': 'application/json',
|
97216
|
+
}
|
97217
|
+
})
|
97218
|
+
.then(response=>response.json())
|
97219
|
+
.then(response=>{
|
97220
|
+
if(!response.error) {
|
97221
|
+
const uploadedImageUrl = response.url;
|
97222
|
+
images.push(uploadedImageUrl);
|
97223
|
+
if(images.length===numOfImages) {
|
97224
|
+
callback(images);
|
97225
|
+
}
|
97226
|
+
}
|
97227
|
+
});
|
97228
|
+
};
|
97229
|
+
|
97230
|
+
});
|
97231
|
+
} catch (error) {
|
97232
|
+
if (error.name === 'AbortError') {
|
97233
|
+
// Do Nothing
|
97234
|
+
// console.log('Request aborted by user.');
|
97235
|
+
} else {
|
97236
|
+
// CORS or code errors goes here
|
97237
|
+
console.error('Error:', error);
|
97238
|
+
// console.log('Error:\n'+error);
|
97239
|
+
this.dictation.finish(); // Must be called after finished
|
97240
|
+
}
|
97241
|
+
}
|
97242
|
+
}
|
97243
|
+
*/
|
97244
|
+
|
96955
97245
|
lightboxOpen(col) {
|
96956
97246
|
// Open Lightbox
|
96957
97247
|
if (this.useLightbox) {
|
@@ -111085,6 +111375,43 @@ ${blockContent}
|
|
111085
111375
|
});
|
111086
111376
|
};
|
111087
111377
|
|
111378
|
+
const sendImageCommand = async prompt => {
|
111379
|
+
let activeBox = this.builder.activeBox;
|
111380
|
+
|
111381
|
+
if (!activeBox) {
|
111382
|
+
this.builder.showMessage(out('Please select a box.'));
|
111383
|
+
this.dictation.finish(); // Must be called after finished
|
111384
|
+
|
111385
|
+
return;
|
111386
|
+
}
|
111387
|
+
|
111388
|
+
this.dictation.startSending(); // Shows sending status & Abort button
|
111389
|
+
|
111390
|
+
const displayImage = src => {
|
111391
|
+
this.builder.editor.saveForUndo();
|
111392
|
+
let elm = this.builder.editor.activeElement;
|
111393
|
+
|
111394
|
+
if (elm && elm.tagName) {
|
111395
|
+
const tagName = elm.tagName.toLowerCase();
|
111396
|
+
|
111397
|
+
if (tagName === 'img') {
|
111398
|
+
this.builder.editor.saveForUndo();
|
111399
|
+
elm.setAttribute('src', src); //Trigger Change event
|
111400
|
+
|
111401
|
+
this.builder.onChange();
|
111402
|
+
} else {
|
111403
|
+
this.builder.boxImage(src);
|
111404
|
+
}
|
111405
|
+
} else {
|
111406
|
+
this.builder.boxImage(src);
|
111407
|
+
}
|
111408
|
+
|
111409
|
+
this.dictation.finish();
|
111410
|
+
};
|
111411
|
+
|
111412
|
+
this.builder.editor.generateImage(prompt, displayImage);
|
111413
|
+
};
|
111414
|
+
|
111088
111415
|
const sendOtherCommand = async question => {
|
111089
111416
|
let systemCmd = '';
|
111090
111417
|
let context = 'You are a helpful assistant. You don\'t need to answer \'Sure!\' or \'Certainly\'. You will just provide direct answers without a prologue. No talk; just do.';
|
@@ -111964,6 +112291,11 @@ ${currentHtml}
|
|
111964
112291
|
|
111965
112292
|
if (!activeBox) {
|
111966
112293
|
this.builder.selectSection();
|
112294
|
+
}
|
112295
|
+
|
112296
|
+
if (this.builder.editor.assistantMode === 'image') {
|
112297
|
+
sendImageCommand(question);
|
112298
|
+
return;
|
111967
112299
|
} // Local Process
|
111968
112300
|
|
111969
112301
|
|
@@ -111980,7 +112312,13 @@ ${currentHtml}
|
|
111980
112312
|
};
|
111981
112313
|
|
111982
112314
|
this.dictation.opts.abort = () => {
|
111983
|
-
this.controller.abort();
|
112315
|
+
if (this.controller) this.controller.abort();
|
112316
|
+
|
112317
|
+
if (this.builder.editor.controller) {
|
112318
|
+
// Abort for image
|
112319
|
+
this.builder.editor.controller.abort();
|
112320
|
+
}
|
112321
|
+
|
111984
112322
|
this.dictation.finish(true); // Must be called after finished (true = do not clear command text)
|
111985
112323
|
};
|
111986
112324
|
}
|
@@ -115011,22 +115349,35 @@ class ContentBox {
|
|
115011
115349
|
otherSelectCaption: 'Select Document',
|
115012
115350
|
// otherSelectIcon: '<svg class="is-icon-flex"><use xlink:href="#ion-ios-folder-outline"></use></svg>',
|
115013
115351
|
otherSelectIcon: '<svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#icon-list-search"></use></svg>',
|
115014
|
-
imageSelectWidth: '
|
115352
|
+
imageSelectWidth: '80vw',
|
115015
115353
|
imageSelectHeight: '80vh',
|
115016
|
-
fileSelectWidth: '
|
115354
|
+
fileSelectWidth: '80vw',
|
115017
115355
|
fileSelectHeight: '80vh',
|
115018
|
-
videoSelectWidth: '
|
115356
|
+
videoSelectWidth: '80vw',
|
115019
115357
|
videoSelectHeight: '80vh',
|
115020
|
-
audioSelectWidth: '
|
115358
|
+
audioSelectWidth: '80vw',
|
115021
115359
|
audioSelectHeight: '80vh',
|
115022
|
-
mediaSelectWidth: '
|
115360
|
+
mediaSelectWidth: '80vw',
|
115023
115361
|
mediaSelectHeight: '80vh',
|
115362
|
+
otherSelectWidth: '80vw',
|
115363
|
+
otherSelectHeight: '80vh',
|
115364
|
+
imageSelectMaxWidth: '1600px',
|
115365
|
+
fileSelectMaxWidth: '1600px',
|
115366
|
+
videoSelectMaxWidth: '1600px',
|
115367
|
+
audioSelectMaxWidth: '1600px',
|
115368
|
+
mediaSelectMaxWidth: '1600px',
|
115369
|
+
otherSelectMaxWidth: '1600px',
|
115370
|
+
codeEditorWidth: '80vw',
|
115371
|
+
codeEditorHeight: '80vh',
|
115372
|
+
codeEditorMaxWidth: '1600px',
|
115373
|
+
blockCodeEditorWidth: '80vw',
|
115374
|
+
blockCodeEditorHeight: '45vh',
|
115375
|
+
blockCodeEditorMaxWidth: '960px',
|
115024
115376
|
assetRefresh: false,
|
115025
115377
|
slider: '',
|
115026
115378
|
navbar: false,
|
115027
115379
|
onRender: function () {},
|
115028
115380
|
onChange: function () {},
|
115029
|
-
onCoverImageSelectClick: null,
|
115030
115381
|
// onImageBrowseClick: function () { },
|
115031
115382
|
// onImageSettingClick: function () { },
|
115032
115383
|
// onImageSelectClick: function () { },
|
@@ -117423,6 +117774,19 @@ class ContentBox {
|
|
117423
117774
|
AIToolbar: true,
|
117424
117775
|
sendCommandUrl: '',
|
117425
117776
|
// http://localhost:8081/answer
|
117777
|
+
|
117778
|
+
/* To enable asset manager */
|
117779
|
+
// listFilesUrl: '',
|
117780
|
+
// listFoldersUrl: '',
|
117781
|
+
// deleteFilesUrl: '',
|
117782
|
+
// moveFilesUrl: '',
|
117783
|
+
// createFolderUrl: '',
|
117784
|
+
// uploadFilesUrl: '',
|
117785
|
+
// renameFileUrl: '',
|
117786
|
+
// getMmodelsUrl: '',
|
117787
|
+
// textToImageUrl: '', // To enable AI image generation
|
117788
|
+
// upscaleImageUrl: '',
|
117789
|
+
// controlNetUrl: '',
|
117426
117790
|
speechTranscribeUrl: '',
|
117427
117791
|
// http://localhost:8081
|
117428
117792
|
autoSendDelay: 4000,
|
@@ -117436,7 +117800,12 @@ class ContentBox {
|
|
117436
117800
|
useMediaRecorder: true,
|
117437
117801
|
// do not change
|
117438
117802
|
encoderPath: '',
|
117439
|
-
|
117803
|
+
commandPlaceholders: {
|
117804
|
+
general: 'Create a section containing a short article with ideas for outdoor activities.',
|
117805
|
+
ask_questions: 'Can you explain our galaxy in a beginner-friendly and interesting way?',
|
117806
|
+
edit_block: 'Align the headline to the center',
|
117807
|
+
generate_image: 'City view from the window, sunset, realistic photo'
|
117808
|
+
},
|
117440
117809
|
disclaimerAI: `The feature you're about to use utilizes AI in some of its processes.
|
117441
117810
|
It's important to understand that AI systems have limitations.
|
117442
117811
|
There may be instances where the results are not 100% accurate or may provide unexpected responses or information.
|
@@ -117674,9 +118043,15 @@ Add an image for each feature.`, 'Revise the headline, paragraph, and all the te
|
|
117674
118043
|
block: {
|
117675
118044
|
title: 'Edit Selected Block',
|
117676
118045
|
description: 'Specifically target the selected block for editing, providing more precise results.',
|
117677
|
-
list: ['Enhance the content by including introductory paragraphs after the title.', 'Add a space between the title and the button.', 'Increase the space between the title and the paragraph.', 'Apply a gradient text color from red to orange horizontally to the title.', 'Paraphrase the title.',
|
118046
|
+
list: ['Enhance the content by including introductory paragraphs after the title.', 'Add a space between the title and the button.', 'Increase the space between the title and the paragraph.', 'Apply a gradient text color from red to orange horizontally to the title.', // 'Paraphrase the title.',
|
118047
|
+
'Rewrite the headline with alternative ideas', 'Reduce the title font size.', // 'Align the text to the center.',
|
117678
118048
|
'Add a link on the text \'Download\' that directs to: https://example.com/download', 'Add a new block containing a Google map showing local cafes in the Perth city area.']
|
117679
118049
|
},
|
118050
|
+
image: {
|
118051
|
+
title: 'Image',
|
118052
|
+
description: 'Generate image for the selected image or background',
|
118053
|
+
list: ['A small, minimalist wood cabin, situated atop a hill, seen from a distance']
|
118054
|
+
},
|
117680
118055
|
selection: {
|
117681
118056
|
title: 'Selection & Layout',
|
117682
118057
|
list: ['Select the headline', // 'Select the paragraph',
|
@@ -117961,10 +118336,21 @@ Add an image for each feature.`, 'Revise the headline, paragraph, and all the te
|
|
117961
118336
|
enableShortCommands: this.settings.enableShortCommands,
|
117962
118337
|
shortCommandList: this.settings.shortCommandList,
|
117963
118338
|
commandInfo: this.settings.commandInfo,
|
117964
|
-
|
118339
|
+
commandPlaceholders: this.settings.commandPlaceholders,
|
117965
118340
|
similarityThreshold: this.settings.similarityThreshold,
|
117966
118341
|
useMediaRecorder: this.settings.useMediaRecorder,
|
117967
118342
|
encoderPath: this.settings.encoderPath,
|
118343
|
+
listFilesUrl: this.settings.listFilesUrl,
|
118344
|
+
listFoldersUrl: this.settings.listFoldersUrl,
|
118345
|
+
deleteFilesUrl: this.settings.deleteFilesUrl,
|
118346
|
+
moveFilesUrl: this.settings.moveFilesUrl,
|
118347
|
+
createFolderUrl: this.settings.createFolderUrl,
|
118348
|
+
uploadFilesUrl: this.settings.uploadFilesUrl,
|
118349
|
+
renameFileUrl: this.settings.renameFileUrl,
|
118350
|
+
getMmodelsUrl: this.settings.getMmodelsUrl,
|
118351
|
+
textToImageUrl: this.settings.textToImageUrl,
|
118352
|
+
upscaleImageUrl: this.settings.upscaleImageUrl,
|
118353
|
+
controlNetUrl: this.settings.controlNetUrl,
|
117968
118354
|
container: '.is-container',
|
117969
118355
|
page: '.is-wrapper',
|
117970
118356
|
deleteConfirm: this.settings.deleteConfirm,
|
@@ -118178,6 +118564,7 @@ Add an image for each feature.`, 'Revise the headline, paragraph, and all the te
|
|
118178
118564
|
videoSelect: this.settings.videoSelect,
|
118179
118565
|
audioSelect: this.settings.audioSelect,
|
118180
118566
|
mediaSelect: this.settings.mediaSelect,
|
118567
|
+
onAssetOpen: this.settings.onAssetOpen,
|
118181
118568
|
selectIcon: this.settings.selectIcon,
|
118182
118569
|
otherSelect: this.settings.otherSelect,
|
118183
118570
|
otherSelectCaption: this.settings.otherSelectCaption,
|
@@ -118192,6 +118579,20 @@ Add an image for each feature.`, 'Revise the headline, paragraph, and all the te
|
|
118192
118579
|
audioSelectHeight: this.settings.audioSelectHeight,
|
118193
118580
|
mediaSelectWidth: this.settings.mediaSelectWidth,
|
118194
118581
|
mediaSelectHeight: this.settings.mediaSelectHeight,
|
118582
|
+
otherSelectWidth: this.settings.otherSelectWidth,
|
118583
|
+
otherSelectHeight: this.settings.otherSelectHeight,
|
118584
|
+
imageSelectMaxWidth: this.settings.imageSelectMaxWidth,
|
118585
|
+
fileSelectMaxWidth: this.settings.fileSelectMaxWidth,
|
118586
|
+
videoSelectMaxWidth: this.settings.videoSelectMaxWidth,
|
118587
|
+
audioSelectMaxWidth: this.settings.audioSelectMaxWidth,
|
118588
|
+
mediaSelectMaxWidth: this.settings.mediaSelectMaxWidth,
|
118589
|
+
otherSelectMaxWidth: this.settings.otherSelectMaxWidth,
|
118590
|
+
codeEditorWidth: this.settings.codeEditorWidth,
|
118591
|
+
codeEditorHeight: this.settings.codeEditorHeight,
|
118592
|
+
codeEditorMaxWidth: this.settings.codeEditorMaxWidth,
|
118593
|
+
blockCodeEditorWidth: this.settings.blockCodeEditorWidth,
|
118594
|
+
blockCodeEditorHeight: this.settings.blockCodeEditorHeight,
|
118595
|
+
blockCodeEditorMaxWidth: this.settings.blockCodeEditorMaxWidth,
|
118195
118596
|
assetRefresh: this.settings.assetRefresh,
|
118196
118597
|
onContentClick: e => {
|
118197
118598
|
if (this.settings.onContentClick) this.settings.onContentClick(e);
|
@@ -118893,6 +119294,8 @@ Add an image for each feature.`, 'Revise the headline, paragraph, and all the te
|
|
118893
119294
|
|
118894
119295
|
if (this.timeline.modalTimeline.classList.contains('active')) this.timeline.clearSettings();
|
118895
119296
|
}
|
119297
|
+
|
119298
|
+
document.body.classList.remove('box-modal-open'); // Remove added 'box-modal-open' by Box Settings open
|
118896
119299
|
} //---
|
118897
119300
|
|
118898
119301
|
|
@@ -119268,7 +119671,7 @@ Add an image for each feature.`, 'Revise the headline, paragraph, and all the te
|
|
119268
119671
|
boxSetup(box) {
|
119269
119672
|
let tool = box.querySelector('.is-box-tool');
|
119270
119673
|
if (tool) tool.parentNode.removeChild(tool);
|
119271
|
-
dom.appendHtml(box, '<div class="is-box-tool" data-tool="1">' + '<div role="button" class="is-cover-upload" data-tooltip-top title="' + out('Background
|
119674
|
+
dom.appendHtml(box, '<div class="is-box-tool" data-tool="1">' + '<div role="button" class="is-cover-upload" data-tooltip-top title="' + out('Change Background') + '" data-title="' + out('Change Background') + '" target="target-upload-cover" method="post" action="' + this.coverImageHandler + '" enctype="multipart/form-data" style="position:relative;width:40px;height:40px;display:inline-block;float:left;background: rgb(90, 156, 38);background:rgb(78 170 57)">' + '<div style="width:40px;height:40px;overflow:hidden;">' + '<div style="position:absolute;width:100%;height:100%;"><svg class="is-icon-flex" style="position: absolute;top: 12px;left: 12px;fill:rgb(255,255,255);"><use xlink:href="#ion-image"></use></svg></div>' + '<input type="file" tabindex="-1" class="input-file-cover" name="fileCover" accept="image/*" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;"/>' + '</div>' + '<input tabindex="-1" class="input-custom-value" name="hidcustomval" type="hidden" value="" />' + '</div>' + '<button type="button" class="is-select-image" tabindex="-1" data-tooltip-top data-title="' + out('Select') + '" title="' + out('Select') + '" style="background:rgb(251 173 27)"><svg class="is-icon-flex" style="color:#fff;width:17px;height:17px;"><use style="color: #fff;" xlink:href="#icon-folder2"></use></svg></button>' + '<button type="button" class="is-box-edit" tabindex="-1" data-tooltip-top data-title="' + out('Box Settings') + '" title="' + out('Box Settings') + '"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>' + '<button type="button" class="is-module-edit" tabindex="-1" data-tooltip-top data-title="' + out('Module Settings') + '" title="' + out('Module Settings') + '" style="background:rgb(135 116 215)"><svg class="is-icon-flex"><use xlink:href="#ion-ios-gear"></use></svg></button>' + '</div>');
|
119272
119675
|
let info = box.querySelector('.is-box-info');
|
119273
119676
|
if (info) info.parentNode.removeChild(info);
|
119274
119677
|
|
@@ -119368,6 +119771,25 @@ Add an image for each feature.`, 'Revise the headline, paragraph, and all the te
|
|
119368
119771
|
this.editsection.close();
|
119369
119772
|
this.editbox.edit();
|
119370
119773
|
});
|
119774
|
+
const btnSelectImage = box.querySelector('.is-select-image');
|
119775
|
+
if (btnSelectImage) btnSelectImage.addEventListener('click', () => {
|
119776
|
+
this.editsection.close();
|
119777
|
+
let currentImageUrl;
|
119778
|
+
const activeBox = this.activeBox;
|
119779
|
+
let overlay = activeBox.querySelector('.is-overlay');
|
119780
|
+
const overlayBg = overlay.querySelector('.is-overlay-bg');
|
119781
|
+
if (overlayBg) if (overlayBg.style.backgroundImage) {
|
119782
|
+
if (overlayBg.style.backgroundImage.indexOf('url(') !== -1) {
|
119783
|
+
currentImageUrl = overlayBg.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
|
119784
|
+
}
|
119785
|
+
}
|
119786
|
+
this.editor.openImageSelect(src => {
|
119787
|
+
this.editor.saveForUndo();
|
119788
|
+
this.boxImage(src); //Trigger Change event
|
119789
|
+
|
119790
|
+
this.onChange();
|
119791
|
+
}, currentImageUrl);
|
119792
|
+
});
|
119371
119793
|
const btnModuleEdit = box.querySelector('.is-module-edit');
|
119372
119794
|
if (btnModuleEdit) btnModuleEdit.addEventListener('click', () => {
|
119373
119795
|
this.editbox.editModule();
|
@@ -120045,7 +120467,7 @@ Add an image for each feature.`, 'Revise the headline, paragraph, and all the te
|
|
120045
120467
|
newSection.classList.add('section-select');
|
120046
120468
|
this.activeSection = newSection; // Select
|
120047
120469
|
|
120048
|
-
this.positionTool(
|
120470
|
+
this.positionTool(box);
|
120049
120471
|
}
|
120050
120472
|
}
|
120051
120473
|
|
@@ -120256,6 +120678,8 @@ Add an image for each feature.`, 'Revise the headline, paragraph, and all the te
|
|
120256
120678
|
boxTool.style.transform = 'scale(' + 1 / zoom + ')';
|
120257
120679
|
boxTool.style.transformOrigin = 'center bottom'; // boxTool.style.marginTop = (-(boxTool.offsetHeight * 1/zoom)) + 'px';
|
120258
120680
|
|
120681
|
+
box.querySelector('.is-select-image').style.display = 'none';
|
120682
|
+
|
120259
120683
|
if (boxSlider) {
|
120260
120684
|
box.querySelector('.is-cover-upload').style.display = 'none';
|
120261
120685
|
box.querySelector('.is-box-edit').style.display = 'inline-block';
|
@@ -120274,12 +120698,31 @@ Add an image for each feature.`, 'Revise the headline, paragraph, and all the te
|
|
120274
120698
|
box.querySelector('.is-module-edit').style.display = 'inline-block';
|
120275
120699
|
boxTool.style.width = '120px';
|
120276
120700
|
boxTool.style.left = 'calc(50% - 60px)';
|
120701
|
+
|
120702
|
+
if (this.onImageSelectClick || this.imageselect) {
|
120703
|
+
boxTool.style.width = '160px';
|
120704
|
+
box.querySelector('.is-select-image').style.display = 'inline-block';
|
120705
|
+
boxTool.style.left = 'calc(50% - 80px)';
|
120706
|
+
}
|
120707
|
+
|
120708
|
+
if (box.querySelector('.is-overlay-content[data-module]').getAttribute('data-module') === 'video-bg') {
|
120709
|
+
box.querySelector('.is-cover-upload').style.display = 'none';
|
120710
|
+
box.querySelector('.is-select-image').style.display = 'none';
|
120711
|
+
boxTool.style.width = '80px';
|
120712
|
+
boxTool.style.left = 'calc(50% - 40px)';
|
120713
|
+
}
|
120277
120714
|
} else {
|
120278
120715
|
box.querySelector('.is-cover-upload').style.display = 'block';
|
120279
120716
|
box.querySelector('.is-box-edit').style.display = 'inline-block';
|
120280
120717
|
box.querySelector('.is-module-edit').style.display = 'none';
|
120281
120718
|
boxTool.style.width = '80px';
|
120282
120719
|
boxTool.style.left = 'calc(50% - 40px)';
|
120720
|
+
|
120721
|
+
if (this.onImageSelectClick || this.imageselect) {
|
120722
|
+
boxTool.style.width = '120px';
|
120723
|
+
box.querySelector('.is-select-image').style.display = 'inline-block';
|
120724
|
+
boxTool.style.left = 'calc(50% - 60px)';
|
120725
|
+
}
|
120283
120726
|
}
|
120284
120727
|
} // box info
|
120285
120728
|
|