@innovastudio/contentbox 1.2.10 → 1.2.13
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 +152 -46
- package/public/contentbox/contentbox.min.js +3 -3
- 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.13",
|
|
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.15",
|
|
44
44
|
"axios": "^0.21.4",
|
|
45
45
|
"cors": "^2.8.5",
|
|
46
46
|
"express": "^4.17.1",
|
|
@@ -1976,7 +1976,7 @@ class EditSection {
|
|
|
1976
1976
|
this.builder = builder;
|
|
1977
1977
|
const builderStuff = this.builder.builderStuff;
|
|
1978
1978
|
this.builderStuff = builderStuff;
|
|
1979
|
-
let html = '<div class="is-modal delsectionconfirm">' + '<div style="max-width: 400px;">' + '<p style="margin-bottom: 25px;text-align:center;">' + out('Are you sure you want to delete this section?') + '</p>' + '<button title="' + out('Delete') + '" class="input-ok classic">' + out('Delete') + '</button>' + '</div>' + '</div>' + '' + '<div class="is-modal editsection">' + '<div class="is-modal-content" style="max-width:313px;padding:0;">' + '<div class="is-modal-bar is-draggable">' + out('Section Settings') + '</div>' + '<div class="is-tabs clearfix" style="padding-top:37px;">' + '<a id="tabSectionGeneral" title="' + out('General') + '" href="" data-content="divSectionGeneral" class="active">' + out('General') + '</a>' + '<a id="tabSectionAnimation" title="' + out('Animation') + '" href="" data-content="divSectionAnimation">' + out('Animation') + '</a>' + '<a id="tabSectionScrollButton" title="' + out('Scroll') + '" href="" data-content="divSectionScrollButton">' + out('Scroll') + '</a>' + '</div>' + '<div id="divSectionGeneral" class="is-tab-content" style="display:flex;padding-top:0">' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Move Section') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Move Up') + '" class="cmd-section-up" style="">↑</button>' + '<button title="' + out('Move Down') + '" class="cmd-section-down">↓</button>' + '<button title="' + out('Move to Top') + '" class="cmd-section-top"><span style="transform:rotate(90deg);position:absolute;top:13px;left:15px;">⇤</span></button>' + '<button title="' + out('Move to Bottom') + '" class="cmd-section-bottom"><span style="transform:rotate(90deg);position:absolute;top:13px;left:15px;">⇥</span></button>' + '<button title="' + out('Duplicate') + '" class="cmd-section-duplicate" style="margin-left:20px;"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-copy-outline"></use></svg></button>' + '</div>' + '</div>' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Height') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Auto') + '" class="cmd-section-height" data-value="0">' + out('Auto') + '</button>' + '<button title="20%" class="cmd-section-height" data-value="20">20%</button>' + '<button title="25%" class="cmd-section-height" data-value="25">25%</button>' + '<button title="30%" class="cmd-section-height" data-value="30">30%</button>' + '<button title="40%" class="cmd-section-height" data-value="40">40%</button>' + '<button title="50%" class="cmd-section-height" data-value="50">50%</button>' + '</div>' + '<div style="display:flex">' + '<button title="60%" class="cmd-section-height" data-value="60" style="border-left:none;border-top:none;">60%</button>' + '<button title="70%" class="cmd-section-height" data-value="70" style="border-left:none;border-top:none;">70%</button>' + '<button title="75%" class="cmd-section-height" data-value="75" style="border-left:none;border-top:none;">75%</button>' + '<button title="80%" class="cmd-section-height" data-value="80" style="border-left:none;border-top:none;">80%</button>' + '<button title="90%" class="cmd-section-height" data-value="90" style="border-left:none;border-top:none;">90%</button>' + '<button title="100%" class="cmd-section-height" data-value="100" style="border-left:none;border-top:none;">100%</button>' + '</div>' + '</div>' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Spacing') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('xs') + '" class="cmd-box-spacing" data-value="default">' + out('xs') + '</button>' + '<button title="' + out('sm') + '" class="cmd-box-spacing" data-value="sm">' + out('sm') + '</button>' + '<button title="' + out('m') + '" class="cmd-box-spacing" data-value="m">' + out('m') + '</button>' + '<button title="' + out('lg') + '" class="cmd-box-spacing" data-value="lg">' + out('lg') + '</button>' + '<button title="' + out('Clear') + '" class="cmd-box-spacing" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '</div>' + '</div>' + '<div id="divSectionAnimation" class="is-tab-content" style="display:none;padding-top:0">' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Start') + ':</div>' + '<div style="display:flex;flex-flow:wrap;">' + '<button title="' + out('Slide Left') + '" class="cmd-section-anim-start" data-value="slide-left">' + out('Slide Left') + '</button>' + '<button title="' + out('Slide Right') + '" class="cmd-section-anim-start" data-value="slide-right">' + out('Slide Right') + '</button>' + '<button title="' + out('Zoom In') + '" class="cmd-section-anim-start" data-value="zoom-in">' + out('Zoom In') + '</button>' + // '<button title="' + out('Zoom Out') + '" class="cmd-section-anim-start" data-value="zoom-out">' + out('Zoom Out') + '</button>' +
|
|
1979
|
+
let html = '<div class="is-modal delsectionconfirm">' + '<div style="max-width: 400px;">' + '<p style="margin-bottom: 25px;text-align:center;">' + out('Are you sure you want to delete this section?') + '</p>' + '<button title="' + out('Delete') + '" class="input-ok classic">' + out('Delete') + '</button>' + '</div>' + '</div>' + '' + '<div class="is-modal editsection">' + '<div class="is-modal-content" style="max-width:313px;padding:0;">' + '<div class="is-modal-bar is-draggable">' + out('Section Settings') + '</div>' + '<div class="is-tabs clearfix" style="padding-top:37px;">' + '<a id="tabSectionGeneral" title="' + out('General') + '" href="" data-content="divSectionGeneral" class="active">' + out('General') + '</a>' + '<a id="tabSectionAnimation" title="' + out('Animation') + '" href="" data-content="divSectionAnimation">' + out('Animation') + '</a>' + '<a id="tabSectionScrollButton" title="' + out('Scroll') + '" href="" data-content="divSectionScrollButton">' + out('Scroll') + '</a>' + '</div>' + '<div id="divSectionGeneral" class="is-tab-content" style="display:flex;padding-top:0">' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Move Section') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Move Up') + '" class="cmd-section-up" style="">↑</button>' + '<button title="' + out('Move Down') + '" class="cmd-section-down">↓</button>' + '<button title="' + out('Move to Top') + '" class="cmd-section-top"><span style="transform:rotate(90deg);position:absolute;top:13px;left:15px;">⇤</span></button>' + '<button title="' + out('Move to Bottom') + '" class="cmd-section-bottom"><span style="transform:rotate(90deg);position:absolute;top:13px;left:15px;">⇥</span></button>' + '<button title="' + out('Duplicate') + '" class="cmd-section-duplicate" style="margin-left:20px;"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-copy-outline"></use></svg></button>' + '</div>' + '</div>' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Height') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Auto') + '" class="cmd-section-height" data-value="0">' + out('Auto') + '</button>' + '<button title="20%" class="cmd-section-height" data-value="20">20%</button>' + '<button title="25%" class="cmd-section-height" data-value="25">25%</button>' + '<button title="30%" class="cmd-section-height" data-value="30">30%</button>' + '<button title="40%" class="cmd-section-height" data-value="40">40%</button>' + '<button title="50%" class="cmd-section-height" data-value="50">50%</button>' + '</div>' + '<div style="display:flex">' + '<button title="60%" class="cmd-section-height" data-value="60" style="border-left:none;border-top:none;">60%</button>' + '<button title="70%" class="cmd-section-height" data-value="70" style="border-left:none;border-top:none;">70%</button>' + '<button title="75%" class="cmd-section-height" data-value="75" style="border-left:none;border-top:none;">75%</button>' + '<button title="80%" class="cmd-section-height" data-value="80" style="border-left:none;border-top:none;">80%</button>' + '<button title="90%" class="cmd-section-height" data-value="90" style="border-left:none;border-top:none;">90%</button>' + '<button title="100%" class="cmd-section-height" data-value="100" style="border-left:none;border-top:none;">100%</button>' + '</div>' + '</div>' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Spacing') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('xs') + '" class="cmd-box-spacing" data-value="default">' + out('xs') + '</button>' + '<button title="' + out('sm') + '" class="cmd-box-spacing" data-value="sm">' + out('sm') + '</button>' + '<button title="' + out('m') + '" class="cmd-box-spacing" data-value="m">' + out('m') + '</button>' + '<button title="' + out('lg') + '" class="cmd-box-spacing" data-value="lg">' + out('lg') + '</button>' + '<button title="' + out('Clear') + '" class="cmd-box-spacing" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '</div>' + '<div class="div-section-bgcolor" style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Background Color') + ':</div>' + '<div style="display:flex;">' + '<button title="' + out('Background Color') + '" class="input-section-bgcolor is-btn-color" style="margin-right:15px"></button>' + '<button title="' + out('Gradient') + '" class="input-section-gradient classic" data-value="+">' + out('Gradient') + '</button>' + '</div>' + '</div>' + '</div>' + '<div id="divSectionAnimation" class="is-tab-content" style="display:none;padding-top:0">' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Start') + ':</div>' + '<div style="display:flex;flex-flow:wrap;">' + '<button title="' + out('Slide Left') + '" class="cmd-section-anim-start" data-value="slide-left">' + out('Slide Left') + '</button>' + '<button title="' + out('Slide Right') + '" class="cmd-section-anim-start" data-value="slide-right">' + out('Slide Right') + '</button>' + '<button title="' + out('Zoom In') + '" class="cmd-section-anim-start" data-value="zoom-in">' + out('Zoom In') + '</button>' + // '<button title="' + out('Zoom Out') + '" class="cmd-section-anim-start" data-value="zoom-out">' + out('Zoom Out') + '</button>' +
|
|
1980
1980
|
'<button title="' + out('Clear') + '" class="cmd-section-anim-start" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '</div>' + '<div style="display:flex;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('End') + ':</div>' + '<div style="display:flex;flex-flow:wrap;">' + '<button title="' + out('Slide Left') + '" class="cmd-section-anim-end" data-value="slide-left">' + out('Slide Left') + '</button>' + '<button title="' + out('Slide Right') + '" class="cmd-section-anim-end" data-value="slide-right">' + out('Slide Right') + '</button>' + '<button title="' + out('Slide Back') + '" class="cmd-section-anim-end" data-value="slide-back">' + out('Slide Back') + '</button>' + '<button title="' + out('Overlap') + '" class="cmd-section-anim-end" data-value="overlap">' + out('Overlap') + '</button>' + '<button title="' + out('Zoom In') + '" class="cmd-section-anim-end" data-value="zoom-in">' + out('Zoom In') + '</button>' + '<button title="' + out('Zoom Out') + '" class="cmd-section-anim-end" data-value="zoom-out">' + out('Zoom Out') + '</button>' + '<button title="' + out('Clear') + '" class="cmd-section-anim-end" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '</div>' + '</div>' + '<div id="divSectionScrollButton" class="is-tab-content" style="display:none;padding-top:0">' + '<div style="display:none;flex-direction:column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + '<label for="chkScrollIcon" style="margin:0;"><input id="chkScrollIcon" type="checkbox" /> ' + out('Scroll Icon') + '</label>' + '</div>' + '<div style="display:flex;padding-top:10px;">' + '<button title="' + out('Light') + '" class="cmd-section-scroll" data-value="light" style="min-width:80px;">' + out('Light') + '</button>' + '<button title="' + out('Dark') + '" class="cmd-section-scroll" data-value="dark" style="border-left:none;min-width:80px;">' + out('Dark') + '</button>' + '</div>' + '</div>' + '<div style="display:flex;flex-direction:column;padding-bottom:3px;">' + '<div style="padding-top:20px;padding-bottom:3px;">' + out('Scroll Button') + ':</div>' + '<div style="display:flex;flex-flow:wrap;">' + '<button class="cmd-scroll-preset" data-value="1" title="' + out('Apply') + '" type="button">1</button>' + '<button class="cmd-scroll-preset" data-value="2" title="' + out('Apply') + '" type="button">2</button>' + '<button class="cmd-scroll-preset" data-value="3" title="' + out('Apply') + '" type="button">3</button>' + '<button class="cmd-scroll-preset" data-value="4" title="' + out('Apply') + '" type="button">4</button>' + '<button class="cmd-scroll-preset" data-value="5" title="' + out('Apply') + '" type="button">5</button>' + '<button class="cmd-scroll-preset" data-value="6" title="' + out('Apply') + '" type="button">6</button>' + '<button class="cmd-scroll-preset" data-value="7" title="' + out('Apply') + '" type="button">7</button>' + '<button class="cmd-scroll-preset" data-value="8" title="' + out('Apply') + '" type="button">8</button>' + '<button class="cmd-scroll-preset" data-value="9" title="' + out('Apply') + '" type="button">9</button>' + '<button class="cmd-scroll-preset" data-value="10" title="' + out('Apply') + '" type="button">10</button>' + '<button class="cmd-scroll-preset" data-value="11" title="' + out('Apply') + '" type="button">11</button>' + '<button class="cmd-scroll-preset" data-value="12" title="' + out('Apply') + '" type="button">12</button>' + '<button class="cmd-scroll-preset" data-value="13" title="' + out('Apply') + '" type="button">13</button>' + '<button class="cmd-scroll-preset" data-value="14" title="' + out('Apply') + '" type="button">14</button>' + '<button class="cmd-scroll-preset" data-value="" title="' + out('Remove') + '" type="button"><svg class="is-icon-flex" style="flex:none;width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '</div>' + '</div>' + '</div>' + '</div>' + '' + '<div class="is-modal editmodule">' + '<div style="max-width:900px;height:570px;padding:0;box-sizing:border-box;position:relative;">' + '<div class="is-modal-bar is-draggable" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;">' + out('Module Settings') + '</div>' + '<iframe style="position: absolute;top: 0;left: 0;width:100%;height:100%;border:none;border-bottom:60px solid transparent;border-top:40px solid transparent;margin:0;box-sizing:border-box;" src="about:blank"></iframe>' + '<input id="hidModuleCode" type="hidden" />' + '<input id="hidModuleSettings" type="hidden" />' + '<button class="input-ok classic" style="height:60px;position:absolute;left:0;bottom:0;">' + out('Ok') + '</button>' + '</div>' + '</div>' + '' + '<div class="is-modal editcustomcode">' + '<div style="max-width:900px;height:570px;padding:0;box-sizing:border-box;position:relative;">' + '<div class="is-modal-bar is-draggable" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;">' + out('Custom Code (Javascript Allowed)') + '</div>' + '<textarea id="txtBoxCustomCode" class="inptxt" style="background: #fff;position: absolute;top: 0;left: 0;width:100%;height:100%;border:none;border-bottom:60px solid transparent;border-top:40px solid transparent;box-sizing:border-box;"></textarea>' + '<input id="hidBoxCustomCode" type="hidden" />' + '<button class="cell-html-larger" style="width:35px;height:35px;position:absolute;right:0;top:0;background:transparent;z-index:2;"><svg class="is-icon-flex" style="width:19px;height:19px;fill:rgb(170, 170, 170);"><use xlink:href="#ion-arrow-expand"></use></svg></button>' + '<button class="input-ok classic" style="height:60px;position:absolute;left:0;bottom:0;">' + out('Ok') + '</button>' + '</div>' + '</div>' + '';
|
|
1981
1981
|
dom$L.appendHtml(builderStuff, html);
|
|
1982
1982
|
let modalEditSection = builderStuff.querySelector('.is-modal.editsection');
|
|
@@ -2173,6 +2173,30 @@ class EditSection {
|
|
|
2173
2173
|
|
|
2174
2174
|
this.builder.settings.onChange();
|
|
2175
2175
|
});
|
|
2176
|
+
const colorpicker = this.builder.editor.colorpicker(); // Section Background Color
|
|
2177
|
+
|
|
2178
|
+
const btnSectionBgColor = modalEditSection.querySelector('.input-section-bgcolor');
|
|
2179
|
+
btnSectionBgColor.addEventListener('click', () => {
|
|
2180
|
+
this.builder.editor.saveForUndo(true); // checkLater = true
|
|
2181
|
+
|
|
2182
|
+
const section = this.builder.activeSection;
|
|
2183
|
+
let bgcolor = btnSectionBgColor.style.backgroundColor;
|
|
2184
|
+
colorpicker.open(s => {
|
|
2185
|
+
section.style.backgroundColor = s;
|
|
2186
|
+
section.style.backgroundImage = ''; //remove gradient
|
|
2187
|
+
|
|
2188
|
+
btnSectionBgColor.style.backgroundColor = s; // preview
|
|
2189
|
+
}, bgcolor);
|
|
2190
|
+
}); // Section Background Gradient
|
|
2191
|
+
|
|
2192
|
+
let btnSectionGradient = modalEditSection.querySelector('.input-section-gradient');
|
|
2193
|
+
btnSectionGradient.addEventListener('click', () => {
|
|
2194
|
+
this.builder.editor.saveForUndo(true); // checkLater = true
|
|
2195
|
+
|
|
2196
|
+
const section = this.builder.activeSection;
|
|
2197
|
+
let gradientPicker = this.builder.editor.gradientpicker();
|
|
2198
|
+
gradientPicker.open(section);
|
|
2199
|
+
});
|
|
2176
2200
|
}
|
|
2177
2201
|
|
|
2178
2202
|
edit() {
|
|
@@ -2232,12 +2256,16 @@ class EditSection {
|
|
|
2232
2256
|
}
|
|
2233
2257
|
|
|
2234
2258
|
btns = modalEditSection.querySelectorAll('.cmd-box-spacing');
|
|
2259
|
+
const divSectionBgColor = this.modalEditSection.querySelector('.div-section-bgcolor');
|
|
2235
2260
|
btns.forEach(btn => {
|
|
2236
2261
|
dom$L.removeClass(btn, 'on');
|
|
2237
2262
|
});
|
|
2238
2263
|
|
|
2239
2264
|
if (dom$L.hasClass(activeSection, 'box-space')) {
|
|
2240
2265
|
if (dom$L.hasClass(activeSection, 'box-space-sm')) dom$L.addClass(modalEditSection.querySelector('.cmd-box-spacing[data-value="sm"]'), 'on');else if (dom$L.hasClass(activeSection, 'box-space-m')) dom$L.addClass(modalEditSection.querySelector('.cmd-box-spacing[data-value="m"]'), 'on');else if (dom$L.hasClass(activeSection, 'box-space-lg')) dom$L.addClass(modalEditSection.querySelector('.cmd-box-spacing[data-value="lg"]'), 'on');else dom$L.addClass(modalEditSection.querySelector('.cmd-box-spacing[data-value="default"]'), 'on');
|
|
2266
|
+
divSectionBgColor.style.display = 'flex';
|
|
2267
|
+
} else {
|
|
2268
|
+
divSectionBgColor.style.display = 'none';
|
|
2241
2269
|
}
|
|
2242
2270
|
|
|
2243
2271
|
btns = modalEditSection.querySelectorAll('.cmd-scroll-preset');
|
|
@@ -2253,6 +2281,16 @@ class EditSection {
|
|
|
2253
2281
|
let btn = modalEditSection.querySelector(`.cmd-scroll-preset[data-value="${preset}"]`);
|
|
2254
2282
|
dom$L.addClass(btn, 'on');
|
|
2255
2283
|
}
|
|
2284
|
+
} // Background color
|
|
2285
|
+
|
|
2286
|
+
|
|
2287
|
+
let btnSectionBgColor = modalEditSection.querySelector('.input-section-bgcolor');
|
|
2288
|
+
let bgcolor = activeSection.style.backgroundColor;
|
|
2289
|
+
|
|
2290
|
+
if (bgcolor) {
|
|
2291
|
+
btnSectionBgColor.style.backgroundColor = bgcolor; //preview
|
|
2292
|
+
} else {
|
|
2293
|
+
btnSectionBgColor.style.backgroundColor = '';
|
|
2256
2294
|
} // this.builder.scrollTo(activeSection);
|
|
2257
2295
|
|
|
2258
2296
|
}
|
|
@@ -2478,14 +2516,17 @@ class EditSection {
|
|
|
2478
2516
|
|
|
2479
2517
|
boxSpacing(s) {
|
|
2480
2518
|
const activeSection = this.builder.activeSection;
|
|
2519
|
+
const divSectionBgColor = this.modalEditSection.querySelector('.div-section-bgcolor');
|
|
2481
2520
|
|
|
2482
2521
|
if (s == '') {
|
|
2483
2522
|
dom$L.removeClass(activeSection, 'box-space');
|
|
2484
2523
|
dom$L.removeClass(activeSection, 'box-space-sm');
|
|
2485
2524
|
dom$L.removeClass(activeSection, 'box-space-m');
|
|
2486
2525
|
dom$L.removeClass(activeSection, 'box-space-lg');
|
|
2526
|
+
divSectionBgColor.style.display = 'none';
|
|
2487
2527
|
} else {
|
|
2488
2528
|
dom$L.addClass(activeSection, 'box-space');
|
|
2529
|
+
divSectionBgColor.style.display = 'flex';
|
|
2489
2530
|
}
|
|
2490
2531
|
|
|
2491
2532
|
if (s === 'sm') {
|
|
@@ -9688,33 +9729,47 @@ class EditBox {
|
|
|
9688
9729
|
overlay = activeBox.querySelector('.is-overlay');
|
|
9689
9730
|
} // Gradient Color
|
|
9690
9731
|
|
|
9691
|
-
|
|
9732
|
+
/*
|
|
9692
9733
|
const s = activeBox.style.backgroundImage;
|
|
9693
|
-
if
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
}
|
|
9734
|
+
if(s) if(s.indexOf('linear-gradient')!==-1){
|
|
9735
|
+
// Fix
|
|
9736
|
+
overlay.style.backgroundImage = s;
|
|
9737
|
+
activeBox.style.backgroundImage = '';
|
|
9738
|
+
}
|
|
9739
|
+
*/
|
|
9740
|
+
// Background color
|
|
9741
|
+
|
|
9698
9742
|
|
|
9699
9743
|
let btnBoxBgColor = modalEditBox.querySelector('.input-box-bgcolor');
|
|
9744
|
+
/*
|
|
9700
9745
|
let bgcolor = activeBox.style.backgroundColor;
|
|
9746
|
+
if(bgcolor){
|
|
9747
|
+
// Fix
|
|
9748
|
+
overlay.style.backgroundColor = bgcolor;
|
|
9749
|
+
activeBox.style.backgroundColor = '';
|
|
9750
|
+
btnBoxBgColor.style.backgroundColor = bgcolor; //preview
|
|
9751
|
+
} else {
|
|
9752
|
+
bgcolor = overlay.style.backgroundColor;
|
|
9753
|
+
if(bgcolor) {
|
|
9754
|
+
btnBoxBgColor.style.backgroundColor = bgcolor; //preview
|
|
9755
|
+
} else {
|
|
9756
|
+
//backward
|
|
9757
|
+
bgcolor = window.getComputedStyle(activeBox, null).getPropertyValue('background-color');
|
|
9758
|
+
if(bgcolor==='rgba(0, 0, 0, 0)')bgcolor='';
|
|
9759
|
+
btnBoxBgColor.style.backgroundColor = bgcolor; //preview
|
|
9760
|
+
}
|
|
9761
|
+
}
|
|
9762
|
+
*/
|
|
9763
|
+
|
|
9764
|
+
let bgcolor = overlay.style.backgroundColor;
|
|
9701
9765
|
|
|
9702
9766
|
if (bgcolor) {
|
|
9703
|
-
// Fix
|
|
9704
|
-
overlay.style.backgroundColor = bgcolor;
|
|
9705
|
-
activeBox.style.backgroundColor = '';
|
|
9706
9767
|
btnBoxBgColor.style.backgroundColor = bgcolor; //preview
|
|
9707
9768
|
} else {
|
|
9708
|
-
|
|
9709
|
-
|
|
9710
|
-
if (bgcolor)
|
|
9711
|
-
|
|
9712
|
-
} else {
|
|
9713
|
-
//backward
|
|
9714
|
-
bgcolor = window.getComputedStyle(activeBox, null).getPropertyValue('background-color');
|
|
9715
|
-
if (bgcolor === 'rgba(0, 0, 0, 0)') bgcolor = '';
|
|
9716
|
-
btnBoxBgColor.style.backgroundColor = bgcolor; //preview
|
|
9717
|
-
}
|
|
9769
|
+
//backward
|
|
9770
|
+
bgcolor = window.getComputedStyle(activeBox, null).getPropertyValue('background-color');
|
|
9771
|
+
if (bgcolor === 'rgba(0, 0, 0, 0)') bgcolor = '';
|
|
9772
|
+
btnBoxBgColor.style.backgroundColor = bgcolor; //preview
|
|
9718
9773
|
}
|
|
9719
9774
|
|
|
9720
9775
|
const chkBoxAddText = modalEditBox.querySelector('.cmd-box-addtext');
|
|
@@ -57128,6 +57183,7 @@ class Image {
|
|
|
57128
57183
|
|
|
57129
57184
|
if (this.builder.opts.assetRefresh) {
|
|
57130
57185
|
iframe.src = this.builder.opts.imageselect;
|
|
57186
|
+
this.builder.opts.assetRefresh = false;
|
|
57131
57187
|
}
|
|
57132
57188
|
|
|
57133
57189
|
if (iframe.src === 'about:blank') {
|
|
@@ -57155,6 +57211,7 @@ class Image {
|
|
|
57155
57211
|
|
|
57156
57212
|
if (this.builder.opts.assetRefresh) {
|
|
57157
57213
|
iframe.src = this.builder.opts.imageselect;
|
|
57214
|
+
this.builder.opts.assetRefresh = false;
|
|
57158
57215
|
}
|
|
57159
57216
|
|
|
57160
57217
|
if (iframe.src === 'about:blank') {
|
|
@@ -57219,6 +57276,12 @@ class Image {
|
|
|
57219
57276
|
elm = imageTool.querySelector('.image-edit');
|
|
57220
57277
|
dom$A.addEventListener(elm, 'click', () => {
|
|
57221
57278
|
let img = this.builder.activeImage;
|
|
57279
|
+
|
|
57280
|
+
if (this.builder.onImageEditClick) {
|
|
57281
|
+
let result = this.builder.onImageEditClick(img);
|
|
57282
|
+
if (!result) return;
|
|
57283
|
+
}
|
|
57284
|
+
|
|
57222
57285
|
util.showModal(modalImageEdit, true);
|
|
57223
57286
|
let preview = modalImageEdit.querySelector('.imageedit-preview');
|
|
57224
57287
|
const maxW = 800;
|
|
@@ -57241,9 +57304,15 @@ class Image {
|
|
|
57241
57304
|
preview.innerHTML = '<img src="" style="max-width:100%;object-fit:contain;height:100%;"/>';
|
|
57242
57305
|
let imagePreview = modalImageEdit.querySelector('img');
|
|
57243
57306
|
imagePreview.src = img.src;
|
|
57244
|
-
|
|
57245
|
-
|
|
57246
|
-
|
|
57307
|
+
|
|
57308
|
+
if (this.builder.setCropperConfig) {
|
|
57309
|
+
this.cropper = new Cropper(imagePreview, this.builder.setCropperConfig);
|
|
57310
|
+
} else {
|
|
57311
|
+
this.cropper = new Cropper(imagePreview, {
|
|
57312
|
+
zoomable: false
|
|
57313
|
+
});
|
|
57314
|
+
}
|
|
57315
|
+
|
|
57247
57316
|
document.querySelector('.moveable-control-box').style.display = 'none'; //needed by Safari (prevent z-index problem)
|
|
57248
57317
|
}); // Set crop proportion
|
|
57249
57318
|
|
|
@@ -59281,6 +59350,7 @@ class Hyperlink {
|
|
|
59281
59350
|
|
|
59282
59351
|
if (this.builder.opts.assetRefresh) {
|
|
59283
59352
|
modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
|
|
59353
|
+
this.builder.opts.assetRefresh = false;
|
|
59284
59354
|
}
|
|
59285
59355
|
|
|
59286
59356
|
if (modalFileSelect.querySelector('iframe').src === 'about:blank') {
|
|
@@ -59377,6 +59447,7 @@ class Hyperlink {
|
|
|
59377
59447
|
|
|
59378
59448
|
if (this.builder.opts.assetRefresh) {
|
|
59379
59449
|
modalFileSelect.querySelector('iframe').src = this.builder.opts.fileselect;
|
|
59450
|
+
this.builder.opts.assetRefresh = false;
|
|
59380
59451
|
}
|
|
59381
59452
|
|
|
59382
59453
|
if (modalFileSelect.querySelector('iframe').src === 'about:blank') {
|
|
@@ -63877,6 +63948,11 @@ class ColumnTool {
|
|
|
63877
63948
|
let modalImageSelect = builderStuff.querySelector('.is-modal.imageselect');
|
|
63878
63949
|
let iframe = modalImageSelect.querySelector('iframe');
|
|
63879
63950
|
|
|
63951
|
+
if (this.builder.opts.assetRefresh) {
|
|
63952
|
+
iframe.src = this.builder.opts.imageselect;
|
|
63953
|
+
this.builder.opts.assetRefresh = false;
|
|
63954
|
+
}
|
|
63955
|
+
|
|
63880
63956
|
if (iframe.src === 'about:blank') {
|
|
63881
63957
|
iframe.src = this.builder.opts.imageselect;
|
|
63882
63958
|
}
|
|
@@ -64579,6 +64655,11 @@ class ColumnTool {
|
|
|
64579
64655
|
let modalFileSelect = builderStuff.querySelector('.is-modal.fileselect');
|
|
64580
64656
|
let iframe = modalFileSelect.querySelector('iframe');
|
|
64581
64657
|
|
|
64658
|
+
if (this.builder.opts.assetRefresh) {
|
|
64659
|
+
iframe.src = this.builder.opts.fileselect;
|
|
64660
|
+
this.builder.opts.assetRefresh = false;
|
|
64661
|
+
}
|
|
64662
|
+
|
|
64582
64663
|
if (iframe.src === 'about:blank') {
|
|
64583
64664
|
iframe.src = this.builder.opts.fileselect;
|
|
64584
64665
|
}
|
|
@@ -64595,6 +64676,11 @@ class ColumnTool {
|
|
|
64595
64676
|
let modalImageSelect = builderStuff.querySelector('.is-modal.imageselect');
|
|
64596
64677
|
let iframe = modalImageSelect.querySelector('iframe');
|
|
64597
64678
|
|
|
64679
|
+
if (this.builder.opts.assetRefresh) {
|
|
64680
|
+
iframe.src = this.builder.opts.imageselect;
|
|
64681
|
+
this.builder.opts.assetRefresh = false;
|
|
64682
|
+
}
|
|
64683
|
+
|
|
64598
64684
|
if (iframe.src === 'about:blank') {
|
|
64599
64685
|
iframe.src = this.builder.opts.imageselect;
|
|
64600
64686
|
}
|
|
@@ -72231,6 +72317,7 @@ class Rte {
|
|
|
72231
72317
|
|
|
72232
72318
|
if (this.builder.opts.assetRefresh) {
|
|
72233
72319
|
iframe.src = this.builder.opts.imageselect;
|
|
72320
|
+
this.builder.opts.assetRefresh = false;
|
|
72234
72321
|
}
|
|
72235
72322
|
|
|
72236
72323
|
if (iframe.src === 'about:blank') {
|
|
@@ -76571,13 +76658,29 @@ class ContentBuilder {
|
|
|
76571
76658
|
// onPluginsLoaded: function () { },
|
|
76572
76659
|
// onImageBrowseClick: function () { },
|
|
76573
76660
|
// onImageSettingClick: function () { },
|
|
76661
|
+
|
|
76662
|
+
/*
|
|
76663
|
+
// onImageEditClick: function () { }, // used in elementimage.js
|
|
76664
|
+
// Example:
|
|
76665
|
+
onImageEditClick: (activeImage)=>{
|
|
76666
|
+
activeImage.setAttribute('crossorigin', 'anonymous');
|
|
76667
|
+
const cropperConfig = {
|
|
76668
|
+
checkCrossOrigin:false,
|
|
76669
|
+
checkOrientation:false,
|
|
76670
|
+
crossOrigin:'anonymous'
|
|
76671
|
+
};
|
|
76672
|
+
builder.setCropperConfig = cropperConfig;
|
|
76673
|
+
return true;
|
|
76674
|
+
},
|
|
76675
|
+
*/
|
|
76676
|
+
// setCropperConfig: {}, // used in elementimage.js
|
|
76574
76677
|
imageEmbed: true,
|
|
76575
76678
|
imageselect: '',
|
|
76576
76679
|
fileselect: '',
|
|
76577
76680
|
imageSelect: '',
|
|
76578
76681
|
fileSelect: '',
|
|
76579
76682
|
videoSelect: '',
|
|
76580
|
-
assetRefresh:
|
|
76683
|
+
assetRefresh: false,
|
|
76581
76684
|
// asset manager specified in imageSelect, fileSelect & videoSelect will always refreshed on click/open
|
|
76582
76685
|
customTags: [],
|
|
76583
76686
|
buttons: ['bold', 'italic', 'underline', 'formatting', 'color', 'align', 'textsettings', 'createLink', 'tags', '|', 'undo', 'redo', 'zoom', 'more'],
|
|
@@ -77960,6 +78063,7 @@ class ContentBuilder {
|
|
|
77960
78063
|
formUpload.parentNode.parentNode.querySelector('input[type="file"]').value = '';
|
|
77961
78064
|
}
|
|
77962
78065
|
});
|
|
78066
|
+
this.opts.assetRefresh = true; // After file upload, make open asset refreshed
|
|
77963
78067
|
}
|
|
77964
78068
|
|
|
77965
78069
|
openImagePicker(currentUrl, callback) {
|
|
@@ -79414,35 +79518,35 @@ class ContentBuilder {
|
|
|
79414
79518
|
}
|
|
79415
79519
|
|
|
79416
79520
|
contentword.innerHTML = sPastedText;
|
|
79417
|
-
|
|
79418
|
-
|
|
79419
|
-
|
|
79420
|
-
|
|
79421
|
-
|
|
79422
|
-
|
|
79423
|
-
|
|
79424
|
-
|
|
79425
|
-
|
|
79426
|
-
|
|
79427
|
-
|
|
79428
|
-
|
|
79429
|
-
|
|
79430
|
-
|
|
79431
|
-
|
|
79432
|
-
|
|
79433
|
-
|
|
79434
|
-
|
|
79435
|
-
|
|
79436
|
-
|
|
79437
|
-
});
|
|
79521
|
+
/*
|
|
79522
|
+
// remove attributes
|
|
79523
|
+
if(this.opts.paste === 'html'){//with styles
|
|
79524
|
+
let elms = contentword.querySelectorAll('*');
|
|
79525
|
+
Array.prototype.forEach.call(elms, (elm) => {
|
|
79526
|
+
for(let n = 0;n<elm.attributes.length;n++) {
|
|
79527
|
+
if(elm.attributes[n].name!=='style') elm.removeAttribute(elm.attributes[n].name);
|
|
79528
|
+
}
|
|
79529
|
+
});
|
|
79530
|
+
} else { //html-without-styles (default)
|
|
79531
|
+
|
|
79532
|
+
const removeAttributes = (element) => {
|
|
79533
|
+
while (element.attributes.length > 0) {
|
|
79534
|
+
element.removeAttribute(element.attributes[0].name);
|
|
79535
|
+
}
|
|
79536
|
+
};
|
|
79537
|
+
let elms = contentword.querySelectorAll('*');
|
|
79538
|
+
Array.prototype.forEach.call(elms, (elm) => {
|
|
79539
|
+
removeAttributes(elm);
|
|
79540
|
+
});
|
|
79438
79541
|
}
|
|
79542
|
+
*/
|
|
79543
|
+
|
|
79439
79544
|
/*
|
|
79440
79545
|
Additional Cleanup:
|
|
79441
79546
|
- Remove p inside li
|
|
79442
79547
|
- Remove li with white-space: pre
|
|
79443
79548
|
*/
|
|
79444
79549
|
|
|
79445
|
-
|
|
79446
79550
|
let elms = contentword.querySelectorAll('li');
|
|
79447
79551
|
Array.prototype.forEach.call(elms, elm => {
|
|
79448
79552
|
elm.style.whiteSpace = '';
|
|
@@ -83435,6 +83539,8 @@ class ContentBox {
|
|
|
83435
83539
|
onVideoSelectClick: this.settings.onVideoSelectClick,
|
|
83436
83540
|
onImageBrowseClick: this.settings.onImageBrowseClick,
|
|
83437
83541
|
onImageSettingClick: this.settings.onImageSettingClick,
|
|
83542
|
+
onImageEditClick: this.settings.onImageEditClick,
|
|
83543
|
+
setCropperConfig: this.settings.setCropperConfig,
|
|
83438
83544
|
onPluginsLoaded: this.settings.onPluginsLoaded,
|
|
83439
83545
|
imageselect: this.settings.imageselect,
|
|
83440
83546
|
fileselect: this.settings.fileselect,
|