@innovastudio/contentbox 1.4.24 → 1.4.25
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.
@@ -3671,10 +3671,10 @@ class EditSection {
|
|
3671
3671
|
let html = '<div class="is-modal delsectionconfirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<div style="max-width: 450px;">' + '<div style="margin: 20px 0 30px;text-align:center;font-size: 14px;">' + out('Are you sure you want to delete this section?') + '</div>' + '<button title="' + out('Delete') + '" class="input-ok classic">' + out('Delete') + '</button>' + '</div>' + '</div>' + '' + '<div class="is-modal editsection" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<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;" data-group="sectionsettings">' + '<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>';
|
3672
3672
|
html += '<div id="divSectionGeneral" class="is-tab-content active" data-group="sectionsettings" 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>';
|
3673
3673
|
html += '<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('xxs') + '" class="cmd-box-spacing" data-value="xxs">' + out('xxs') + '</button>' + '<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>';
|
3674
|
-
html += '<div class="div-section-spacesettings" style="display:flex;flex-direction:column;">' + '<div class="div-multi-boxes">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Between Boxes') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('space') + '" class="cmd-betweenbox-spacing" data-value="space">' + out('space') + '</button>' + '<button title="' + out('no space') + '" class="cmd-betweenbox-spacing" data-value="no-space">' + out('no space') + '</button>' + '</div>' + '</div>' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Stack') + ':</div>' + '<div style="display:
|
3674
|
+
html += '<div class="div-section-spacesettings" style="display:flex;flex-direction:column;">' + '<div class="div-multi-boxes">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Between Boxes') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('space') + '" class="cmd-betweenbox-spacing" data-value="space">' + out('space') + '</button>' + '<button title="' + out('no space') + '" class="cmd-betweenbox-spacing" data-value="no-space">' + out('no space') + '</button>' + '</div>' + '</div>' + '<div style="display:none;padding-top:20px;padding-bottom: 3px;">' + out('Stack') + ':</div>' + '<div style="display:none">' + '<button title="' + out('top') + '" class="cmd-section-stack" data-value="top">' + out('top') + '</button>' + '<button title="' + out('middle') + '" class="cmd-section-stack" data-value="middle">' + out('middle') + '</button>' + '<button title="' + out('bottom') + '" class="cmd-section-stack" data-value="bottom">' + out('bottom') + '</button>' + '<button title="' + out('Clear') + '" class="cmd-section-stack" data-value=""><svg class="is-icon-flex"><use xlink:href="#icon-clean"></use></svg></button>' + '</div>' + '<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" data-group="sectionsettings" 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>' +
|
3675
3675
|
'<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>';
|
3676
3676
|
html += '<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" data-group="sectionsettings" 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>';
|
3677
|
-
html += '<div class="is-modal editmodule" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<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>' + '' + '';
|
3677
|
+
html += '<div class="is-modal editmodule" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<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;"><span>' + out('Module Settings') + '</span>' + '<button class="is-modal-close" tabindex="-1" title="' + out('Close') + '">' + '<svg class="is-icon-flex" style="width:30px;height:30px;"><use xlink:href="#ion-ios-close-empty"></use></svg>' + '</button>' + '</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>' + '' + '';
|
3678
3678
|
dom$k.appendHtml(builderStuff, html);
|
3679
3679
|
let modalEditSection = builderStuff.querySelector('.is-modal.editsection');
|
3680
3680
|
this.modalEditSection = modalEditSection;
|
@@ -3701,7 +3701,8 @@ class EditSection {
|
|
3701
3701
|
btnOk.addEventListener('click', () => {
|
3702
3702
|
const activeSection = this.builder.activeSection;
|
3703
3703
|
this.builder.editor.saveForUndo();
|
3704
|
-
activeSection.parentNode.removeChild(activeSection);
|
3704
|
+
activeSection.parentNode.removeChild(activeSection);
|
3705
|
+
this.builder.sectionStack(); //Trigger Render event
|
3705
3706
|
|
3706
3707
|
this.builder.settings.onRender();
|
3707
3708
|
this.builder.editor.util.hideModal(modalDelConfirm);
|
@@ -3719,35 +3720,40 @@ class EditSection {
|
|
3719
3720
|
const btnSectionUp = modalEditSection.querySelector('.cmd-section-up');
|
3720
3721
|
btnSectionUp.addEventListener('click', () => {
|
3721
3722
|
this.builder.editor.saveForUndo();
|
3722
|
-
this.sectionUp();
|
3723
|
+
this.sectionUp();
|
3724
|
+
this.builder.sectionStack(); //Trigger Change event
|
3723
3725
|
|
3724
3726
|
this.builder.settings.onChange();
|
3725
3727
|
});
|
3726
3728
|
const btnSectionDown = modalEditSection.querySelector('.cmd-section-down');
|
3727
3729
|
btnSectionDown.addEventListener('click', () => {
|
3728
3730
|
this.builder.editor.saveForUndo();
|
3729
|
-
this.sectionDown();
|
3731
|
+
this.sectionDown();
|
3732
|
+
this.builder.sectionStack(); //Trigger Change event
|
3730
3733
|
|
3731
3734
|
this.builder.settings.onChange();
|
3732
3735
|
});
|
3733
3736
|
const btnSectionTop = modalEditSection.querySelector('.cmd-section-top');
|
3734
3737
|
btnSectionTop.addEventListener('click', () => {
|
3735
3738
|
this.builder.editor.saveForUndo();
|
3736
|
-
this.sectionTop();
|
3739
|
+
this.sectionTop();
|
3740
|
+
this.builder.sectionStack(); //Trigger Change event
|
3737
3741
|
|
3738
3742
|
this.builder.settings.onChange();
|
3739
3743
|
});
|
3740
3744
|
const btnSectionBottom = modalEditSection.querySelector('.cmd-section-bottom');
|
3741
3745
|
btnSectionBottom.addEventListener('click', () => {
|
3742
3746
|
this.builder.editor.saveForUndo();
|
3743
|
-
this.sectionBottom();
|
3747
|
+
this.sectionBottom();
|
3748
|
+
this.builder.sectionStack(); //Trigger Change event
|
3744
3749
|
|
3745
3750
|
this.builder.settings.onChange();
|
3746
3751
|
});
|
3747
3752
|
const btnSectionDuplicate = modalEditSection.querySelector('.cmd-section-duplicate');
|
3748
3753
|
btnSectionDuplicate.addEventListener('click', () => {
|
3749
3754
|
this.builder.editor.saveForUndo();
|
3750
|
-
this.sectionDuplicate();
|
3755
|
+
this.sectionDuplicate();
|
3756
|
+
this.builder.sectionStack(); //Trigger Change event
|
3751
3757
|
|
3752
3758
|
this.builder.settings.onChange();
|
3753
3759
|
});
|
@@ -4413,6 +4419,8 @@ class EditSection {
|
|
4413
4419
|
dom$k.removeClass(activeSection, 'box-space-m');
|
4414
4420
|
dom$k.removeClass(activeSection, 'box-space-lg');
|
4415
4421
|
}
|
4422
|
+
|
4423
|
+
this.builder.sectionStack();
|
4416
4424
|
}
|
4417
4425
|
|
4418
4426
|
sectionUseScroll() {
|
@@ -10024,11 +10032,17 @@ class EditBox {
|
|
10024
10032
|
// '<button id="btnEditModule" tabindex="-1" data-tooltip-top data-title="' + out('Module Settings') + '" title="' + out('Module Settings') + '"><svg class="is-icon-flex"><use xlink:href="#ion-ios-gear"></use></svg></button>' +
|
10025
10033
|
// '</div>';
|
10026
10034
|
|
10035
|
+
html += `
|
10036
|
+
<form class="is-cover-upload-central" 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);">
|
10037
|
+
<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;"/>
|
10038
|
+
<input tabindex="-1" class="input-custom-value-central" name="hidcustomval" type="hidden" value="${this.builder.customval}" />
|
10039
|
+
</form>
|
10040
|
+
`;
|
10027
10041
|
html += '<iframe id="target-upload-cover" name="target-upload-cover" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>';
|
10028
|
-
html += '<div class="is-modal editcustomcode" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<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="input-ok classic" style="height:60px;position:absolute;left:0;bottom:0;">' + out('Ok') + '</button>' + '</div>' + '</div>' + '<div class="is-modal editbox" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<div class="is-modal-content" style="max-width:380px;min-height:300px;padding:0">' + '<div class="is-modal-bar is-draggable">' + out('Box Settings') + '</div>' + '<div class="is-tabs clearfix" style="padding-top:37px;" data-group="boxsettings">' + '<a id="tabBoxGeneral" href="" data-content="divBoxGeneral" class="active">' + out('General') + '</a>' + '<a id="tabBoxContentContainer" href="" data-content="divBoxContentContainer">' + out('Content') + '</a>' + '<a id="tabBoxContentText" href="" data-content="divBoxContentText">' + out('Text') + '</a>' + '<a id="tabBoxImage" href="" data-content="divBoxImage">' + out('Image') + '</a>' + '<a id="tabBoxAnimate" href="" data-content="divBoxAnimate">' + out('Animate') + '</a>' + '<a id="tabBoxClick" href="" data-content="divBoxClick">' + out('On Click') + '</a>' + '</div>' + '<div id="divBoxGeneral" class="is-tab-content active" data-group="boxsettings" style="display:flex;padding-top:0">' + '<div id="divBoxSize">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Box Size') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Decrease') + '" class="cmd-box-smaller" style="width:40px;">-</button>' + '<button title="' + out('Increase') + '" class="cmd-box-larger" style="width:40px;border-left:none">+</button>' + '<br style="clear:both">' + '</div>' + '</div>';
|
10042
|
+
html += '<div class="is-modal editcustomcode" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<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="input-ok classic" style="height:60px;position:absolute;left:0;bottom:0;">' + out('Ok') + '</button>' + '</div>' + '</div>' + '<div class="is-modal editbox" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">' + '<div class="is-modal-content" style="max-width:380px;min-height:300px;padding:0">' + '<div class="is-modal-bar is-draggable">' + out('Box Settings') + '</div>' + '<div class="is-tabs clearfix" style="padding-top:37px;" data-group="boxsettings">' + '<a id="tabBoxGeneral" href="" data-content="divBoxGeneral" class="active">' + out('General') + '</a>' + '<a id="tabBoxContentContainer" href="" data-content="divBoxContentContainer">' + out('Content') + '</a>' + '<a id="tabBoxContentText" href="" data-content="divBoxContentText">' + out('Text') + '</a>' + '<a id="tabBoxImage" href="" data-content="divBoxImage">' + out('Image') + '</a>' + '<a id="tabBoxAnimate" href="" data-content="divBoxAnimate">' + out('Animate') + '</a>' + '<a id="tabBoxClick" href="" data-content="divBoxClick">' + out('On Click') + '</a>' + '</div>' + '<div id="divBoxGeneral" class="is-tab-content active" data-group="boxsettings" style="display:flex;padding-top:0">' + '<div style="display:flex">' + '<div id="divBoxSize" style="margin-right: 50px;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Box Size') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Decrease') + '" class="cmd-box-smaller" style="width:40px;">-</button>' + '<button title="' + out('Increase') + '" class="cmd-box-larger" style="width:40px;border-left:none">+</button>' + '<br style="clear:both">' + '</div>' + '</div>' + '<div id="divBoxMove">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Move') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Left') + '" class="cmd-box-left" style="width:40px;">←</button>' + '<button title="' + out('Right') + '" class="cmd-box-right" style="width:40px;border-left:none">→</button>' + '<br style="clear:both">' + '</div>' + '</div>' + '</div>';
|
10029
10043
|
html += '<div id="divContentSize">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Content Size') + ': <span class="val-box-size" style="font-size:12px"></span></div>' + '<div style="display: flex;flex-direction: row;flex-wrap: wrap;">' + '<input class="inp-box-size" type="text" style="display:none;width:80px;height:35px;text-align:center;font-size:12px;" />' + '<button class="cmd-box-size" data-value="500" style="width:40px;border-left:none">500</button>' + '<button class="cmd-box-size" data-value="600" style="width:40px;border-left:none">600</button>' + '<button class="cmd-box-size" data-value="700" style="width:40px;border-left:none">700</button>' + '<button class="cmd-box-size" data-value="800" style="width:40px;border-top:none">800</button>' + '<button class="cmd-box-size" data-value="900" style="width:40px;border-top:none">900</button>' + '<button class="cmd-box-size" data-value="1000" style="width:40px;border-top:none;border-left:none">1000</button>' + '<button class="cmd-box-size" data-value="1100" style="width:40px;border-top:none;border-left:none">1100</button>' + '<button class="cmd-box-size" data-value="1200" style="width:40px;border-top:none;border-left:none">1200</button>' + '<button class="cmd-box-size" data-value="1300" style="width:40px;border-top:none;border-left:none">1300</button>' + '<button class="cmd-box-size" data-value="1400" style="width:40px;border-top:none;border-left:none">1400</button>' + '<button class="cmd-box-size" data-value="1500" style="width:40px;border-top:none;border-left:none">1500</button>' + '<button class="cmd-box-size" data-value="1600" style="width:40px;border-top:none;border-left:none">1600</button>' + '<button class="cmd-box-size" data-value="1800" style="width:40px;border-top:none;border-left:none">1800</button>' + '<button title="' + out('Clear') + '" class="cmd-box-size" data-value=""><svg class="is-icon-flex" style="width:10px;height:10px;"><use xlink:href="#icon-clean"></use></svg></button>' + '<button title="' + out('Decrease') + '" class="cmd-box-size" data-value="-" style="width:40px;border-top:none;border-left:none">-</button>' + '<button title="' + out('Increase') + '"class="cmd-box-size" data-value="+" style="width:40px;border-top:none;border-left:none">+</button>' + '<br style="clear:both">' + '</div>' + '</div>';
|
10030
|
-
html += '<div id="divBoxBackgroundColor">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Background Color') + ':</div>' + '<div style="display:flex;">' + '<button title="' + out('Background Color') + '" class="input-box-bgcolor is-btn-color" style="margin-right:15px"></button>' + '<button title="' + out('Gradient') + '" class="input-box-gradient classic" data-value="+">' + out('Gradient') + '</button>' + '</div>' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Background Image') + ':</div>' + '<div style="height:auto">' + '<div style="display:flex;align-items:flex-end;">' + '<div class="box-bgimage-preview"></div>' + '<label class="label-box-bgimage-grayscale label-checkbox" for="chkBoxBgImageGrayscale" style="margin:0;margin-left:8px;margin-bottom:5px;"><input id="chkBoxBgImageGrayscale" class="chk-box-bgimage-grayscale" type="checkbox" /> ' + out('Grayscale') + '</label>' + '</div>' + '<div style="display:flex;align-items: flex-end;">' + '<button title="' + out('Image') + '" class="input-box-bgimage">' + '<svg class="is-icon-flex"><use xlink:href="#ion-image"></use></svg>' + '<span>' + out('Image') + '</span>' + '</button>' + '<button title="' + out('Remove') + '" class="input-box-bgremove"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>' + '<button title="' + out('Adjust') + '" class="input-box-bgimageadjust"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>' + '</div>' + '</div>' + '</div>' + '<div id="divBoxPickPhoto" class="is-settings" style="padding-top:20px">' + '<button class="cmd-box-pickphoto" data-value="" style="width:100%"><svg class="is-icon-flex" style=""><use xlink:href="#ion-image"></use></svg></button>' + '</div>' + '<div style="display:flex;justify-content:flex-end;">' + '<button title="' + out('Add Text') + '" class="cmd-box-addtext" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#ion-android-add"></use></svg> <span>' + out('Text') + '</span></button>' + '<button title="' + out('Remove Text') + '" class="cmd-box-removetext" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg> <span>' + out('Clear') + '</span></button>' + '</div>' + '<p id="divNoBoxSettings" style="text-align: center;display:none;">' + out('This box has no available settings.') + '</p>' + '</div>';
|
10031
|
-
html += '<div id="divBoxClick" class="is-tab-content" data-group="boxsettings" style="padding-top:0">' + '<label for="inpBoxLinkSource" style="display:block;padding-top:20px;">' + out('Open') + ':</label>' + '<div class="image-src" style="display:flex">' + '<input id="inpBoxLinkSource" class="input-src" type="text" style="height:38px">' + '<button title="' + out('Select') + '" class="input-select" style="flex:none;width:40px;height:38px;background:transparent;"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>' + '<div class="image-larger5" style="position: relative; flex: 0 0 auto; width: 40px; height: 38px; box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;">' + '<form class="form-upload-larger" target="frameTargetBoxLinkUpload" method="post" action="' + this.builder.largerImageHandler + '" enctype="multipart/form-data" style="position:absolute;top:0;left:0;width:100%;height:100%;">' + '<input id="hidRefId5_box" name="hidRefId" type="hidden" value="">' + '<svg class="is-icon-flex" style="
|
10044
|
+
html += '<div id="divBoxBackgroundColor">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Background Color') + ':</div>' + '<div style="display:flex;">' + '<button title="' + out('Background Color') + '" class="input-box-bgcolor is-btn-color" style="margin-right:15px"></button>' + '<button title="' + out('Gradient') + '" class="input-box-gradient classic" data-value="+">' + out('Gradient') + '</button>' + '</div>' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Background Image') + ':</div>' + '<div style="height:auto">' + '<div style="display:flex;align-items:flex-end;">' + '<div class="box-bgimage-preview"></div>' + '<label class="label-box-bgimage-grayscale label-checkbox" for="chkBoxBgImageGrayscale" style="margin:0;margin-left:8px;margin-bottom:5px;"><input id="chkBoxBgImageGrayscale" class="chk-box-bgimage-grayscale" type="checkbox" /> ' + out('Grayscale') + '</label>' + '</div>' + '<div style="display:flex;align-items: flex-end;">' + '<button title="' + out('Image') + '" class="input-box-bgimage">' + '<svg class="is-icon-flex"><use xlink:href="#ion-image"></use></svg>' + '<span>' + out('Image') + '</span>' + '</button>' + '<button title="' + out('Select') + '" class="input-select">' + '<svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg>' + '</button>' + '<button title="' + out('Remove') + '" class="input-box-bgremove"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>' + '<button title="' + out('Adjust') + '" class="input-box-bgimageadjust"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>' + '</div>' + '</div>' + '</div>' + '<div id="divBoxPickPhoto" class="is-settings" style="padding-top:20px">' + '<button class="cmd-box-pickphoto" data-value="" style="width:100%"><svg class="is-icon-flex" style=""><use xlink:href="#ion-image"></use></svg></button>' + '</div>' + '<div style="display:flex;justify-content:flex-end;">' + '<button title="' + out('Add Text') + '" class="cmd-box-addtext" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#ion-android-add"></use></svg> <span>' + out('Text') + '</span></button>' + '<button title="' + out('Remove Text') + '" class="cmd-box-removetext" style="display:none;margin-top:20px;"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg> <span>' + out('Clear') + '</span></button>' + '</div>' + '<p id="divNoBoxSettings" style="text-align: center;display:none;">' + out('This box has no available settings.') + '</p>' + '</div>';
|
10045
|
+
html += '<div id="divBoxClick" class="is-tab-content" data-group="boxsettings" style="padding-top:0">' + '<label for="inpBoxLinkSource" style="display:block;padding-top:20px;">' + out('Open') + ':</label>' + '<div class="image-src" style="display:flex">' + '<input id="inpBoxLinkSource" class="input-src" type="text" style="height:38px">' + '<button title="' + out('Select') + '" class="input-select" style="flex:none;width:40px;height:38px;background:transparent;"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>' + '<div class="image-larger5" style="position: relative; flex: 0 0 auto; width: 40px; height: 38px; box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;">' + '<form class="form-upload-larger" target="frameTargetBoxLinkUpload" method="post" action="' + this.builder.largerImageHandler + '" enctype="multipart/form-data" style="position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;">' + '<input id="hidRefId5_box" name="hidRefId" type="hidden" value="">' + '<svg class="is-icon-flex" style="width:18px;height:18px;"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>' + '<input onclick="blur()" title="' + out('Select') + '" id="fileImage5" name="fileImage" type="file" accept="image/*,video/mp4" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;">' + '</form>' + '<iframe id="frameTargetBoxLinkUpload" tabindex="-1" name="frameTargetBoxLinkUpload" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>' + '</div>' + '</div>' + '<div style="padding-top:20px">' + '<button class="cmd-box-testclick">' + out('Test') + '</button>' + '</div>' + '</div>';
|
10032
10046
|
html += '<div id="divBoxContentText" class="is-tab-content" data-group="boxsettings" style="padding-top:0">' + '<div style="display:flex;flex-direction: column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Text Style') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Light') + '" class="cmd-box-textcolor" data-value="light">' + out('Light') + '</button>' + '<button title="' + out('Dark') + '" class="cmd-box-textcolor" data-value="dark" style="border-left:none;">' + out('Dark') + '</button>' + '<button title="' + out('Not Set') + '" class="cmd-box-textcolor" data-value="" style="border-left:none;">' + out('Not Set') + '</button>' + '</div>' + '</div>';
|
10033
10047
|
html += '<div id="divContainerTransparency" style="display:flex;flex-direction: column;">' + '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Transparency') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Increase') + '" class="cmd-box-textopacity" data-value="+" style="width:40px"> + </button>' + '<button title="' + out('Decrease') + '" class="cmd-box-textopacity" data-value="-" style="width:40px;border-left:none;"> - </button>' + '<button title="' + out('Not Set') + '" class="cmd-box-textopacity" data-value="" style="border-left:none;">' + out('Not Set') + '</button>' + '</div>' + '</div>' + '<div style="padding-top:27px;">' + out('Default Text Formatting') + ':</div>' + '<div id="divContainerTextAlign" style="display:flex;flex-direction: column;">' + '<div style="padding-top:15px;padding-bottom: 3px;">' + out('Alignment') + ':</div>' + '<div style="display:flex">' + '<button title="' + out('Align Left') + '" class="cmd-box-textalign" data-value="left" style="width:40px"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-left"></use></svg></button>' + '<button title="' + out('Align Center') + '" class="cmd-box-textalign" data-value="center" style="width:40px;border-left:none;"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-center"></use></svg></button>' + '<button title="' + out('Align Right') + '" class="cmd-box-textalign" data-value="right" style="width:40px;border-left:none;"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-right"></use></svg></button>' + '<button title="' + out('Align Full') + '" class="cmd-box-textalign" data-value="justify" style="width:40px;border-left:none;"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:13px;height:13px;"><use xlink:href="#icon-align-full"></use></svg></button>' + '<button title="' + out('Not Set') + '" class="cmd-box-textalign" data-value="" style="border-left:none;">' + out('Not Set') + '</button>' + '</div>' + '</div>' + '<div id="divContainerParagraphSize" style="display:flex;flex-direction: column;">' + '<div style="padding-top:15px;padding-bottom: 3px;">Paragraph Size:</div>' + '<div style="display:flex">' + '<button title="' + out('16') + '" class="cmd-box-parasize" data-value="16" style="width:40px">16</button>' + '<button title="' + out('17') + '" class="cmd-box-parasize" data-value="17" style="width:40px">17</button>' + '<button title="' + out('18') + '" class="cmd-box-parasize" data-value="18" style="width:40px">18</button>' + '<button title="' + out('19') + '" class="cmd-box-parasize" data-value="19" style="width:40px">19</button>' + '<button title="' + out('20') + '" class="cmd-box-parasize" data-value="20" style="width:40px">20</button>' + '<button title="' + out('21') + '" class="cmd-box-parasize" data-value="21" style="width:40px">21</button>' + '<button title="' + out('Not Set') + '" class="cmd-box-parasize" data-value="" style="">' + out('Not Set') + '</button>' + '</div>' + '</div>' + '<div style="padding-top:20px;">' + '<label for="chkOptimizeTextSize" style="margin:0;"><input id="chkOptimizeTextSize" type="checkbox" /> ' + out('Auto adjust text size on large screen.') + '</label>' + '</div>' + '<div id="divContainerLineHeight" style="display:flex;flex-direction: column;">' + '<div style="padding-top:15px;padding-bottom: 3px;">Line Height:</div>' + '<div style="display:flex;flex-flow: wrap;width: 290px;">' + '<button title="' + out('1') + '" class="cmd-box-lineheight" data-value="1" style="width:40px">1</button>' + '<button title="' + out('1.1') + '" class="cmd-box-lineheight" data-value="1.1" style="width:40px">1.1</button>' + '<button title="' + out('1.2') + '" class="cmd-box-lineheight" data-value="1.2" style="width:40px">1.2</button>' + '<button title="' + out('1.3') + '" class="cmd-box-lineheight" data-value="1.3" style="width:40px">1.3</button>' + '<button title="' + out('1.4') + '" class="cmd-box-lineheight" data-value="1.4" style="width:40px">1.4</button>' + '<button title="' + out('1.5') + '" class="cmd-box-lineheight" data-value="1.5" style="width:40px">1.5</button>' + '<button title="' + out('1.6') + '" class="cmd-box-lineheight" data-value="1.6" style="width:40px">1.6</button>' + '<button title="' + out('1.7') + '" class="cmd-box-lineheight" data-value="1.7" style="width:40px">1.7</button>' + '<button title="' + out('1.8') + '" class="cmd-box-lineheight" data-value="1.8" style="width:40px">1.8</button>' + '<button title="' + out('1.9') + '" class="cmd-box-lineheight" data-value="1.9" style="width:40px">1.9</button>' + '<button title="' + out('2') + '" class="cmd-box-lineheight" data-value="2" style="width:40px">2</button>' + '<button title="' + out('Not Set') + '" class="cmd-box-lineheight" data-value="" style="">' + out('Not Set') + '</button>' + '<br style="clear:both">' + '</div>' + '</div>';
|
10034
10048
|
html += (this.builder.settings.enableContentStyle ? '<div style="padding-top:10px;display:flex;flex-direction: column;">' + // '<div style="padding-top:20px;padding-bottom: 3px;">' + out('Typography') + ':</div>' +
|
@@ -10091,6 +10105,67 @@ class EditBox {
|
|
10091
10105
|
this.modalEditBox = modalEditBox;
|
10092
10106
|
const modalEditCode = builderStuff.querySelector('.is-modal.editcustomcode');
|
10093
10107
|
const modalEditModule = builderStuff.querySelector('.is-modal.editmodule');
|
10108
|
+
const divBoxClick = modalEditBox.querySelector('#divBoxClick');
|
10109
|
+
this.divBoxClick = divBoxClick;
|
10110
|
+
const divBoxGeneral = modalEditBox.querySelector('#divBoxGeneral');
|
10111
|
+
this.divBoxGeneral = divBoxGeneral; // ------ Box Cover Upload -------
|
10112
|
+
|
10113
|
+
let fileCover = builderStuff.querySelector('.input-file-cover-central');
|
10114
|
+
|
10115
|
+
if (this.builder.iframe) {
|
10116
|
+
fileCover = this.builder.contentStuff.querySelector('.input-file-cover-central');
|
10117
|
+
}
|
10118
|
+
|
10119
|
+
if (fileCover) fileCover.addEventListener('click', () => {
|
10120
|
+
this.targetBox = this.builder.activeBox;
|
10121
|
+
});
|
10122
|
+
if (fileCover) fileCover.addEventListener('change', e => {
|
10123
|
+
if (fileCover.value === '') return;
|
10124
|
+
this.builder.editor.saveForUndo(); // Show Waiting Indicator
|
10125
|
+
|
10126
|
+
const builderStuff = this.builderStuff;
|
10127
|
+
dom$j.appendHtml(builderStuff, `<div class="waiting-indicator-overlay"></div>
|
10128
|
+
<div class="waiting-indicator">
|
10129
|
+
<div>${out('Uploading..')}</div>
|
10130
|
+
</div>
|
10131
|
+
`);
|
10132
|
+
const indicator = builderStuff.querySelector('.waiting-indicator');
|
10133
|
+
let targetBox = this.targetBox;
|
10134
|
+
let top, left;
|
10135
|
+
|
10136
|
+
if (!this.builder.iframe) {
|
10137
|
+
top = targetBox.getBoundingClientRect().top + window.pageYOffset;
|
10138
|
+
left = targetBox.getBoundingClientRect().left + window.pageXOffset;
|
10139
|
+
indicator.style.top = top + 'px';
|
10140
|
+
indicator.style.left = left + 'px';
|
10141
|
+
} else {
|
10142
|
+
// let adjY = this.iframe.getBoundingClientRect().top + window.pageYOffset;
|
10143
|
+
// let adjX = this.iframe.getBoundingClientRect().left + window.pageXOffset;
|
10144
|
+
// top = targetBox.getBoundingClientRect().top + adjY;
|
10145
|
+
// left = targetBox.getBoundingClientRect().left + adjX;
|
10146
|
+
// indicator.style.top = top + 'px';
|
10147
|
+
// indicator.style.left = left + 'px';
|
10148
|
+
indicator.style.top = '0';
|
10149
|
+
indicator.style.left = 'calc(50% - 68px)';
|
10150
|
+
} // builderStuff.querySelector('.input-custom-value-central').value = this.builder.settings.customval;
|
10151
|
+
|
10152
|
+
|
10153
|
+
if (this.builder.settings.onUploadCoverImage) {
|
10154
|
+
this.builder.settings.onUploadCoverImage(e);
|
10155
|
+
} else {
|
10156
|
+
if (!this.builder.iframe) {
|
10157
|
+
builderStuff.querySelector('.is-cover-upload-central').submit();
|
10158
|
+
} else {
|
10159
|
+
this.builder.contentStuff.querySelector('.is-cover-upload-central').submit();
|
10160
|
+
}
|
10161
|
+
}
|
10162
|
+
|
10163
|
+
fileCover.value = ''; // Clear Input
|
10164
|
+
|
10165
|
+
e.preventDefault();
|
10166
|
+
e.stopImmediatePropagation();
|
10167
|
+
}); // /------ Box Cover Upload -------
|
10168
|
+
|
10094
10169
|
new Tabs$1(modalEditBox); // Backward compatibility
|
10095
10170
|
|
10096
10171
|
let s = '<div class="feature-master-style"></div>';
|
@@ -10138,6 +10213,44 @@ class EditBox {
|
|
10138
10213
|
|
10139
10214
|
this.builder.settings.onChange();
|
10140
10215
|
});
|
10216
|
+
const btnBoxLeft = modalEditBox.querySelector('.cmd-box-left');
|
10217
|
+
btnBoxLeft.addEventListener('click', () => {
|
10218
|
+
this.builder.editor.saveForUndo();
|
10219
|
+
let activeBox = this.builder.activeBox;
|
10220
|
+
let currPrev = activeBox.previousElementSibling;
|
10221
|
+
|
10222
|
+
if (currPrev) {
|
10223
|
+
while (!dom$j.hasClass(currPrev, 'is-box')) {
|
10224
|
+
if (!currPrev.previousElementSibling) break;
|
10225
|
+
currPrev = currPrev.previousElementSibling;
|
10226
|
+
}
|
10227
|
+
}
|
10228
|
+
|
10229
|
+
if (currPrev) {
|
10230
|
+
activeBox.parentNode.insertBefore(activeBox, currPrev); //Trigger Change event
|
10231
|
+
|
10232
|
+
this.builder.settings.onChange();
|
10233
|
+
}
|
10234
|
+
});
|
10235
|
+
const btnBoxRight = modalEditBox.querySelector('.cmd-box-right');
|
10236
|
+
btnBoxRight.addEventListener('click', () => {
|
10237
|
+
this.builder.editor.saveForUndo();
|
10238
|
+
let activeBox = this.builder.activeBox;
|
10239
|
+
let currNext = activeBox.nextElementSibling;
|
10240
|
+
|
10241
|
+
if (currNext) {
|
10242
|
+
while (!dom$j.hasClass(currNext, 'is-box')) {
|
10243
|
+
if (!currNext.nextElementSibling) break;
|
10244
|
+
currNext = currNext.previousElementSibling;
|
10245
|
+
}
|
10246
|
+
}
|
10247
|
+
|
10248
|
+
if (currNext) {
|
10249
|
+
activeBox.parentNode.insertBefore(currNext, activeBox); //Trigger Change event
|
10250
|
+
|
10251
|
+
this.builder.settings.onChange();
|
10252
|
+
}
|
10253
|
+
});
|
10141
10254
|
const btnBoxTextColors = modalEditBox.querySelectorAll('.cmd-box-textcolor');
|
10142
10255
|
btnBoxTextColors.forEach(btnBoxTextColor => {
|
10143
10256
|
btnBoxTextColor.addEventListener('click', () => {
|
@@ -11420,7 +11533,11 @@ class EditBox {
|
|
11420
11533
|
}
|
11421
11534
|
|
11422
11535
|
if (!onImageSelectClick && imageselect === '') {
|
11423
|
-
|
11536
|
+
this.divBoxClick.querySelector('.input-select').style.display = 'none';
|
11537
|
+
}
|
11538
|
+
|
11539
|
+
if (!onImageSelectClick && imageselect === '') {
|
11540
|
+
this.divBoxGeneral.querySelector('.input-select').style.display = 'none';
|
11424
11541
|
} // Select image (opens Asset Manager plugin or custom dialog)
|
11425
11542
|
|
11426
11543
|
|
@@ -11444,12 +11561,37 @@ class EditBox {
|
|
11444
11561
|
}
|
11445
11562
|
|
11446
11563
|
if (onImageSelectClick || imageselect || onFileSelectClick || fileselect) {
|
11447
|
-
const elm =
|
11564
|
+
const elm = this.divBoxClick.querySelector('.input-select');
|
11448
11565
|
if (elm) elm.addEventListener('click', () => {
|
11449
11566
|
this.builder.editor.openAsset(modalEditBox.querySelector('.input-src'), 'media', elm);
|
11450
11567
|
});
|
11451
11568
|
}
|
11452
11569
|
|
11570
|
+
if (onImageSelectClick || imageselect) {
|
11571
|
+
const btnSelectBoxBgImage = this.divBoxGeneral.querySelector('.input-select');
|
11572
|
+
this.builder.editor.renderSelectAsset(btnSelectBoxBgImage, 'image', url => {
|
11573
|
+
this.boxImage(url);
|
11574
|
+
const activeBox = this.builder.activeBox;
|
11575
|
+
const overlay = activeBox.querySelector('.is-overlay');
|
11576
|
+
const overlayBg = activeBox.querySelector('.is-overlay-bg'); // Reset position & filter (grayscale)
|
11577
|
+
|
11578
|
+
overlayBg.style.filter = '';
|
11579
|
+
overlay.style.filter = '';
|
11580
|
+
const chkBoxBgImageGrayscale = modalEditBox.querySelector('.chk-box-bgimage-grayscale');
|
11581
|
+
chkBoxBgImageGrayscale.checked = false;
|
11582
|
+
overlayBg.style.backgroundPosition = '50% 60%';
|
11583
|
+
overlayBg.removeAttribute('data-scale');
|
11584
|
+
overlayBg.removeAttribute('data-x');
|
11585
|
+
overlayBg.removeAttribute('data-y');
|
11586
|
+
overlayBg.style.top = '';
|
11587
|
+
overlayBg.style.bottom = '';
|
11588
|
+
overlayBg.style.left = '';
|
11589
|
+
overlayBg.style.right = '';
|
11590
|
+
overlayBg.style.width = '';
|
11591
|
+
overlayBg.style.height = ''; // /Reset
|
11592
|
+
});
|
11593
|
+
}
|
11594
|
+
|
11453
11595
|
let fileLargerImage = modalEditBox.querySelector('#fileImage5');
|
11454
11596
|
fileLargerImage.addEventListener('change', e => {
|
11455
11597
|
let element = fileLargerImage;
|
@@ -11707,8 +11849,10 @@ class EditBox {
|
|
11707
11849
|
|
11708
11850
|
if (dom$j.hasClass(activeBox, 'is-section')) {
|
11709
11851
|
modalEditBox.querySelector('#divBoxSize').style.display = 'none';
|
11852
|
+
modalEditBox.querySelector('#divBoxMove').style.display = 'none';
|
11710
11853
|
} else {
|
11711
11854
|
modalEditBox.querySelector('#divBoxSize').style.display = 'block';
|
11855
|
+
modalEditBox.querySelector('#divBoxMove').style.display = 'block';
|
11712
11856
|
}
|
11713
11857
|
|
11714
11858
|
modalEditBox.querySelector('#chkParallaxContent').checked = false;
|
@@ -12191,7 +12335,7 @@ class EditBox {
|
|
12191
12335
|
doc.open();
|
12192
12336
|
doc.write(result);
|
12193
12337
|
doc.close();
|
12194
|
-
this.builder.showModal(modalEditModule);
|
12338
|
+
this.builder.showModal(modalEditModule, true);
|
12195
12339
|
setTimeout(() => {
|
12196
12340
|
iframe.style.opacity = 1;
|
12197
12341
|
}, 200);
|
@@ -12199,9 +12343,9 @@ class EditBox {
|
|
12199
12343
|
const modalBar = modalEditModule.querySelector('.is-modal-bar');
|
12200
12344
|
|
12201
12345
|
if (moduleDesc) {
|
12202
|
-
modalBar.innerHTML = moduleDesc;
|
12346
|
+
modalBar.querySelector('span').innerHTML = out(moduleDesc);
|
12203
12347
|
} else {
|
12204
|
-
modalBar.innerHTML = out('Module Settings');
|
12348
|
+
modalBar.querySelector('span').innerHTML = out('Module Settings');
|
12205
12349
|
}
|
12206
12350
|
|
12207
12351
|
let w = activeModule.getAttribute('data-dialog-width');
|
@@ -12218,6 +12362,12 @@ class EditBox {
|
|
12218
12362
|
|
12219
12363
|
modalEditModule.childNodes.forEach(div => {
|
12220
12364
|
if (!dom$j.hasClass(div, 'is-modal-overlay')) {
|
12365
|
+
if (moduleName === 'slider-box') {
|
12366
|
+
div.style.width = '1600px';
|
12367
|
+
w = '90vw';
|
12368
|
+
h = '80vh';
|
12369
|
+
}
|
12370
|
+
|
12221
12371
|
div.style.maxWidth = w;
|
12222
12372
|
div.style.height = h;
|
12223
12373
|
}
|
@@ -28697,7 +28847,7 @@ class Snippets {
|
|
28697
28847
|
z-index:10;width:30px;height:30px;position:absolute;
|
28698
28848
|
top:2px;right:2px;box-sizing:border-box;padding:0;line-height:40px;font-size: 12px;text-align:center;cursor:pointer;
|
28699
28849
|
}
|
28700
|
-
.is-pop-close:focus {
|
28850
|
+
.is-pop-close:focus-visible {
|
28701
28851
|
outline: ${this.builder.styleOutlineColor} 2px solid;
|
28702
28852
|
}
|
28703
28853
|
|
@@ -28838,7 +28988,7 @@ class Snippets {
|
|
28838
28988
|
border-radius: 2px;
|
28839
28989
|
}
|
28840
28990
|
|
28841
|
-
.is-design-list>li:focus {
|
28991
|
+
.is-design-list>li:focus-visible {
|
28842
28992
|
outline: ${this.builder.styleOutlineColor} 2px solid;
|
28843
28993
|
}
|
28844
28994
|
|
@@ -28937,7 +29087,7 @@ class Snippets {
|
|
28937
29087
|
cursor: default;
|
28938
29088
|
}
|
28939
29089
|
|
28940
|
-
.is-category-list a:focus {
|
29090
|
+
.is-category-list a:focus-visible {
|
28941
29091
|
outline: ${this.builder.styleOutlineColor} 2px solid;
|
28942
29092
|
}
|
28943
29093
|
|
@@ -62241,10 +62391,10 @@ class Image$1 {
|
|
62241
62391
|
<form class="form-upload-larger" target="frameTargetImageUpload" method="post" action="${this.builder.opts.largerImageHandler}" enctype="multipart/form-data" style="border-radius:1px;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;">
|
62242
62392
|
<input id="hidRefId1" name="hidRefId" type="hidden" value="" />
|
62243
62393
|
<svg class="is-icon-flex" style="width:18px;height:18px;"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
|
62244
|
-
<input title="${util.out('Select')}" id="fileImage1" name="fileImage" type="file" accept="image/*" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;">
|
62394
|
+
<input onclick="blur()" title="${util.out('Select')}" id="fileImage1" name="fileImage" type="file" accept="image/*" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;">
|
62245
62395
|
</form>
|
62246
62396
|
|
62247
|
-
<iframe
|
62397
|
+
<iframe id="frameTargetImageUpload" name="frameTargetImageUpload" tabindex="-1" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>
|
62248
62398
|
</div>
|
62249
62399
|
</div>
|
62250
62400
|
|
@@ -62259,7 +62409,7 @@ class Image$1 {
|
|
62259
62409
|
<form class="form-upload-larger" target="frameTargetImageUpload" method="post" action="${this.builder.opts.largerImageHandler}" enctype="multipart/form-data" style="border-radius:1px;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;">
|
62260
62410
|
<input id="hidRefId2" name="hidRefId" type="hidden" value="" />
|
62261
62411
|
<svg class="is-icon-flex"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
|
62262
|
-
<input title="${util.out('Select')}" id="fileImage2" name="fileImage" type="file" accept="image/*" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;">
|
62412
|
+
<input onclick="blur()" title="${util.out('Select')}" id="fileImage2" name="fileImage" type="file" accept="image/*" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;">
|
62263
62413
|
</form>
|
62264
62414
|
</div>
|
62265
62415
|
</div>
|
@@ -65994,9 +66144,13 @@ class Module {
|
|
65994
66144
|
var moduleDesc = module.getAttribute('data-module-desc');
|
65995
66145
|
|
65996
66146
|
if (moduleDesc) {
|
65997
|
-
moduleModal.querySelector('.is-modal-bar').innerHTML = moduleDesc + `<button class="is-modal-close" tabindex="-1" title="${util.out('Close')}"
|
66147
|
+
moduleModal.querySelector('.is-modal-bar').innerHTML = moduleDesc + `<button class="is-modal-close" tabindex="-1" title="${util.out('Close')}">
|
66148
|
+
<svg class="is-icon-flex" style="width:30px;height:30px;"><use xlink:href="#ion-ios-close-empty"></use></svg>
|
66149
|
+
</button>`;
|
65998
66150
|
} else {
|
65999
|
-
moduleModal.querySelector('.is-modal-bar').innerHTML = this.util.out('Module Settings') + `<button class="is-modal-close" tabindex="-1" title="${util.out('Close')}"
|
66151
|
+
moduleModal.querySelector('.is-modal-bar').innerHTML = this.util.out('Module Settings') + `<button class="is-modal-close" tabindex="-1" title="${util.out('Close')}">
|
66152
|
+
<svg class="is-icon-flex" style="width:30px;height:30px;"><use xlink:href="#ion-ios-close-empty"></use></svg>
|
66153
|
+
</button>`;
|
66000
66154
|
}
|
66001
66155
|
|
66002
66156
|
var w = module.getAttribute('data-dialog-width');
|
@@ -66011,6 +66165,12 @@ class Module {
|
|
66011
66165
|
h = '570px';
|
66012
66166
|
}
|
66013
66167
|
|
66168
|
+
if (modulename === 'slider-builder') {
|
66169
|
+
moduleModal.querySelector('div:not(.is-modal-overlay)').style.width = '90vw';
|
66170
|
+
w = '1500px';
|
66171
|
+
h = '80vh';
|
66172
|
+
}
|
66173
|
+
|
66014
66174
|
moduleModal.querySelector('div:not(.is-modal-overlay)').style.maxWidth = w;
|
66015
66175
|
moduleModal.querySelector('div:not(.is-modal-overlay)').style.height = h;
|
66016
66176
|
let btnClose = moduleModal.querySelector('.is-modal-close');
|
@@ -67287,6 +67447,12 @@ class Video {
|
|
67287
67447
|
let elm = e.target;
|
67288
67448
|
|
67289
67449
|
if (elm.tagName.toLowerCase() === 'video') {
|
67450
|
+
if (elm.closest('[data-html]')) {
|
67451
|
+
this.builder.activeVideo = null;
|
67452
|
+
this.videoTool.style.display = '';
|
67453
|
+
return;
|
67454
|
+
}
|
67455
|
+
|
67290
67456
|
this.builder.activeVideo = elm;
|
67291
67457
|
this.videoTool.style.display = 'flex';
|
67292
67458
|
let _toolwidth = this.videoTool.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
|
@@ -67294,7 +67460,8 @@ class Video {
|
|
67294
67460
|
let w = elm.offsetWidth * this.builder.opts.zoom;
|
67295
67461
|
let top = elm.getBoundingClientRect().top + this.builder.win.pageYOffset;
|
67296
67462
|
let left = elm.getBoundingClientRect().left;
|
67297
|
-
left = left + (w - _toolwidth); //
|
67463
|
+
left = left + (w - _toolwidth); // left = left + (w/2 - _toolwidth/2);
|
67464
|
+
//Adjust left in case an element is outside the screen
|
67298
67465
|
|
67299
67466
|
const _screenwidth = window.innerWidth;
|
67300
67467
|
if (_toolwidth + left > _screenwidth) left = elm.getBoundingClientRect().left;
|
@@ -70019,6 +70186,7 @@ class ColumnTool {
|
|
70019
70186
|
<svg class="is-icon-flex"><use xlink:href="#ion-image"></use></svg>
|
70020
70187
|
<span>${util.out('Image')}</span>
|
70021
70188
|
</button>
|
70189
|
+
<button title="${util.out('Select')}" class="input-select"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
|
70022
70190
|
<button title="${util.out('Remove')}" class="input-cell-bgremove"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>
|
70023
70191
|
<button title="${util.out('Adjust')}" class="input-cell-bgimageadjust"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>
|
70024
70192
|
</div>
|
@@ -70153,11 +70321,11 @@ class ColumnTool {
|
|
70153
70321
|
<div class="image-larger4" style="position: relative; flex: 0 0 auto; width: 40px; height: 38px; box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;">
|
70154
70322
|
<form class="form-upload-larger" target="frameTargetLinkUpload" method="post" action="${this.builder.opts.largerImageHandler}" enctype="multipart/form-data" style="position:absolute;top:0;left:0;width:100%;height:100%;border-radius:1px;display:flex;align-items: center;justify-content: center;">
|
70155
70323
|
<input id="hidRefId4" name="hidRefId" type="hidden" value="">
|
70156
|
-
<svg class="is-icon-flex"><use xlink:href="#ion-
|
70157
|
-
<input title="${util.out('Select')}" id="fileImage4" name="fileImage" type="file" accept="image/*,video/mp4" style="position:absolute;top:-30px;left:0;width:100%;height:68px;opacity: 0;cursor: pointer;">
|
70324
|
+
<svg class="is-icon-flex" style="width:18px;height:18px;"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
|
70325
|
+
<input onclick="blur()" title="${util.out('Select')}" id="fileImage4" name="fileImage" type="file" accept="image/*,video/mp4" style="position:absolute;top:-30px;left:0;width:100%;height:68px;opacity: 0;cursor: pointer;">
|
70158
70326
|
</form>
|
70159
70327
|
|
70160
|
-
<iframe tabindex="
|
70328
|
+
<iframe tabindex="-1" id="frameTargetLinkUpload" name="frameTargetLinkUpload" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>
|
70161
70329
|
</div>
|
70162
70330
|
</div>
|
70163
70331
|
<div style="padding-top:20px">
|
@@ -70250,11 +70418,11 @@ class ColumnTool {
|
|
70250
70418
|
<div class="image-larger3 input-upload" style="position: relative; flex: 0 0 auto;box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;">
|
70251
70419
|
<form class="form-upload-larger" target="frameTargetCellImageUpload" method="post" action="${this.builder.opts.largerImageHandler}" enctype="multipart/form-data" style="position:absolute;display:flex;justify-content: center;align-items: center;top:0;left:0;width:100%;height:100%;">
|
70252
70420
|
<input id="hidRefId3" name="hidRefId" type="hidden" value="">
|
70253
|
-
<svg class="is-icon-flex"><use xlink:href="#ion-
|
70254
|
-
<input title="${util.out('Select')}" id="fileImage3" name="fileImage" type="file" accept="image/*" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;">
|
70421
|
+
<svg class="is-icon-flex" style="width:18px;height:18px;"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
|
70422
|
+
<input onclick="blur()" title="${util.out('Select')}" id="fileImage3" name="fileImage" type="file" accept="image/*" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;">
|
70255
70423
|
</form>
|
70256
70424
|
|
70257
|
-
<iframe tabIndex="0" id="frameTargetCellImageUpload" name="frameTargetCellImageUpload" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>
|
70425
|
+
<iframe tabindex="-1" tabIndex="0" id="frameTargetCellImageUpload" name="frameTargetCellImageUpload" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>
|
70258
70426
|
</div>
|
70259
70427
|
</div>
|
70260
70428
|
|
@@ -70282,6 +70450,8 @@ class ColumnTool {
|
|
70282
70450
|
|
70283
70451
|
columnMore = builderStuff.querySelector('.columnmore');
|
70284
70452
|
this.cellSettings = builderStuff.querySelector('.is-modal.columnsettings');
|
70453
|
+
this.divCellClick = builderStuff.querySelector('#divCellClick');
|
70454
|
+
this.divCellGeneral = builderStuff.querySelector('#divCellGeneral');
|
70285
70455
|
const quickadd = renderQuickAdd(builder); // Prepare for tooltip
|
70286
70456
|
|
70287
70457
|
let elms = columnTool.querySelectorAll('[title]');
|
@@ -70622,6 +70792,36 @@ class ColumnTool {
|
|
70622
70792
|
btnImageRemove.style.display = 'none';
|
70623
70793
|
div.innerHTML = ''; //Trigger Change event
|
70624
70794
|
|
70795
|
+
this.builder.opts.onChange();
|
70796
|
+
}); // Column Background Image Open Asset
|
70797
|
+
|
70798
|
+
if (!this.builder.opts.onImageSelectClick && this.builder.opts.imageselect === '') {
|
70799
|
+
this.divCellGeneral.querySelector('.input-select').style.display = 'none';
|
70800
|
+
}
|
70801
|
+
|
70802
|
+
const btnCellBgImageOpenAsset = this.divCellGeneral.querySelector('.input-select');
|
70803
|
+
this.builder.renderSelectAsset(btnCellBgImageOpenAsset, 'image', url => {
|
70804
|
+
let cell = util.cellSelected();
|
70805
|
+
if (!cell) return;
|
70806
|
+
this.builder.uo.saveForUndo();
|
70807
|
+
cell.style.backgroundImage = `url("${url}")`;
|
70808
|
+
cell.style.backgroundSize = 'cover';
|
70809
|
+
cell.style.backgroundRepeat = 'no-repeat';
|
70810
|
+
const div = cellSettings.querySelector('.cell-bgimage-preview');
|
70811
|
+
const btnImageAdjust = this.cellSettings.querySelector('.input-cell-bgimageadjust');
|
70812
|
+
const btnImageRemove = this.cellSettings.querySelector('.input-cell-bgremove');
|
70813
|
+
btnImageAdjust.style.display = 'none';
|
70814
|
+
btnImageRemove.style.display = 'none';
|
70815
|
+
|
70816
|
+
if (url !== '') {
|
70817
|
+
div.innerHTML = `<img src="${url}">`;
|
70818
|
+
btnImageAdjust.style.display = 'flex';
|
70819
|
+
btnImageRemove.style.display = 'flex';
|
70820
|
+
} else {
|
70821
|
+
div.innerHTML = '';
|
70822
|
+
} //Trigger Change event
|
70823
|
+
|
70824
|
+
|
70625
70825
|
this.builder.opts.onChange();
|
70626
70826
|
}); // Column Background Image Select Dialog (.is-modal.imagesource)
|
70627
70827
|
|
@@ -71419,13 +71619,13 @@ class ColumnTool {
|
|
71419
71619
|
}
|
71420
71620
|
|
71421
71621
|
if (!this.builder.opts.onImageSelectClick && this.builder.opts.imageselect === '') {
|
71422
|
-
this.
|
71622
|
+
this.divCellClick.querySelector('.input-select').style.display = 'none';
|
71423
71623
|
} // Select image (opens Asset Manager plugin or custom dialog)
|
71424
71624
|
|
71425
71625
|
|
71426
71626
|
if (this.builder.opts.onImageSelectClick || this.builder.opts.imageselect || this.builder.opts.onFileSelectClick || this.builder.opts.fileselect) {
|
71427
71627
|
const inpSrc = this.cellSettings.querySelector('.input-src');
|
71428
|
-
elm = this.
|
71628
|
+
elm = this.divCellClick.querySelector('.input-select');
|
71429
71629
|
if (elm) dom.addEventListener(elm, 'click', () => {
|
71430
71630
|
//---default
|
71431
71631
|
this.builder.targetInput = inpSrc; // used by selectAsset() (see contentbuilder.js)
|
@@ -72303,6 +72503,24 @@ class ColumnTool {
|
|
72303
72503
|
this.columnTool.querySelector('.cell-remove').style.display = '';
|
72304
72504
|
this.columnTool.querySelector('.cell-more').style.display = '';
|
72305
72505
|
}
|
72506
|
+
} // Column Lock will hide Add & Remove column
|
72507
|
+
|
72508
|
+
|
72509
|
+
if (col.classList.contains('column-lock')) {
|
72510
|
+
this.columnTool.querySelector('.cell-add').style.display = 'none';
|
72511
|
+
this.columnTool.querySelector('.cell-remove').style.display = 'none';
|
72512
|
+
this.columnMore.querySelector('.cell-prev').style.display = 'none';
|
72513
|
+
this.columnMore.querySelector('.cell-next').style.display = 'none';
|
72514
|
+
this.columnMore.querySelector('.cell-up').style.display = 'none';
|
72515
|
+
this.columnMore.querySelector('.cell-down').style.display = 'none';
|
72516
|
+
this.columnMore.querySelector('.cell-increase').style.display = 'none';
|
72517
|
+
this.columnMore.querySelector('.cell-decrease').style.display = 'none';
|
72518
|
+
this.columnMore.querySelector('.cell-duplicate').style.display = 'none';
|
72519
|
+
this.columnMore.querySelector('.is-separator').style.display = 'none';
|
72520
|
+
this.columnMore.querySelector('.cell-locking').style.display = 'none';
|
72521
|
+
} else {
|
72522
|
+
this.columnMore.querySelector('.is-separator').style.display = '';
|
72523
|
+
this.columnMore.querySelector('.cell-locking').style.display = '';
|
72306
72524
|
}
|
72307
72525
|
}
|
72308
72526
|
|
@@ -83419,7 +83637,7 @@ class Rte {
|
|
83419
83637
|
|
83420
83638
|
if (count < 3) {
|
83421
83639
|
//not used
|
83422
|
-
|
83640
|
+
let attr = links[i].getAttribute('data-protect');
|
83423
83641
|
|
83424
83642
|
if (!attr) {
|
83425
83643
|
links[i].setAttribute('data-rel', '_del');
|
@@ -83550,23 +83768,46 @@ class Rte {
|
|
83550
83768
|
fontname = fontname.replace(/'/g, ''); // NEW 4.0.5 (replace quotes in font family)
|
83551
83769
|
|
83552
83770
|
if (provider === 'google') {
|
83553
|
-
|
83554
|
-
|
83771
|
+
let bExist = false;
|
83772
|
+
bExist = this.checkIfFontCssLinkExists(fontfamily);
|
83555
83773
|
|
83556
|
-
|
83557
|
-
|
83558
|
-
|
83559
|
-
|
83774
|
+
if (!bExist) {
|
83775
|
+
let element = elm;
|
83776
|
+
|
83777
|
+
while (!dom.hasClass(element, 'is-builder')) {
|
83778
|
+
element = element.parentNode;
|
83779
|
+
}
|
83780
|
+
|
83781
|
+
let cssUrl = '';
|
83782
|
+
|
83783
|
+
if (this.builder.fontPath) {
|
83784
|
+
const cssFileName = fontfamily.split(',')[0].toLowerCase().replace(/'/g, '').replace(/"/g, '').replace(/\s/g, '-') + '.css';
|
83785
|
+
cssUrl = this.builder.fontPath + cssFileName;
|
83786
|
+
dom.appendHtml(element, `<link data-name="fontfamily" href="${cssUrl}" rel="stylesheet" property="stylesheet" type="text/css">`);
|
83787
|
+
} else {
|
83788
|
+
dom.appendHtml(element, '<link href="//fonts.googleapis.com/css?family=' + fontname + d + o + '" rel="stylesheet" property="stylesheet" type="text/css">');
|
83789
|
+
}
|
83560
83790
|
}
|
83791
|
+
}
|
83792
|
+
|
83793
|
+
if (provider === 'others') {
|
83794
|
+
let bExist = false;
|
83795
|
+
bExist = this.checkIfFontCssLinkExists(fontfamily);
|
83561
83796
|
|
83562
83797
|
if (!bExist) {
|
83563
|
-
|
83798
|
+
let element = elm;
|
83564
83799
|
|
83565
83800
|
while (!dom.hasClass(element, 'is-builder')) {
|
83566
83801
|
element = element.parentNode;
|
83567
83802
|
}
|
83568
83803
|
|
83569
|
-
|
83804
|
+
let cssUrl = '';
|
83805
|
+
|
83806
|
+
if (this.builder.fontPath) {
|
83807
|
+
const cssFileName = fontfamily.split(',')[0].toLowerCase().replace(/'/g, '').replace(/"/g, '').replace(/\s/g, '-') + '.css';
|
83808
|
+
cssUrl = this.builder.fontPath + cssFileName;
|
83809
|
+
dom.appendHtml(element, `<link data-name="fontfamily" href="${cssUrl}" rel="stylesheet" property="stylesheet" type="text/css">`);
|
83810
|
+
}
|
83570
83811
|
}
|
83571
83812
|
}
|
83572
83813
|
|
@@ -83584,9 +83825,12 @@ class Rte {
|
|
83584
83825
|
} //Trigger Change event
|
83585
83826
|
|
83586
83827
|
|
83587
|
-
this.builder.opts.onChange(); //
|
83588
|
-
|
83828
|
+
this.builder.opts.onChange(); //Cleanup Google font css link
|
83829
|
+
|
83830
|
+
this.cleanupFontCssLink();
|
83831
|
+
}
|
83589
83832
|
|
83833
|
+
cleanupFontCssLink() {
|
83590
83834
|
const fonts = [];
|
83591
83835
|
|
83592
83836
|
if (this.builder.opts.page !== '') {
|
@@ -83603,54 +83847,64 @@ class Rte {
|
|
83603
83847
|
if (fonts.indexOf(fontFamily) === -1) fonts.push(fontFamily);
|
83604
83848
|
});
|
83605
83849
|
});
|
83606
|
-
}
|
83850
|
+
} // Cleanup
|
83607
83851
|
|
83608
|
-
links = this.builder.doc.getElementsByTagName('link');
|
83609
83852
|
|
83610
|
-
|
83611
|
-
|
83853
|
+
let links = this.builder.doc.getElementsByTagName('link');
|
83854
|
+
|
83855
|
+
for (let i = 0; i < links.length; i++) {
|
83856
|
+
let sSrc = links[i].href.toLowerCase();
|
83612
83857
|
|
83613
83858
|
if (sSrc.indexOf('googleapis') !== -1) {
|
83614
83859
|
//get fontname
|
83615
83860
|
sSrc = sSrc.replace(/\+/g, ' ').replace(/%20/g, ' ');
|
83616
|
-
|
83861
|
+
let linkFontName = sSrc.substr(sSrc.indexOf('family=') + 7);
|
83617
83862
|
|
83618
|
-
if (
|
83619
|
-
|
83863
|
+
if (linkFontName.indexOf(':') !== -1) {
|
83864
|
+
linkFontName = linkFontName.split(':')[0];
|
83620
83865
|
}
|
83621
83866
|
|
83622
|
-
if (
|
83623
|
-
|
83867
|
+
if (linkFontName.indexOf('|') !== -1) {
|
83868
|
+
linkFontName = linkFontName.split('|')[0];
|
83624
83869
|
}
|
83625
83870
|
|
83626
|
-
|
83627
|
-
//console.log(
|
83628
|
-
//check if fontname used in content
|
83629
|
-
// let tmp = this.builder.doc.body.innerHTML.toLowerCase();
|
83871
|
+
linkFontName = linkFontName.replace('&display=swap', ''); // NEW 4.0.5
|
83872
|
+
// console.log(linkFontName);
|
83873
|
+
// check if fontname used in content
|
83630
83874
|
|
83631
83875
|
let used = false;
|
83632
83876
|
fonts.forEach(item => {
|
83633
|
-
if (item.toLowerCase().indexOf(
|
83877
|
+
if (item.toLowerCase().indexOf(linkFontName.toLowerCase()) === -1) ; else {
|
83634
83878
|
used = true;
|
83635
83879
|
}
|
83636
83880
|
});
|
83637
83881
|
|
83638
83882
|
if (!used) {
|
83639
83883
|
//not used
|
83640
|
-
|
83884
|
+
let attr = links[i].getAttribute('data-protect');
|
83641
83885
|
|
83642
83886
|
if (!attr) {
|
83643
83887
|
links[i].setAttribute('data-rel', '_del');
|
83644
83888
|
}
|
83645
|
-
}
|
83646
|
-
|
83647
|
-
|
83648
|
-
|
83649
|
-
|
83650
|
-
|
83651
|
-
|
83652
|
-
|
83889
|
+
}
|
83890
|
+
} else if (links[i].getAttribute('data-name') === 'fontfamily') {
|
83891
|
+
let used = false;
|
83892
|
+
fonts.forEach(item => {
|
83893
|
+
const cssFileName = item.split(',')[0].replace(/'/g, '').replace(/"/g, '').replace(/\s/g, '-').toLowerCase() + '.css';
|
83894
|
+
|
83895
|
+
if (sSrc.toLowerCase().indexOf('/' + cssFileName) === -1) ; else {
|
83896
|
+
used = true;
|
83897
|
+
}
|
83898
|
+
});
|
83653
83899
|
|
83900
|
+
if (!used) {
|
83901
|
+
//not used
|
83902
|
+
let attr = links[i].getAttribute('data-protect');
|
83903
|
+
|
83904
|
+
if (!attr) {
|
83905
|
+
links[i].setAttribute('data-rel', '_del');
|
83906
|
+
}
|
83907
|
+
}
|
83654
83908
|
}
|
83655
83909
|
}
|
83656
83910
|
|
@@ -83659,6 +83913,54 @@ class Rte {
|
|
83659
83913
|
});
|
83660
83914
|
}
|
83661
83915
|
|
83916
|
+
checkIfFontCssLinkExists(fontfamily) {
|
83917
|
+
let bExist = false;
|
83918
|
+
let fontname = fontfamily.split(',')[0];
|
83919
|
+
fontname = fontname.replace(/'/g, '');
|
83920
|
+
fontname = fontname.replace(/"/g, ''); // (replace double quotes in font family)
|
83921
|
+
|
83922
|
+
fontname = fontname.toLowerCase();
|
83923
|
+
let links = this.builder.doc.getElementsByTagName('link');
|
83924
|
+
|
83925
|
+
for (let i = 0; i < links.length; i++) {
|
83926
|
+
let sSrc = links[i].href.toLowerCase();
|
83927
|
+
|
83928
|
+
if (sSrc.indexOf('googleapis') !== -1) {
|
83929
|
+
if (!this.builder.fontPath) {
|
83930
|
+
//get fontname
|
83931
|
+
sSrc = sSrc.replace(/\+/g, ' ').replace(/%20/g, ' ');
|
83932
|
+
let linkFontName = sSrc.substr(sSrc.indexOf('family=') + 7);
|
83933
|
+
|
83934
|
+
if (linkFontName.indexOf(':') !== -1) {
|
83935
|
+
linkFontName = linkFontName.split(':')[0];
|
83936
|
+
}
|
83937
|
+
|
83938
|
+
if (linkFontName.indexOf('|') !== -1) {
|
83939
|
+
linkFontName = linkFontName.split('|')[0];
|
83940
|
+
}
|
83941
|
+
|
83942
|
+
linkFontName = linkFontName.replace('&display=swap', ''); // NEW 4.0.5
|
83943
|
+
//check if fontname used in content
|
83944
|
+
// let tmp = this.builder.doc.body.innerHTML.toLowerCase();
|
83945
|
+
|
83946
|
+
if (linkFontName === fontname.toLowerCase()) {
|
83947
|
+
bExist = true; // console.log(fontname.toLowerCase() + '-' +linkFontName);
|
83948
|
+
}
|
83949
|
+
}
|
83950
|
+
} else if (links[i].getAttribute('data-name') === 'fontfamily') {
|
83951
|
+
if (this.builder.fontPath) {
|
83952
|
+
let cssFile = fontname.replace(/\s/g, '-').toLowerCase() + '.css';
|
83953
|
+
|
83954
|
+
if (sSrc.toLowerCase().indexOf('/' + cssFile) !== -1) {
|
83955
|
+
bExist = true;
|
83956
|
+
}
|
83957
|
+
}
|
83958
|
+
}
|
83959
|
+
}
|
83960
|
+
|
83961
|
+
return bExist;
|
83962
|
+
}
|
83963
|
+
|
83662
83964
|
positionToolbar() {
|
83663
83965
|
const viewportWidth = document.body.clientWidth; //window.innerWidth;
|
83664
83966
|
|
@@ -86540,6 +86842,177 @@ class ContentStuff$1 {
|
|
86540
86842
|
|
86541
86843
|
}
|
86542
86844
|
|
86845
|
+
class MediaPicker {
|
86846
|
+
constructor(builder) {
|
86847
|
+
this.builder = builder;
|
86848
|
+
const util = this.builder.util;
|
86849
|
+
this.util = util;
|
86850
|
+
const builderStuff = this.builder.builderStuff;
|
86851
|
+
const dom = this.builder.dom;
|
86852
|
+
this.dom = dom;
|
86853
|
+
this.id = this.builder.util.makeId();
|
86854
|
+
const html = `
|
86855
|
+
<div class="is-modal mediasource" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
|
86856
|
+
<div class="is-modal-content" style="max-width:550px;">
|
86857
|
+
|
86858
|
+
<label for="inpMediaSource" style="display:block">${util.out('Source')}:</label>
|
86859
|
+
<div class="image-src">
|
86860
|
+
<input id="inpMediaSource" class="input-src" type="text">
|
86861
|
+
<button title="${util.out('Select')}" class="input-select" style="flex:none;"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
|
86862
|
+
<div class="input-upload" style="position: relative; flex: 0 0 auto;box-shadow: rgba(0, 0, 0, 0.32) 0px 3px 6px -6px;">
|
86863
|
+
<form class="form-upload-larger" target="frameTarget${this.id}" method="post" action="${this.builder.opts.onLargerImageUpload}" enctype="multipart/form-data" style="position:absolute;display:flex;justify-content: center;align-items: center;top:0;left:0;width:100%;height:100%;">
|
86864
|
+
<input name="hidRefId" class="input-ref-id" type="hidden" value="">
|
86865
|
+
<svg class="is-icon-flex" style="width:18px;height:18px;"><use xlink:href="#ion-ios-cloud-upload-outline"></use></svg>
|
86866
|
+
<input title="${util.out('Select')}" name="fileImage" class="input-file-select" type="file" accept="image/*,video/mp4" style="position:absolute;top:-30px;left:0;width:100%;height:80px;opacity: 0;cursor: pointer;">
|
86867
|
+
</form>
|
86868
|
+
<iframe tabIndex="0" id="frameTarget${this.id}" name="frameTarget${this.id}" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>
|
86869
|
+
</div>
|
86870
|
+
</div>
|
86871
|
+
|
86872
|
+
<div style="text-align:right;margin-top:20px;">
|
86873
|
+
<button title="${util.out('Cancel')}" class="input-cancel classic-secondary">${util.out('Cancel')}</button>
|
86874
|
+
<button title="${util.out('Ok')}" class="input-ok classic-primary">${util.out('Ok')}</button>
|
86875
|
+
</div>
|
86876
|
+
|
86877
|
+
</div>
|
86878
|
+
</div>
|
86879
|
+
`;
|
86880
|
+
dom.appendHtml(builderStuff, html);
|
86881
|
+
const modalMediaSelect = document.querySelector('.mediasource');
|
86882
|
+
this.modalMediaSelect = modalMediaSelect;
|
86883
|
+
|
86884
|
+
if (this.builder.opts.largerImageHandler === '' && !this.builder.opts.onLargerImageUpload) {
|
86885
|
+
modalMediaSelect.querySelector('.input-upload').style.display = 'none';
|
86886
|
+
}
|
86887
|
+
|
86888
|
+
if (!this.builder.opts.onImageSelectClick && this.builder.opts.imageselect === '') {
|
86889
|
+
modalMediaSelect.querySelector('.input-select').style.display = 'none';
|
86890
|
+
}
|
86891
|
+
|
86892
|
+
if (this.builder.opts.onImageSelectClick || this.builder.opts.imageselect || this.builder.opts.onFileSelectClick || this.builder.opts.fileselect) {
|
86893
|
+
const inpSrc = modalMediaSelect.querySelector('.input-src');
|
86894
|
+
const elm = modalMediaSelect.querySelector('.input-select');
|
86895
|
+
if (elm) dom.addEventListener(elm, 'click', () => {
|
86896
|
+
if (this.builder.opts.onFileSelectClick) {
|
86897
|
+
this.builder.opts.onFileSelectClick({
|
86898
|
+
targetInput: inpSrc,
|
86899
|
+
theTrigger: elm
|
86900
|
+
});
|
86901
|
+
} else if (this.builder.opts.onImageSelectClick) {
|
86902
|
+
this.builder.opts.onImageSelectClick({
|
86903
|
+
targetInput: inpSrc,
|
86904
|
+
theTrigger: elm
|
86905
|
+
});
|
86906
|
+
} else if (this.builder.opts.fileselect) {
|
86907
|
+
let modalFileSelect = builderStuff.querySelector('.is-modal.fileselect');
|
86908
|
+
let iframe = modalFileSelect.querySelector('iframe');
|
86909
|
+
|
86910
|
+
if (this.builder.opts.assetRefresh) {
|
86911
|
+
iframe.src = this.builder.opts.fileselect;
|
86912
|
+
this.builder.opts.assetRefresh = false;
|
86913
|
+
}
|
86914
|
+
|
86915
|
+
if (iframe.src === 'about:blank') {
|
86916
|
+
iframe.src = this.builder.opts.fileselect;
|
86917
|
+
}
|
86918
|
+
|
86919
|
+
util.showModal(modalFileSelect, false, () => {
|
86920
|
+
elm.removeAttribute('data-focus');
|
86921
|
+
elm.focus();
|
86922
|
+
});
|
86923
|
+
elm.setAttribute('data-focus', true);
|
86924
|
+
this.builder.targetInput = inpSrc;
|
86925
|
+
this.builder.targetCallback = null; // this.builder.targetAssetType = 'media';
|
86926
|
+
} else if (this.builder.opts.imageselect) {
|
86927
|
+
let modalImageSelect = builderStuff.querySelector('.is-modal.imageselect');
|
86928
|
+
let iframe = modalImageSelect.querySelector('iframe');
|
86929
|
+
|
86930
|
+
if (this.builder.opts.assetRefresh) {
|
86931
|
+
iframe.src = this.builder.opts.imageselect;
|
86932
|
+
this.builder.opts.assetRefresh = false;
|
86933
|
+
}
|
86934
|
+
|
86935
|
+
if (iframe.src === 'about:blank') {
|
86936
|
+
iframe.src = this.builder.opts.imageselect;
|
86937
|
+
}
|
86938
|
+
|
86939
|
+
util.showModal(modalImageSelect, false, () => {
|
86940
|
+
elm.removeAttribute('data-focus');
|
86941
|
+
elm.focus();
|
86942
|
+
});
|
86943
|
+
elm.setAttribute('data-focus', true);
|
86944
|
+
this.builder.targetInput = inpSrc;
|
86945
|
+
this.builder.targetCallback = null; // this.builder.targetAssetType = 'media';
|
86946
|
+
}
|
86947
|
+
});
|
86948
|
+
}
|
86949
|
+
|
86950
|
+
let inputFileSelect = modalMediaSelect.querySelector('.input-file-select');
|
86951
|
+
dom.addEventListener(inputFileSelect, 'change', e => {
|
86952
|
+
let element = inputFileSelect;
|
86953
|
+
|
86954
|
+
while (element.nodeName.toLowerCase() !== 'form') {
|
86955
|
+
element = element.parentNode;
|
86956
|
+
}
|
86957
|
+
|
86958
|
+
let frmUpload = element;
|
86959
|
+
dom.addClass(frmUpload, 'please-wait');
|
86960
|
+
modalMediaSelect.querySelector('.input-ref-id').value = this.builder.opts.customval;
|
86961
|
+
|
86962
|
+
if (this.builder.opts.onLargerImageUpload) {
|
86963
|
+
this.builder.opts.onLargerImageUpload(e);
|
86964
|
+
} else {
|
86965
|
+
frmUpload.submit();
|
86966
|
+
}
|
86967
|
+
|
86968
|
+
inputFileSelect.value = ''; // Clear Input
|
86969
|
+
});
|
86970
|
+
const btnImageOk = modalMediaSelect.querySelector('.input-ok');
|
86971
|
+
dom.addEventListener(btnImageOk, 'click', () => {
|
86972
|
+
const inpSrc = modalMediaSelect.querySelector('.input-src');
|
86973
|
+
const url = inpSrc.value;
|
86974
|
+
if (this.builder.mediaSelectedCallback) this.builder.mediaSelectedCallback(url);
|
86975
|
+
this.builder.hideModal(modalMediaSelect);
|
86976
|
+
});
|
86977
|
+
const btnImageCancel = modalMediaSelect.querySelector('.input-cancel');
|
86978
|
+
dom.addEventListener(btnImageCancel, 'click', () => {
|
86979
|
+
this.builder.hideModal(modalMediaSelect);
|
86980
|
+
});
|
86981
|
+
}
|
86982
|
+
|
86983
|
+
openMediaPicker(currentUrl, assetType, callback, btn) {
|
86984
|
+
this.builder.targetAssetType = assetType;
|
86985
|
+
const modalMediaSelect = this.modalMediaSelect;
|
86986
|
+
let inputFileSelect = modalMediaSelect.querySelector('.input-file-select');
|
86987
|
+
|
86988
|
+
if (assetType === 'media') {
|
86989
|
+
inputFileSelect.setAttribute('accept', 'image/*,video/mp4');
|
86990
|
+
} else if (assetType === 'video') {
|
86991
|
+
inputFileSelect.setAttribute('accept', 'video/mp4');
|
86992
|
+
} else if (assetType === 'image') {
|
86993
|
+
inputFileSelect.setAttribute('accept', 'image/*');
|
86994
|
+
} else if (assetType === 'audio') {
|
86995
|
+
inputFileSelect.setAttribute('accept', 'audio/mp3');
|
86996
|
+
} //Current value
|
86997
|
+
|
86998
|
+
|
86999
|
+
const inpSrc = modalMediaSelect.querySelector('.input-src');
|
87000
|
+
inpSrc.value = currentUrl; //mediaSelectedCallback
|
87001
|
+
|
87002
|
+
this.builder.mediaSelectedCallback = callback; //Show modal
|
87003
|
+
|
87004
|
+
modalMediaSelect.style.zIndex = '10005';
|
87005
|
+
this.util.showModal(modalMediaSelect, false, () => {
|
87006
|
+
if (btn) {
|
87007
|
+
btn.removeAttribute('data-focus');
|
87008
|
+
btn.focus();
|
87009
|
+
}
|
87010
|
+
});
|
87011
|
+
if (btn) btn.setAttribute('data-focus', true);
|
87012
|
+
}
|
87013
|
+
|
87014
|
+
}
|
87015
|
+
|
86543
87016
|
class ContentBuilder {
|
86544
87017
|
constructor(opts = {}) {
|
86545
87018
|
let defaults = {
|
@@ -86583,6 +87056,8 @@ class ContentBuilder {
|
|
86583
87056
|
assetPath: 'assets/',
|
86584
87057
|
// Used for the location of ionicons/ (see rte.js 2788) & scripts/ (see plugins/preview/plugin.js 237)
|
86585
87058
|
fontAssetPath: 'assets/fonts/',
|
87059
|
+
// Option for self-hosted fonts:
|
87060
|
+
// fontPath: 'assets/cssfonts/', // If set, will be used
|
86586
87061
|
snippetData: 'assets/minimalist-blocks/snippetlist.html',
|
86587
87062
|
// Deprecated
|
86588
87063
|
snippetUrl: 'assets/minimalist-blocks/content.js',
|
@@ -87286,7 +87761,8 @@ class ContentBuilder {
|
|
87286
87761
|
}
|
87287
87762
|
|
87288
87763
|
this.colTool = new ColumnTool(this); // Render Column Tool
|
87289
|
-
|
87764
|
+
|
87765
|
+
this.mediaPicker = new MediaPicker(this); // Extend the onChange function
|
87290
87766
|
|
87291
87767
|
var oldget = this.opts.onChange;
|
87292
87768
|
|
@@ -88180,6 +88656,10 @@ class ContentBuilder {
|
|
88180
88656
|
this.opts.assetRefresh = true; // After file upload, make open asset refreshed
|
88181
88657
|
}
|
88182
88658
|
|
88659
|
+
openMediaPicker(currentUrl, assetType = 'media', callback, btn) {
|
88660
|
+
this.mediaPicker.openMediaPicker(currentUrl, assetType, callback, btn);
|
88661
|
+
}
|
88662
|
+
|
88183
88663
|
openImagePicker(currentUrl, callback, btn) {
|
88184
88664
|
this.colTool.openImagePicker(currentUrl, callback, btn);
|
88185
88665
|
}
|
@@ -88265,6 +88745,65 @@ class ContentBuilder {
|
|
88265
88745
|
return this.targetAssetType; // not used yet
|
88266
88746
|
}
|
88267
88747
|
|
88748
|
+
renderSelectAsset(btn, targetAssetType, callback) {
|
88749
|
+
const _id = 'inp_' + this.util.makeId();
|
88750
|
+
|
88751
|
+
btn.insertAdjacentHTML('afterend', `<input type="hidden" id="${_id}">`);
|
88752
|
+
const inpUrl = btn.parentNode.querySelector(`#${_id}`);
|
88753
|
+
btn.addEventListener('click', () => {
|
88754
|
+
this.openAsset(inpUrl, targetAssetType, btn);
|
88755
|
+
});
|
88756
|
+
|
88757
|
+
let out = s => this.util.out(s);
|
88758
|
+
|
88759
|
+
const desc = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
|
88760
|
+
Object.defineProperty(inpUrl, 'value', {
|
88761
|
+
get: desc.get,
|
88762
|
+
set: function (s) {
|
88763
|
+
// Additional protection if normal selectAsset() is not used in asset dialog.
|
88764
|
+
// This is used if onImageSelectClick or onFileSelectClick are used.
|
88765
|
+
const filename = s.substring(s.lastIndexOf('/') + 1);
|
88766
|
+
let extension = filename.split('.').pop();
|
88767
|
+
extension = extension.toLowerCase();
|
88768
|
+
let ok = false;
|
88769
|
+
|
88770
|
+
if (targetAssetType === 'all') {
|
88771
|
+
ok = true;
|
88772
|
+
} else if (targetAssetType === 'media') {
|
88773
|
+
if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm' || extension === 'mp4') {
|
88774
|
+
ok = true;
|
88775
|
+
} else {
|
88776
|
+
alert(out('Please select an image or video file.'));
|
88777
|
+
}
|
88778
|
+
} else if (targetAssetType === 'video') {
|
88779
|
+
if (extension === 'mp4') {
|
88780
|
+
ok = true;
|
88781
|
+
} else {
|
88782
|
+
alert(out('Please select an mp4 file.'));
|
88783
|
+
}
|
88784
|
+
} else if (targetAssetType === 'image') {
|
88785
|
+
if (extension === 'jpg' || extension === 'jpeg' || extension === 'png' || extension === 'gif' || extension === 'webm') {
|
88786
|
+
ok = true;
|
88787
|
+
} else {
|
88788
|
+
alert(out('Please select an image file.'));
|
88789
|
+
}
|
88790
|
+
} else if (targetAssetType === 'audio') {
|
88791
|
+
if (extension === 'mp3') {
|
88792
|
+
ok = true;
|
88793
|
+
} else {
|
88794
|
+
alert(out('Please select an mp3 file.'));
|
88795
|
+
}
|
88796
|
+
}
|
88797
|
+
|
88798
|
+
if (ok) {
|
88799
|
+
if (callback) callback(s);
|
88800
|
+
}
|
88801
|
+
|
88802
|
+
desc.set.call(this, s);
|
88803
|
+
}
|
88804
|
+
});
|
88805
|
+
}
|
88806
|
+
|
88268
88807
|
openAsset(targetInput, targetAssetType, theTrigger) {
|
88269
88808
|
if (targetAssetType === 'media' && (this.opts.onFileSelectClick || this.opts.onImageSelectClick)) {
|
88270
88809
|
if (this.opts.onFileSelectClick) {
|
@@ -91412,6 +91951,10 @@ class ContentStuff {
|
|
91412
91951
|
this.builder = builder; // const util = builder.util;
|
91413
91952
|
|
91414
91953
|
const html = `
|
91954
|
+
<form class="is-cover-upload-central" 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);">
|
91955
|
+
<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;"/>
|
91956
|
+
<input tabindex="-1" class="input-custom-value-central" name="hidcustomval" type="hidden" value="${this.builder.customval}" />
|
91957
|
+
</form>
|
91415
91958
|
<iframe id="target-upload-cover" name="target-upload-cover" src="about:blank" style="width:1px;height:1px;position:absolute;top:0;right:-100000px"></iframe>
|
91416
91959
|
`;
|
91417
91960
|
builder.contentStuff.insertAdjacentHTML('afterbegin', html);
|
@@ -91705,6 +92248,8 @@ class ContentBox {
|
|
91705
92248
|
contentStylePath: 'assets/styles/',
|
91706
92249
|
pluginPath: 'contentbuilder/',
|
91707
92250
|
fontAssetPath: 'assets/fonts/',
|
92251
|
+
// Option for self-hosted fonts:
|
92252
|
+
// fontPath: 'assets/cssfonts/', // If set, will be used
|
91708
92253
|
plugins: [{
|
91709
92254
|
name: 'preview',
|
91710
92255
|
showInMainToolbar: true,
|
@@ -91794,7 +92339,7 @@ class ContentBox {
|
|
91794
92339
|
dragWithoutHandle: false,
|
91795
92340
|
addButtonPlacement: '',
|
91796
92341
|
snippetCategories: [[120, 'Basic'], [118, 'Article'], [101, 'Headline'], [119, 'Buttons'], [102, 'Photos'], [103, 'Profile'], [116, 'Contact'], [104, 'Products'], [105, 'Features'], [106, 'Process'], [107, 'Pricing'], [108, 'Skills'], [109, 'Achievements'], [110, 'Quotes'], [111, 'Partners'], [112, 'As Featured On'], [113, 'Page Not Found'], [114, 'Coming Soon'], [115, 'Help, FAQ']],
|
91797
|
-
defaultSnippetCategory:
|
92342
|
+
defaultSnippetCategory: 120,
|
91798
92343
|
outlineMode: '',
|
91799
92344
|
elementHighlight: true,
|
91800
92345
|
rowTool: 'right',
|
@@ -94233,6 +94778,7 @@ class ContentBox {
|
|
94233
94778
|
pluginPath: this.settings.pluginPath,
|
94234
94779
|
modulePath: this.settings.modulePath,
|
94235
94780
|
fontAssetPath: this.settings.fontAssetPath,
|
94781
|
+
fontPath: this.settings.fontPath,
|
94236
94782
|
assetPath: this.settings.assetPath,
|
94237
94783
|
plugins: this.settings.plugins,
|
94238
94784
|
disableConfig: this.settings.disableConfig,
|
@@ -94822,7 +95368,7 @@ class ContentBox {
|
|
94822
95368
|
}
|
94823
95369
|
|
94824
95370
|
sectionSetup(section) {
|
94825
|
-
dom.appendHtml(section, '<div class="is-section-tool">' + '<button class="is-section-edit" tabindex="-1" data-title="' + out('Section Settings') + '" title="' + out('Section Settings') + '"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>' + '<button class="is-section-remove" tabindex="-1" data-title="' + out('Remove') + '" title="' + out('Remove') + '">✕</button>' + '</div>'); // this.editor.setTooltip(section);
|
95371
|
+
dom.appendHtml(section, '<div class="is-section-tool">' + '<button type="button" class="is-section-edit" tabindex="-1" data-title="' + out('Section Settings') + '" title="' + out('Section Settings') + '"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>' + '<button type="button" class="is-section-remove" tabindex="-1" data-title="' + out('Remove') + '" title="' + out('Remove') + '">✕</button>' + '</div>'); // this.editor.setTooltip(section);
|
94826
95372
|
// Prepare for tooltip
|
94827
95373
|
|
94828
95374
|
let elms = section.querySelector('.is-section-tool').querySelectorAll('[title]');
|
@@ -94850,7 +95396,7 @@ class ContentBox {
|
|
94850
95396
|
boxSetup(box) {
|
94851
95397
|
let tool = box.querySelector('.is-box-tool');
|
94852
95398
|
if (tool) tool.parentNode.removeChild(tool);
|
94853
|
-
dom.appendHtml(box, '<div class="is-box-tool" data-tool="1">' + '<
|
95399
|
+
dom.appendHtml(box, '<div class="is-box-tool" data-tool="1">' + '<div role="button" class="is-cover-upload" data-tooltip-top title="' + out('Background Image') + '" data-title="' + out('Background Image') + '" 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);">' + '<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-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') + '"><svg class="is-icon-flex"><use xlink:href="#ion-ios-gear"></use></svg></button>' + '</div>'); // this.editor.setTooltip(box);
|
94854
95400
|
// Prepare for tooltip
|
94855
95401
|
|
94856
95402
|
if (tool) {
|
@@ -94874,60 +95420,66 @@ class ContentBox {
|
|
94874
95420
|
if (btnModuleEdit) btnModuleEdit.addEventListener('click', () => {
|
94875
95421
|
this.editbox.editModule();
|
94876
95422
|
});
|
94877
|
-
|
94878
|
-
if (
|
94879
|
-
|
94880
|
-
// Remove Waiting Indicator
|
94881
|
-
const builderStuff = this.builderStuff;
|
94882
|
-
const indicator = builderStuff.querySelector('.waiting-indicator');
|
94883
|
-
if(indicator) {
|
94884
|
-
alert('Please wait until another upload process completed.')
|
94885
|
-
e.preventDefault();
|
94886
|
-
return;
|
94887
|
-
}
|
94888
|
-
*/
|
94889
|
-
// prevent lost of activeBox during uploading cover (save to targetBox)
|
94890
|
-
this.editbox.targetBox = this.activeBox;
|
94891
|
-
});
|
94892
|
-
if (fileCover) fileCover.addEventListener('change', e => {
|
94893
|
-
if (fileCover.value === '') return;
|
94894
|
-
this.editor.saveForUndo(); // Show Waiting Indicator
|
94895
|
-
|
94896
|
-
const builderStuff = this.builderStuff;
|
94897
|
-
dom.appendHtml(builderStuff, `<div class="waiting-indicator-overlay"></div>
|
94898
|
-
<div class="waiting-indicator">
|
94899
|
-
<div>${out('Uploading..')}</div>
|
94900
|
-
</div>
|
94901
|
-
`);
|
94902
|
-
const indicator = builderStuff.querySelector('.waiting-indicator');
|
94903
|
-
let targetBox = this.editbox.targetBox;
|
94904
|
-
let top, left;
|
95423
|
+
let btnCover = box.querySelector('.is-cover-upload');
|
95424
|
+
if (btnCover) btnCover.addEventListener('mouseenter', () => {
|
95425
|
+
let btnCoverCentral;
|
94905
95426
|
|
94906
95427
|
if (!this.iframe) {
|
94907
|
-
|
94908
|
-
left = targetBox.getBoundingClientRect().left + window.pageXOffset;
|
95428
|
+
btnCoverCentral = this.builderStuff.querySelector('.is-cover-upload-central');
|
94909
95429
|
} else {
|
94910
|
-
|
94911
|
-
let adjX = this.iframe.getBoundingClientRect().left + window.pageXOffset;
|
94912
|
-
top = targetBox.getBoundingClientRect().top + adjY;
|
94913
|
-
left = targetBox.getBoundingClientRect().left + adjX;
|
95430
|
+
btnCoverCentral = this.contentStuff.querySelector('.is-cover-upload-central');
|
94914
95431
|
}
|
94915
95432
|
|
94916
|
-
|
94917
|
-
|
94918
|
-
|
94919
|
-
|
94920
|
-
|
94921
|
-
|
94922
|
-
|
94923
|
-
|
94924
|
-
|
94925
|
-
|
94926
|
-
|
94927
|
-
|
94928
|
-
|
94929
|
-
|
95433
|
+
let top, left;
|
95434
|
+
top = btnCover.getBoundingClientRect().top + this.win.pageYOffset;
|
95435
|
+
left = btnCover.getBoundingClientRect().left + this.win.pageXOffset;
|
95436
|
+
btnCoverCentral.style.top = top + 'px';
|
95437
|
+
btnCoverCentral.style.left = left + 'px';
|
95438
|
+
});
|
95439
|
+
/*
|
95440
|
+
const fileCover = box.querySelector('.input-file-cover');
|
95441
|
+
if(fileCover) fileCover.addEventListener('click', ()=>{
|
95442
|
+
// prevent lost of activeBox during uploading cover (save to targetBox)
|
95443
|
+
this.editbox.targetBox = this.activeBox;
|
95444
|
+
});
|
95445
|
+
if(fileCover) fileCover.addEventListener('change', (e)=>{
|
95446
|
+
if (fileCover.value === '') return;
|
95447
|
+
|
95448
|
+
this.editor.saveForUndo();
|
95449
|
+
// Show Waiting Indicator
|
95450
|
+
const builderStuff = this.builderStuff;
|
95451
|
+
dom.appendHtml(builderStuff, `<div class="waiting-indicator-overlay"></div>
|
95452
|
+
<div class="waiting-indicator">
|
95453
|
+
<div>${out('Uploading..')}</div>
|
95454
|
+
</div>
|
95455
|
+
`);
|
95456
|
+
const indicator = builderStuff.querySelector('.waiting-indicator');
|
95457
|
+
let targetBox = this.editbox.targetBox;
|
95458
|
+
let top, left;
|
95459
|
+
if(!this.iframe) {
|
95460
|
+
top = (targetBox.getBoundingClientRect().top + window.pageYOffset);
|
95461
|
+
left = (targetBox.getBoundingClientRect().left + window.pageXOffset);
|
95462
|
+
} else {
|
95463
|
+
let adjY = this.iframe.getBoundingClientRect().top + window.pageYOffset;
|
95464
|
+
let adjX = this.iframe.getBoundingClientRect().left + window.pageXOffset;
|
95465
|
+
top = targetBox.getBoundingClientRect().top + adjY;
|
95466
|
+
left = targetBox.getBoundingClientRect().left + adjX;
|
95467
|
+
}
|
95468
|
+
indicator.style.top = top + 'px';
|
95469
|
+
indicator.style.left = left + 'px';
|
95470
|
+
box.querySelector('.input-custom-value').value = this.settings.customval;
|
95471
|
+
if(this.settings.onUploadCoverImage) {
|
95472
|
+
this.settings.onUploadCoverImage(e);
|
95473
|
+
} else {
|
95474
|
+
box.querySelector('.is-cover-upload').submit();
|
95475
|
+
}
|
95476
|
+
|
95477
|
+
fileCover.value = ''; // Clear Input
|
95478
|
+
e.preventDefault();
|
95479
|
+
e.stopImmediatePropagation();
|
94930
95480
|
});
|
95481
|
+
*/
|
95482
|
+
|
94931
95483
|
box.addEventListener('mouseenter', () => {
|
94932
95484
|
this.positionTool(box);
|
94933
95485
|
let activeSection;
|
@@ -94968,6 +95520,47 @@ class ContentBox {
|
|
94968
95520
|
}
|
94969
95521
|
}
|
94970
95522
|
|
95523
|
+
sectionStack() {
|
95524
|
+
const sections = this.wrapperEl.querySelectorAll('.is-section.box-space');
|
95525
|
+
sections.forEach(section => {
|
95526
|
+
let prev = false;
|
95527
|
+
|
95528
|
+
if (section.previousElementSibling) {
|
95529
|
+
if (section.previousElementSibling.classList.contains('box-space')) prev = true;
|
95530
|
+
}
|
95531
|
+
|
95532
|
+
let next = false;
|
95533
|
+
|
95534
|
+
if (section.nextElementSibling) {
|
95535
|
+
if (section.nextElementSibling.classList.contains('box-space')) next = true;
|
95536
|
+
}
|
95537
|
+
|
95538
|
+
if (!prev && next) {
|
95539
|
+
section.classList.add('stack-top');
|
95540
|
+
section.classList.remove('stack-middle');
|
95541
|
+
section.classList.remove('stack-bottom');
|
95542
|
+
}
|
95543
|
+
|
95544
|
+
if (!prev && !next) {
|
95545
|
+
section.classList.remove('stack-top');
|
95546
|
+
section.classList.remove('stack-middle');
|
95547
|
+
section.classList.remove('stack-bottom');
|
95548
|
+
}
|
95549
|
+
|
95550
|
+
if (!next && prev) {
|
95551
|
+
section.classList.add('stack-bottom');
|
95552
|
+
section.classList.remove('stack-middle');
|
95553
|
+
section.classList.remove('stack-top');
|
95554
|
+
}
|
95555
|
+
|
95556
|
+
if (prev && next) {
|
95557
|
+
section.classList.remove('stack-top');
|
95558
|
+
section.classList.add('stack-middle');
|
95559
|
+
section.classList.remove('stack-bottom');
|
95560
|
+
}
|
95561
|
+
});
|
95562
|
+
}
|
95563
|
+
|
94971
95564
|
addIdea(newArea) {
|
94972
95565
|
this.editor.saveForUndo();
|
94973
95566
|
const designPath = this.designPath;
|
@@ -95109,31 +95702,42 @@ class ContentBox {
|
|
95109
95702
|
}
|
95110
95703
|
} // arrSections.push(newSection);
|
95111
95704
|
// Check up to 3 sections (in case a template has up to 3 sections)
|
95705
|
+
// let prevSection = newSection.previousElementSibling;
|
95706
|
+
// if(prevSection) {
|
95707
|
+
// let ok = prevSection.querySelector('.is-section-tool');
|
95708
|
+
// if(!ok) {
|
95709
|
+
// arrSections.push(prevSection);
|
95710
|
+
// }
|
95711
|
+
// prevSection = prevSection.previousElementSibling;
|
95712
|
+
// if(prevSection) {
|
95713
|
+
// ok = prevSection.querySelector('.is-section-tool');
|
95714
|
+
// if(!ok) {
|
95715
|
+
// arrSections.push(prevSection);
|
95716
|
+
// }
|
95717
|
+
// // more sections here
|
95718
|
+
// }
|
95719
|
+
// }
|
95720
|
+
// Check all sections
|
95112
95721
|
|
95113
95722
|
|
95114
|
-
|
95115
|
-
|
95116
|
-
|
95117
|
-
let ok = prevSection.querySelector('.is-section-tool');
|
95723
|
+
const sections = this.wrapperEl.querySelectorAll('.is-section');
|
95724
|
+
sections.forEach(section => {
|
95725
|
+
let ok = section.querySelector('.is-section-tool');
|
95118
95726
|
|
95119
95727
|
if (!ok) {
|
95120
|
-
arrSections.push(
|
95728
|
+
arrSections.push(section);
|
95121
95729
|
}
|
95122
|
-
|
95123
|
-
prevSection = prevSection.previousElementSibling;
|
95124
|
-
|
95125
|
-
if (prevSection) {
|
95126
|
-
ok = prevSection.querySelector('.is-section-tool');
|
95127
|
-
|
95128
|
-
if (!ok) {
|
95129
|
-
arrSections.push(prevSection);
|
95130
|
-
}
|
95131
|
-
}
|
95132
|
-
}
|
95133
|
-
|
95730
|
+
});
|
95134
95731
|
arrSections.forEach(section => {
|
95135
95732
|
// Code Blocks Handling
|
95136
|
-
let codeBlocks = section.querySelectorAll('.is-overlay-content[data-module]');
|
95733
|
+
// let codeBlocks = section.querySelectorAll('.is-overlay-content[data-module]');
|
95734
|
+
// codeBlocks.forEach(element => {
|
95735
|
+
// let html = (decodeURIComponent(element.getAttribute('data-html'))); // Original code is stored in data-html attribute
|
95736
|
+
// html = html.replace(/{id}/g, dom.uniqueId());
|
95737
|
+
// //Fill the block with original code
|
95738
|
+
// dom.html(element, html);
|
95739
|
+
// });
|
95740
|
+
let codeBlocks = section.querySelectorAll('[data-html]');
|
95137
95741
|
codeBlocks.forEach(element => {
|
95138
95742
|
let html = decodeURIComponent(element.getAttribute('data-html')); // Original code is stored in data-html attribute
|
95139
95743
|
|
@@ -95187,7 +95791,8 @@ class ContentBox {
|
|
95187
95791
|
e.stopImmediatePropagation();
|
95188
95792
|
return false;
|
95189
95793
|
});
|
95190
|
-
});
|
95794
|
+
});
|
95795
|
+
this.sectionStack(); //Trigger Change event
|
95191
95796
|
|
95192
95797
|
this.onChange();
|
95193
95798
|
dom.removeElement(document.querySelector('.is-sidebar-overlay'));
|
@@ -95420,11 +96025,11 @@ class ContentBox {
|
|
95420
96025
|
let btnHtml;
|
95421
96026
|
|
95422
96027
|
if (btn.src) {
|
95423
|
-
btnHtml = '<button id="' + btnId + '" tabindex="-1" class="is-sidebar-button" data-content="' + panelId + '" data-src="' + btn.src + '" data-title="' + out(btn.title) + '" title="' + out(btn.title) + '">' + btn.html + '</button>';
|
96028
|
+
btnHtml = '<button type="button" id="' + btnId + '" tabindex="-1" class="is-sidebar-button" data-content="' + panelId + '" data-src="' + btn.src + '" data-title="' + out(btn.title) + '" title="' + out(btn.title) + '">' + btn.html + '</button>';
|
95424
96029
|
var panelHtml = '<div id="' + panelId + '" class="is-sidebar-content ' + btn.class + '" style="-webkit-transition-duration:0.2s;transition-duration:0.2s;">' + '<div>' + '<iframe src="about:blank" style="width:100%;height:100%;box-sizing:border-box;border:none;">' + '</iframe>' + '</div>' + '</div>';
|
95425
96030
|
dom.appendHtml(builderStuff, panelHtml);
|
95426
96031
|
} else {
|
95427
|
-
btnHtml = '<button id="' + btnId + '" tabindex="-1" class="is-sidebar-button" data-title="' + out(btn.title) + '" title="' + out(btn.title) + '">' + btn.html + '</button>';
|
96032
|
+
btnHtml = '<button type="button" id="' + btnId + '" tabindex="-1" class="is-sidebar-button" data-title="' + out(btn.title) + '" title="' + out(btn.title) + '">' + btn.html + '</button>';
|
95428
96033
|
}
|
95429
96034
|
|
95430
96035
|
const sidebar = builderStuff.querySelector('.is-sidebar');
|
@@ -95712,40 +96317,38 @@ class ContentBox {
|
|
95712
96317
|
}
|
95713
96318
|
|
95714
96319
|
cleanupUnused() {
|
96320
|
+
/*
|
95715
96321
|
let links = this.doc.getElementsByTagName('link');
|
95716
|
-
|
95717
96322
|
for (let i = 0; i < links.length; i++) {
|
95718
|
-
|
95719
|
-
|
95720
|
-
|
95721
|
-
|
95722
|
-
|
95723
|
-
|
95724
|
-
|
95725
|
-
|
95726
|
-
|
95727
|
-
|
95728
|
-
|
95729
|
-
|
95730
|
-
|
95731
|
-
|
95732
|
-
|
95733
|
-
|
95734
|
-
|
95735
|
-
|
95736
|
-
|
95737
|
-
|
95738
|
-
|
95739
|
-
|
95740
|
-
|
95741
|
-
links[i].setAttribute('data-rel', '_del');
|
95742
|
-
}
|
96323
|
+
//Remove unused google font links
|
96324
|
+
let src = links[i].getAttribute('href');
|
96325
|
+
if (src.indexOf('googleapis') !== -1) {
|
96326
|
+
//get fontname
|
96327
|
+
src = src.replace(/\+/g, ' ').replace(/%20/g, ' ');
|
96328
|
+
let fontname = src.substr(src.indexOf('family=') + 7);
|
96329
|
+
if (fontname.indexOf(':') != -1) {
|
96330
|
+
fontname = fontname.split(':')[0];
|
96331
|
+
}
|
96332
|
+
fontname = fontname.toLowerCase();
|
96333
|
+
//check if fontname used in content
|
96334
|
+
let exist = false;
|
96335
|
+
let tmp = this.wrapperEl.innerHTML.toLowerCase();
|
96336
|
+
let count = tmp.split(fontname).length;
|
96337
|
+
if (count >= 3) exist = true;
|
96338
|
+
if (!exist) {
|
96339
|
+
let attr = links[i].getAttribute('data-protect');
|
96340
|
+
if (typeof attr !== typeof undefined && attr !== false) {
|
96341
|
+
//do not delete
|
96342
|
+
} else {
|
96343
|
+
links[i].setAttribute('data-rel', '_del');
|
96344
|
+
}
|
96345
|
+
}
|
95743
96346
|
}
|
95744
|
-
|
95745
|
-
|
95746
|
-
|
96347
|
+
}
|
96348
|
+
*/
|
96349
|
+
this.editor.rte.cleanupFontCssLink(); //Cleanup unused contentstyles
|
95747
96350
|
|
95748
|
-
links = this.doc.getElementsByTagName('link');
|
96351
|
+
let links = this.doc.getElementsByTagName('link');
|
95749
96352
|
|
95750
96353
|
for (let i = 0; i < links.length; i++) {
|
95751
96354
|
if (links[i].getAttribute('data-name') === 'contentstyle') {
|