@innovastudio/contentbuilder 1.4.2 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/license.txt +15 -6
- package/package.json +1 -1
- package/public/contentbuilder/contentbuilder.css +20 -0
- package/public/contentbuilder/contentbuilder.esm.js +389 -19
- package/public/contentbuilder/contentbuilder.min.js +8 -8
- package/public/contentbuilder/lang/en.js +4 -1
- package/public/contentbuilder/lang/fr.js +4 -1
- package/public/contentbuilder/plugins/preview/plugin.js +1 -1
@@ -16232,6 +16232,11 @@ const prepareSvgIcons = builder => {
|
|
16232
16232
|
|
16233
16233
|
|
16234
16234
|
|
16235
|
+
<symbol id="icon-reload" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
16236
|
+
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
16237
|
+
<path d="M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1.002 7.935 1.007 9.425 4.747"></path>
|
16238
|
+
<path d="M20 4v5h-5"></path>
|
16239
|
+
</symbol>
|
16235
16240
|
<symbol id="icon-devices" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
16236
16241
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
16237
16242
|
<rect x="13" y="8" width="8" height="12" rx="1"></rect>
|
@@ -18714,6 +18719,7 @@ class Draggable$1 {
|
|
18714
18719
|
dragStart(e) {
|
18715
18720
|
if (!e.target.hasAttribute('draggable')) return; //any child element (ex. close button) should not be draggable. LATER: revew.
|
18716
18721
|
|
18722
|
+
e.target.parentNode.style.transition = 'none';
|
18717
18723
|
dragActive = true;
|
18718
18724
|
activeDraggableBox = e.target.parentElement;
|
18719
18725
|
var xOffset;
|
@@ -18747,7 +18753,8 @@ class Draggable$1 {
|
|
18747
18753
|
|
18748
18754
|
dragEnd(e) {
|
18749
18755
|
if (!e.target.hasAttribute('draggable')) return; //any child element (ex. close button) should not be draggable. LATER: revew.
|
18750
|
-
|
18756
|
+
|
18757
|
+
e.target.parentNode.style.transition = ''; //Update
|
18751
18758
|
|
18752
18759
|
currentX = activeDraggableBox.getAttribute('data-currentX');
|
18753
18760
|
currentY = activeDraggableBox.getAttribute('data-currentY');
|
@@ -57721,6 +57728,7 @@ class RowTool {
|
|
57721
57728
|
btnVisible.addEventListener('click', () => {
|
57722
57729
|
let row = util.rowSelected();
|
57723
57730
|
if (!row) return;
|
57731
|
+
this.builder.uo.saveForUndo();
|
57724
57732
|
row.classList.remove('hideonmobile');
|
57725
57733
|
let divTarget = this.rowSettings.querySelector('.div-target');
|
57726
57734
|
let target = this.builder.responsive.readTarget(divTarget);
|
@@ -57736,11 +57744,14 @@ class RowTool {
|
|
57736
57744
|
}
|
57737
57745
|
|
57738
57746
|
btnVisible.classList.add('on');
|
57739
|
-
btnHidden.classList.remove('on');
|
57747
|
+
btnHidden.classList.remove('on'); //Trigger Change event
|
57748
|
+
|
57749
|
+
this.builder.opts.onChange();
|
57740
57750
|
});
|
57741
57751
|
btnHidden.addEventListener('click', () => {
|
57742
57752
|
let row = util.rowSelected();
|
57743
57753
|
if (!row) return;
|
57754
|
+
this.builder.uo.saveForUndo();
|
57744
57755
|
row.classList.remove('hideonmobile');
|
57745
57756
|
let divTarget = this.rowSettings.querySelector('.div-target');
|
57746
57757
|
let target = this.builder.responsive.readTarget(divTarget);
|
@@ -57756,7 +57767,9 @@ class RowTool {
|
|
57756
57767
|
}
|
57757
57768
|
|
57758
57769
|
btnVisible.classList.remove('on');
|
57759
|
-
btnHidden.classList.add('on');
|
57770
|
+
btnHidden.classList.add('on'); //Trigger Change event
|
57771
|
+
|
57772
|
+
this.builder.opts.onChange();
|
57760
57773
|
}); //More
|
57761
57774
|
|
57762
57775
|
let inpRowId = rowSettings.querySelector('.input-row-id');
|
@@ -60160,6 +60173,7 @@ class ColumnTool {
|
|
60160
60173
|
btnVisible.addEventListener('click', () => {
|
60161
60174
|
let cell = this.util.cellSelected();
|
60162
60175
|
if (!cell) return;
|
60176
|
+
this.builder.uo.saveForUndo();
|
60163
60177
|
cell.classList.remove('hideonmobile');
|
60164
60178
|
let divTarget = this.cellSettings.querySelector('.div-target');
|
60165
60179
|
let target = this.builder.responsive.readTarget(divTarget);
|
@@ -60177,11 +60191,14 @@ class ColumnTool {
|
|
60177
60191
|
}
|
60178
60192
|
|
60179
60193
|
btnVisible.classList.add('on');
|
60180
|
-
btnHidden.classList.remove('on');
|
60194
|
+
btnHidden.classList.remove('on'); //Trigger Change event
|
60195
|
+
|
60196
|
+
this.builder.opts.onChange();
|
60181
60197
|
});
|
60182
60198
|
btnHidden.addEventListener('click', () => {
|
60183
60199
|
let cell = this.util.cellSelected();
|
60184
60200
|
if (!cell) return;
|
60201
|
+
this.builder.uo.saveForUndo();
|
60185
60202
|
cell.classList.remove('hideonmobile');
|
60186
60203
|
let divTarget = this.cellSettings.querySelector('.div-target');
|
60187
60204
|
let target = this.builder.responsive.readTarget(divTarget);
|
@@ -60199,7 +60216,9 @@ class ColumnTool {
|
|
60199
60216
|
}
|
60200
60217
|
|
60201
60218
|
btnVisible.classList.remove('on');
|
60202
|
-
btnHidden.classList.add('on');
|
60219
|
+
btnHidden.classList.add('on'); //Trigger Change event
|
60220
|
+
|
60221
|
+
this.builder.opts.onChange();
|
60203
60222
|
});
|
60204
60223
|
}
|
60205
60224
|
|
@@ -61428,6 +61447,7 @@ class ElementGeneralStyles {
|
|
61428
61447
|
let btnHidden = panelStuff.querySelector('.input-hidden');
|
61429
61448
|
btnVisible.addEventListener('click', () => {
|
61430
61449
|
const elm = this.builder.inspectedElement;
|
61450
|
+
this.builder.uo.saveForUndo();
|
61431
61451
|
elm.classList.remove('hideonmobile');
|
61432
61452
|
let divTarget = panelStuff.querySelector('.div-target');
|
61433
61453
|
let target = this.builder.responsive.readTarget(divTarget);
|
@@ -61443,10 +61463,13 @@ class ElementGeneralStyles {
|
|
61443
61463
|
}
|
61444
61464
|
|
61445
61465
|
btnVisible.classList.add('on');
|
61446
|
-
btnHidden.classList.remove('on');
|
61466
|
+
btnHidden.classList.remove('on'); //Trigger Change event
|
61467
|
+
|
61468
|
+
this.builder.opts.onChange();
|
61447
61469
|
});
|
61448
61470
|
btnHidden.addEventListener('click', () => {
|
61449
61471
|
const elm = this.builder.inspectedElement;
|
61472
|
+
this.builder.uo.saveForUndo();
|
61450
61473
|
elm.classList.remove('hideonmobile');
|
61451
61474
|
let divTarget = panelStuff.querySelector('.div-target');
|
61452
61475
|
let target = this.builder.responsive.readTarget(divTarget);
|
@@ -61462,7 +61485,9 @@ class ElementGeneralStyles {
|
|
61462
61485
|
}
|
61463
61486
|
|
61464
61487
|
btnVisible.classList.remove('on');
|
61465
|
-
btnHidden.classList.add('on');
|
61488
|
+
btnHidden.classList.add('on'); //Trigger Change event
|
61489
|
+
|
61490
|
+
this.builder.opts.onChange();
|
61466
61491
|
});
|
61467
61492
|
}
|
61468
61493
|
|
@@ -67982,7 +68007,7 @@ class Rte {
|
|
67982
68007
|
|
67983
68008
|
if (!rteTool) {
|
67984
68009
|
if (builder.plugins.length > 0) {
|
67985
|
-
let allButtons = ['|', 'addsnippet', 'bold', 'italic', 'underline', 'formatting', 'color', 'removeformat', 'align', 'textsettings', 'createlink', 'tags', 'undo', 'redo', 'zoom', 'icon', 'image', 'list', 'font', 'formatpara', 'gridtool', 'html', 'preferences', 'more', 'left', 'center', 'right', 'full'];
|
68010
|
+
let allButtons = ['|', 'addsnippet', 'bold', 'italic', 'underline', 'formatting', 'color', 'removeformat', 'align', 'textsettings', 'createlink', 'tags', 'undo', 'redo', 'zoom', 'livepreview', 'icon', 'image', 'list', 'font', 'formatpara', 'gridtool', 'html', 'preferences', 'more', 'left', 'center', 'right', 'full'];
|
67986
68011
|
|
67987
68012
|
const filterButtons = myArray => {
|
67988
68013
|
let newArray = myArray;
|
@@ -68004,7 +68029,12 @@ class Rte {
|
|
68004
68029
|
newArray = newArray.filter(e => e !== item);
|
68005
68030
|
}
|
68006
68031
|
}
|
68007
|
-
});
|
68032
|
+
}); // if(!this.builder.previewURL && newArray.indexOf('livepreview')!==-1) {
|
68033
|
+
// newArray = newArray.filter((item)=>{
|
68034
|
+
// return item !== 'livepreview';
|
68035
|
+
// });
|
68036
|
+
// }
|
68037
|
+
|
68008
68038
|
return newArray;
|
68009
68039
|
};
|
68010
68040
|
|
@@ -68032,7 +68062,7 @@ class Rte {
|
|
68032
68062
|
for (var j = 0; j < builder.opts.buttonsMore.length; j++) {
|
68033
68063
|
var btn = builder.opts.buttonsMore[j].toLowerCase();
|
68034
68064
|
if (btn === 'createlink') html_rtemore += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_rtemore += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px;"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'removeformat') html_rtemore += `<button tabindex="-1" title="${util.out('Clean')}" class="rte-clean"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>`;else if (btn === 'bold') html_rtemore += `<button tabindex="-1" title="${util.out('Bold')}" class="rte-format" data-command="bold"><span style="font-family:serif;font-size:14px;">B</span></button>`;else if (btn === 'italic') html_rtemore += `<button tabindex="-1" title="${util.out('Italic')}" class="rte-format" data-command="italic"><span style="font-family:serif;font-size:16px;font-style:italic;">i</span></button>`;else if (btn === 'underline') html_rtemore += `<button tabindex="-1" title="${util.out('Underline')}" class="rte-format" data-command="underline"><span style="font-family:serif;font-size:14px;text-decoration:underline;">U</span></button>`; // else if(btn==='createlink') html_rtemore += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;
|
68035
|
-
else if (btn === 'align') html_rtemore += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'list') html_rtemore += `<button tabindex="-1" title="${util.out('List')}" class="rte-list"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-list-bullet"></use></svg></button>`;else if (btn === 'color') html_rtemore += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'formatting') html_rtemore += `<button tabindex="-1" title="${util.out('Formatting')}" class="rte-formatting"><span style="font-family:serif;font-size:15px;display:inline-block;">A</span></button>`;else if (btn === 'tags') html_rtemore += customtag_button;else if (btn === 'image') html_rtemore += `<button tabindex="-1" title="${util.out('Image')}" class="rte-image"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-image"></use></svg></button>`;else if (btn === 'gridtool') html_rtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_rtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_rtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_rtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'formatpara') html_rtemore += `<button tabindex="-1" title="${util.out('Paragraph')}" class="rte-paragraph"><span style="font-family:serif;font-size:14px;display:inline-block;margin-top:2px;">H</span></button>`;else if (btn === 'font') html_rtemore += `<button tabindex="-1" title="${util.out('Font')}" class="rte-fontfamily"><span style="font-family:serif;font-size:18px;text-transform:none;display:inline-block;margin-top: -3px;">a</span></button>`;else if (btn === 'textsettings') html_rtemore += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_rtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_rtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'zoom') html_rtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === '|') {
|
68065
|
+
else if (btn === 'align') html_rtemore += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'list') html_rtemore += `<button tabindex="-1" title="${util.out('List')}" class="rte-list"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-list-bullet"></use></svg></button>`;else if (btn === 'color') html_rtemore += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'formatting') html_rtemore += `<button tabindex="-1" title="${util.out('Formatting')}" class="rte-formatting"><span style="font-family:serif;font-size:15px;display:inline-block;">A</span></button>`;else if (btn === 'tags') html_rtemore += customtag_button;else if (btn === 'image') html_rtemore += `<button tabindex="-1" title="${util.out('Image')}" class="rte-image"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-image"></use></svg></button>`;else if (btn === 'gridtool') html_rtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_rtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_rtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_rtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'formatpara') html_rtemore += `<button tabindex="-1" title="${util.out('Paragraph')}" class="rte-paragraph"><span style="font-family:serif;font-size:14px;display:inline-block;margin-top:2px;">H</span></button>`;else if (btn === 'font') html_rtemore += `<button tabindex="-1" title="${util.out('Font')}" class="rte-fontfamily"><span style="font-family:serif;font-size:18px;text-transform:none;display:inline-block;margin-top: -3px;">a</span></button>`;else if (btn === 'textsettings') html_rtemore += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_rtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_rtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'zoom') html_rtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_rtemore += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;"><use xlink:href="#icon-devices"></use></svg></button>`;else if (btn === '|') {
|
68036
68066
|
html_rtemore += '<div class="rte-separator"></div>';
|
68037
68067
|
} else {
|
68038
68068
|
html_rtemore += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
|
@@ -68043,7 +68073,7 @@ class Rte {
|
|
68043
68073
|
|
68044
68074
|
for (j = 0; j < builder.opts.buttons.length; j++) {
|
68045
68075
|
btn = builder.opts.buttons[j].toLowerCase();
|
68046
|
-
if (btn === 'bold') html_rte += `<button tabindex="-1" title="${util.out('Bold')}" class="rte-format" data-command="bold"><span style="font-family:serif;font-size:14px;">B</span></button>`;else if (btn === 'italic') html_rte += `<button tabindex="-1" title="${util.out('Italic')}" class="rte-format" data-command="italic"><span style="font-family:serif;font-size:16px;font-style:italic;">i</span></button>`;else if (btn === 'underline') html_rte += `<button tabindex="-1" title="${util.out('Underline')}" class="rte-format" data-command="underline"><span style="font-family:serif;font-size:14px;text-decoration:underline;">U</span></button>`;else if (btn === 'createlink') html_rte += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'align') html_rte += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'formatpara') html_rte += `<button tabindex="-1" title="${util.out('Paragraph')}" class="rte-paragraph"><span style="font-family:serif;font-size:14px;display:inline-block;margin-top:2px;">H</span></button>`;else if (btn === 'color') html_rte += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'formatting') html_rte += `<button tabindex="-1" title="${util.out('Formatting')}" class="rte-formatting"><span style="font-family:serif;font-size:15px;display:inline-block;">A</span></button>`;else if (btn === 'list') html_rte += `<button tabindex="-1" title="${util.out('List')}" class="rte-list"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-list-bullet"></use></svg></button>`;else if (btn === 'textsettings') html_rte += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_rte += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'tags') html_rte += customtag_button;else if (btn === 'removeformat') html_rte += `<button tabindex="-1" title="${util.out('Clean')}" class="rte-format" data-command="clean"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>`;else if (btn === 'font') html_rte += `<button tabindex="-1" title="${util.out('Font')}" class="rte-fontfamily"><span style="font-family:serif;font-size:18px;text-transform:none;display:inline-block;margin-top: -3px;">a</span></button>`;else if (btn === 'image') html_rte += `<button tabindex="-1" title="${util.out('Image')}" class="rte-image"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-image"></use></svg></button>`;else if (btn === 'gridtool') html_rte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;width:17px;height:17px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_rte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_rte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_rte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'undo') html_rte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_rte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'more' && html_rtemore !== '') html_rte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === 'zoom') html_rte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === '|') {
|
68076
|
+
if (btn === 'bold') html_rte += `<button tabindex="-1" title="${util.out('Bold')}" class="rte-format" data-command="bold"><span style="font-family:serif;font-size:14px;">B</span></button>`;else if (btn === 'italic') html_rte += `<button tabindex="-1" title="${util.out('Italic')}" class="rte-format" data-command="italic"><span style="font-family:serif;font-size:16px;font-style:italic;">i</span></button>`;else if (btn === 'underline') html_rte += `<button tabindex="-1" title="${util.out('Underline')}" class="rte-format" data-command="underline"><span style="font-family:serif;font-size:14px;text-decoration:underline;">U</span></button>`;else if (btn === 'createlink') html_rte += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'align') html_rte += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'formatpara') html_rte += `<button tabindex="-1" title="${util.out('Paragraph')}" class="rte-paragraph"><span style="font-family:serif;font-size:14px;display:inline-block;margin-top:2px;">H</span></button>`;else if (btn === 'color') html_rte += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'formatting') html_rte += `<button tabindex="-1" title="${util.out('Formatting')}" class="rte-formatting"><span style="font-family:serif;font-size:15px;display:inline-block;">A</span></button>`;else if (btn === 'list') html_rte += `<button tabindex="-1" title="${util.out('List')}" class="rte-list"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#icon-list-bullet"></use></svg></button>`;else if (btn === 'textsettings') html_rte += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_rte += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'tags') html_rte += customtag_button;else if (btn === 'removeformat') html_rte += `<button tabindex="-1" title="${util.out('Clean')}" class="rte-format" data-command="clean"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>`;else if (btn === 'font') html_rte += `<button tabindex="-1" title="${util.out('Font')}" class="rte-fontfamily"><span style="font-family:serif;font-size:18px;text-transform:none;display:inline-block;margin-top: -3px;">a</span></button>`;else if (btn === 'image') html_rte += `<button tabindex="-1" title="${util.out('Image')}" class="rte-image"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-image"></use></svg></button>`;else if (btn === 'gridtool') html_rte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;width:17px;height:17px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_rte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_rte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_rte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'undo') html_rte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_rte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'more' && html_rtemore !== '') html_rte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === 'zoom') html_rte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_rte += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;"><use xlink:href="#icon-devices"></use></svg></button>`;else if (btn === '|') {
|
68047
68077
|
html_rte += '<div class="rte-separator"></div>';
|
68048
68078
|
} else {
|
68049
68079
|
html_rte += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
|
@@ -68063,7 +68093,7 @@ class Rte {
|
|
68063
68093
|
|
68064
68094
|
for (j = 0; j < builder.opts.elementButtonsMore.length; j++) {
|
68065
68095
|
btn = builder.opts.elementButtonsMore[j].toLowerCase();
|
68066
|
-
if (btn === 'left') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Left')}" data-align="left"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-left"></use></svg></button>`;else if (btn === 'center') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Center')}" data-align="center"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-center"></use></svg></button>`;else if (btn === 'right') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Right')}" data-align="right"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-right"></use></svg></button>`;else if (btn === 'full') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Full')}" data-align="justify"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'gridtool') html_elementrtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_elementrtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_elementrtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_elementrtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'undo') html_elementrtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_elementrtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'zoom') html_elementrtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === '|') {
|
68096
|
+
if (btn === 'left') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Left')}" data-align="left"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-left"></use></svg></button>`;else if (btn === 'center') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Center')}" data-align="center"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-center"></use></svg></button>`;else if (btn === 'right') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Right')}" data-align="right"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-right"></use></svg></button>`;else if (btn === 'full') html_elementrtemore += `<button tabindex="-1" title="${util.out('Align Full')}" data-align="justify"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'gridtool') html_elementrtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_elementrtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_elementrtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_elementrtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'undo') html_elementrtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_elementrtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'zoom') html_elementrtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_elementrtemore += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;"><use xlink:href="#icon-devices"></use></svg></button>`;else if (btn === '|') {
|
68067
68097
|
html_elementrtemore += '<div class="rte-separator"></div>';
|
68068
68098
|
} else {
|
68069
68099
|
html_elementrtemore += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
|
@@ -68074,7 +68104,7 @@ class Rte {
|
|
68074
68104
|
|
68075
68105
|
for (j = 0; j < builder.opts.elementButtons.length; j++) {
|
68076
68106
|
btn = builder.opts.elementButtons[j].toLowerCase();
|
68077
|
-
if (btn === 'left') html_elementrte += `<button tabindex="-1" title="${util.out('Align Left')}" data-align="left"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-left"></use></svg></button>`;else if (btn === 'center') html_elementrte += `<button tabindex="-1" title="${util.out('Align Center')}" data-align="center"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-center"></use></svg></button>`;else if (btn === 'right') html_elementrte += `<button tabindex="-1" title="${util.out('Align Right')}" data-align="right"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-right"></use></svg></button>`;else if (btn === 'full') html_elementrte += `<button tabindex="-1" title="${util.out('Align Full')}" data-align="justify"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'gridtool') html_elementrte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;width:17px;height:17px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_elementrte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_elementrte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_elementrte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'undo') html_elementrte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_elementrte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'more' && html_elementrtemore !== '') html_elementrte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === 'zoom') html_elementrte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === '|') {
|
68107
|
+
if (btn === 'left') html_elementrte += `<button tabindex="-1" title="${util.out('Align Left')}" data-align="left"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-left"></use></svg></button>`;else if (btn === 'center') html_elementrte += `<button tabindex="-1" title="${util.out('Align Center')}" data-align="center"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-center"></use></svg></button>`;else if (btn === 'right') html_elementrte += `<button tabindex="-1" title="${util.out('Align Right')}" data-align="right"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-right"></use></svg></button>`;else if (btn === 'full') html_elementrte += `<button tabindex="-1" title="${util.out('Align Full')}" data-align="justify"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'gridtool') html_elementrte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;width:17px;height:17px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_elementrte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_elementrte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_elementrte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'undo') html_elementrte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_elementrte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'more' && html_elementrtemore !== '') html_elementrte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === 'zoom') html_elementrte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_elementrte += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;"><use xlink:href="#icon-devices"></use></svg></button>`;else if (btn === '|') {
|
68078
68108
|
html_elementrte += '<div class="rte-separator"></div>';
|
68079
68109
|
} else {
|
68080
68110
|
html_elementrte += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
|
@@ -68096,7 +68126,7 @@ class Rte {
|
|
68096
68126
|
|
68097
68127
|
for (j = 0; j < builder.opts.iconButtonsMore.length; j++) {
|
68098
68128
|
btn = builder.opts.iconButtonsMore[j].toLowerCase();
|
68099
|
-
if (btn === 'createlink') html_iconrtemore += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_iconrtemore += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px;"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'align') html_iconrtemore += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'color') html_iconrtemore += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'gridtool') html_iconrtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_iconrtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_iconrtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_iconrtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'textsettings') html_iconrtemore += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_iconrtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_iconrtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'zoom') html_iconrtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === '|') {
|
68129
|
+
if (btn === 'createlink') html_iconrtemore += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_iconrtemore += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px;"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'align') html_iconrtemore += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'color') html_iconrtemore += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'gridtool') html_iconrtemore += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_iconrtemore += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_iconrtemore += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_iconrtemore += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'textsettings') html_iconrtemore += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_iconrtemore += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_iconrtemore += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'zoom') html_iconrtemore += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_iconrtemore += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;"><use xlink:href="#icon-devices"></use></svg></button>`;else if (btn === '|') {
|
68100
68130
|
html_iconrtemore += '<div class="rte-separator"></div>';
|
68101
68131
|
} else {
|
68102
68132
|
html_iconrtemore += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
|
@@ -68105,7 +68135,7 @@ class Rte {
|
|
68105
68135
|
|
68106
68136
|
for (j = 0; j < builder.opts.iconButtons.length; j++) {
|
68107
68137
|
btn = builder.opts.iconButtons[j].toLowerCase();
|
68108
|
-
if (btn === 'createlink') html_iconrte += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_iconrte += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px;"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'align') html_iconrte += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'color') html_iconrte += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'gridtool') html_iconrte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_iconrte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_iconrte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_iconrte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'textsettings') html_iconrte += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_iconrte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_iconrte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'zoom') html_iconrte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'more' && html_rtemore !== '') html_iconrte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === '|') {
|
68138
|
+
if (btn === 'createlink') html_iconrte += `<button tabindex="-1" title="${util.out('Hyperlink')}" class="rte-link"><svg class="is-icon-flex" style="width:14px;height:14px;"><use xlink:href="#ion-link"></use></svg></button>`;else if (btn === 'icon' && !this.builder.opts.emailMode) html_iconrte += `<button tabindex="-1" title="${util.out('Icon')}" class="rte-icon"><svg class="is-icon-flex" style="width:14px;height:14px;margin-top:2px;"><use xlink:href="#ion-android-happy"></use></svg></button>`;else if (btn === 'align') html_iconrte += `<button tabindex="-1" title="${util.out('Align')}" class="rte-align"><svg class="is-icon-flex" style="width:12px;height:12px;margin-top:-2px;"><use xlink:href="#icon-align-full"></use></svg></button>`;else if (btn === 'color') html_iconrte += `<button tabindex="-1" title="${util.out('Color')}" class="rte-color"><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-contrast"></use></svg></button>`;else if (btn === 'gridtool') html_iconrte += `<button tabindex="-1" title="${util.out('Grid Tool')}" class="rte-grideditor"><svg class="is-icon-flex" style="margin-right:-3px;"><use xlink:href="#ion-grid"></use></svg></button>`;else if (btn === 'html') html_iconrte += `<button tabindex="-1" title="${util.out('HTML')}" class="rte-html"><svg class="is-icon-flex" style="margin-right:-3px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:14px;height:14px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></button>`;else if (btn === 'preferences') html_iconrte += `<button tabindex="-1" title="${util.out('Preferences')}" class="rte-preferences"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-wrench"></use></svg></button>`;else if (btn === 'addsnippet') html_iconrte += `<button tabindex="-1" title="${util.out('Add Snippet')}" class="rte-addsnippet"><svg class="is-icon-flex" style="width:18px;height:18px;margin-top:-1px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>`;else if (btn === 'textsettings') html_iconrte += `<button tabindex="-1" title="${util.out('Text Settings')}" class="rte-textsettings"><svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#ion-ios-settings"></use></svg></button>`;else if (btn === 'undo') html_iconrte += `<button tabindex="-1" title="${util.out('Undo')}" class="rte-undo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-undo"></use></svg></button>`;else if (btn === 'redo') html_iconrte += `<button tabindex="-1" title="${util.out('Redo')}" class="rte-redo"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#ion-ios-redo"></use></svg></button>`;else if (btn === 'zoom') html_iconrte += `<button tabindex="-1" title="${util.out('Zoom')}" class="rte-zoom"><svg class="is-icon-flex" style="margin-top:2px;width:15px;height:15px;"><use xlink:href="#icon-zoom-in"></use></svg></button>`;else if (btn === 'livepreview') html_iconrte += `<button tabindex="-1" title="${util.out('Live Preview')}" class="rte-livepreview"><svg class="is-icon-flex" style="margin-top:2px;"><use xlink:href="#icon-devices"></use></svg></button>`;else if (btn === 'more' && html_rtemore !== '') html_iconrte += `<button tabindex="-1" title="${util.out('More')}" class="rte-more"><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#ion-more"></use></svg></button>`;else if (btn === '|') {
|
68109
68139
|
html_iconrte += '<div class="rte-separator"></div>';
|
68110
68140
|
} else {
|
68111
68141
|
html_iconrte += `<button tabindex="-1" title="button not found" data-plugin="${btn}"></button>`; //temporary (later will be replaced with plugin button)
|
@@ -69095,9 +69125,22 @@ class Rte {
|
|
69095
69125
|
});
|
69096
69126
|
} else {
|
69097
69127
|
dom.removeClass(inputImageInsertSrc, 'image-select');
|
69098
|
-
} //
|
69128
|
+
} // Live Preview
|
69099
69129
|
|
69100
69130
|
|
69131
|
+
let livePreviewButton = builderStuff.querySelectorAll('button.rte-livepreview');
|
69132
|
+
livePreviewButton.forEach(btn => {
|
69133
|
+
dom.addEventListener(btn, 'click', () => {
|
69134
|
+
const modal = builderStuff.querySelector('.is-modal.content-preview');
|
69135
|
+
|
69136
|
+
if (modal.classList.contains('active')) {
|
69137
|
+
this.builder.closePreview();
|
69138
|
+
} else {
|
69139
|
+
this.builder.openPreview();
|
69140
|
+
}
|
69141
|
+
});
|
69142
|
+
}); // Zoom Settings
|
69143
|
+
|
69101
69144
|
let zoomButton = builderStuff.querySelectorAll('button.rte-zoom');
|
69102
69145
|
zoomButton.forEach(btn => {
|
69103
69146
|
dom.addEventListener(btn, 'click', () => {
|
@@ -76444,6 +76487,301 @@ class Responsive {
|
|
76444
76487
|
|
76445
76488
|
}
|
76446
76489
|
|
76490
|
+
class LivePreview {
|
76491
|
+
constructor(builder) {
|
76492
|
+
this.builder = builder;
|
76493
|
+
const util = this.builder.util;
|
76494
|
+
const builderStuff = this.builder.builderStuff;
|
76495
|
+
this.util = util;
|
76496
|
+
this.builderStuff = builderStuff;
|
76497
|
+
const dom = this.builder.dom;
|
76498
|
+
this.dom = dom;
|
76499
|
+
let modal = builderStuff.querySelector('.content-preview');
|
76500
|
+
|
76501
|
+
if (!modal) {
|
76502
|
+
let html = `
|
76503
|
+
<style>
|
76504
|
+
.is-modal.content-preview {
|
76505
|
+
transition: all 0.1s ease;
|
76506
|
+
}
|
76507
|
+
.is-modal.content-preview > div > div {
|
76508
|
+
transition: all 0.1s ease;
|
76509
|
+
}
|
76510
|
+
.is-modal.content-preview .is-modal-refresh,
|
76511
|
+
.is-modal.content-preview .is-modal-device,
|
76512
|
+
.is-modal.content-preview .is-modal-close {
|
76513
|
+
background:transparent !important;
|
76514
|
+
width:32px !important;
|
76515
|
+
height:32px !important;
|
76516
|
+
position:absolute !important;
|
76517
|
+
box-shadow:none !important;
|
76518
|
+
}
|
76519
|
+
.is-modal.content-preview .is-modal-device {
|
76520
|
+
top:2px;
|
76521
|
+
left:2px;
|
76522
|
+
}
|
76523
|
+
.is-modal.content-preview .is-modal-refresh {
|
76524
|
+
top:2px;
|
76525
|
+
right:34px;
|
76526
|
+
}
|
76527
|
+
.is-modal.content-preview .is-modal-close {
|
76528
|
+
top:2px;
|
76529
|
+
right:2px;
|
76530
|
+
}
|
76531
|
+
|
76532
|
+
.is-screen-1920 {
|
76533
|
+
width: 576px !important;
|
76534
|
+
height: 332px !important;
|
76535
|
+
}
|
76536
|
+
.is-screen-1440 {
|
76537
|
+
width: 431px !important;
|
76538
|
+
height: 258px !important;
|
76539
|
+
}
|
76540
|
+
.is-screen-768 {
|
76541
|
+
width: 245px !important;
|
76542
|
+
height: 363px !important;
|
76543
|
+
}
|
76544
|
+
.is-screen-1024 {
|
76545
|
+
width: 328px !important;
|
76546
|
+
height: 281px !important;
|
76547
|
+
}
|
76548
|
+
.is-screen-375 {
|
76549
|
+
width: 167px !important;
|
76550
|
+
height: 332px !important;
|
76551
|
+
}
|
76552
|
+
|
76553
|
+
.is-screen-1920 .preview-screen {
|
76554
|
+
width: 1920px;height: 992px;transform: scale(0.3);
|
76555
|
+
}
|
76556
|
+
.is-screen-1440 .preview-screen {
|
76557
|
+
width: 1440px;height: 744px;transform: scale(0.3);
|
76558
|
+
}
|
76559
|
+
.is-screen-768 .preview-screen {
|
76560
|
+
width: 768px;height: 1024px;transform: scale(0.32);
|
76561
|
+
}
|
76562
|
+
.is-screen-1024 .preview-screen {
|
76563
|
+
width: 1024px;height: 768px;transform: scale(0.32);
|
76564
|
+
}
|
76565
|
+
.is-screen-375 .preview-screen {
|
76566
|
+
width: 375px;height: 667px;transform: scale(0.446);
|
76567
|
+
}
|
76568
|
+
.is-screen-375 .is-modal-bar > span {
|
76569
|
+
display: none;
|
76570
|
+
}
|
76571
|
+
|
76572
|
+
.content-preview:focus-within {
|
76573
|
+
z-index:100021 !important
|
76574
|
+
}
|
76575
|
+
</style>
|
76576
|
+
<div class="is-modal is-modal-content content-preview is-screen-1920" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true" ${this.builder.previewStyle ? `style="${this.builder.previewStyle}"` : ''}>
|
76577
|
+
<div class="is-modal-bar is-draggable" draggable="">
|
76578
|
+
<span>${util.out('Live Preview')}</span>
|
76579
|
+
<button class="is-modal-device" tabindex="-1" style="user-select:none;cursor:default">
|
76580
|
+
|
76581
|
+
</button>
|
76582
|
+
<button class="is-modal-refresh" tabindex="-1" title="${util.out('Reload')}">
|
76583
|
+
<svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#icon-reload"></use></svg>
|
76584
|
+
</button>
|
76585
|
+
<button class="is-modal-close" tabindex="-1" title="${util.out('Close')}">
|
76586
|
+
<svg class="is-icon-flex" style="width:23px;height:23px;"><use xlink:href="#ion-ios-close-empty"></use></svg>
|
76587
|
+
</button>
|
76588
|
+
</div>
|
76589
|
+
<div style="position:relative;position:absolute;top:0;left:0;width:100%;height:100%;border-top:transparent 35px solid;">
|
76590
|
+
<div class="preview-screen" style="padding:0;position: absolute;top: 0;left: 0;box-sizing: border-box;transform-origin: top left;">
|
76591
|
+
<iframe src="about:blank" style="box-sizing:border-box;width: 100%;height: 100%;position:absolute;"></iframe>
|
76592
|
+
</div>
|
76593
|
+
</div>
|
76594
|
+
<div style="position:absolute;left:3px;bottom:3px;border-radius:3px;display:flex;overflow:hidden;">
|
76595
|
+
<button class="is-modal-size" tabindex="-1" title="${util.out('Screen Sizes')}" style="width:30px;height:30px;">
|
76596
|
+
<svg class="is-icon-flex" style="width:23px;height:23px;"><use xlink:href="#icon-devices"></use></svg>
|
76597
|
+
</button>
|
76598
|
+
</div>
|
76599
|
+
</div>
|
76600
|
+
`;
|
76601
|
+
dom.appendHtml(builderStuff, html);
|
76602
|
+
const modal = builderStuff.querySelector('.is-modal.content-preview');
|
76603
|
+
this.modal = modal;
|
76604
|
+
const btnPreviewClose = modal.querySelector('.is-modal-close');
|
76605
|
+
btnPreviewClose.addEventListener('click', () => {
|
76606
|
+
this.closePreview();
|
76607
|
+
});
|
76608
|
+
const btnModalSize = modal.querySelector('.is-modal-size');
|
76609
|
+
const infoDevice = modal.querySelector('.is-modal-device');
|
76610
|
+
btnModalSize.addEventListener('click', () => {
|
76611
|
+
if (modal.classList.contains('is-screen-1920')) {
|
76612
|
+
modal.classList.remove('is-screen-1920');
|
76613
|
+
modal.classList.add('is-screen-1440');
|
76614
|
+
localStorage.setItem('_livepreviewscreen', 'is-screen-1440');
|
76615
|
+
infoDevice.setAttribute('title', util.out('Laptop'));
|
76616
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:18px;height:18px"><use xlink:href="#icon-device-laptop"></use></svg>';
|
76617
|
+
} else if (modal.classList.contains('is-screen-1440')) {
|
76618
|
+
modal.classList.remove('is-screen-1440');
|
76619
|
+
modal.classList.add('is-screen-1024');
|
76620
|
+
infoDevice.setAttribute('title', util.out('Tablet (Landscape)'));
|
76621
|
+
localStorage.setItem('_livepreviewscreen', 'is-screen-1024');
|
76622
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>';
|
76623
|
+
} else if (modal.classList.contains('is-screen-1024')) {
|
76624
|
+
modal.classList.remove('is-screen-1024');
|
76625
|
+
modal.classList.add('is-screen-768');
|
76626
|
+
localStorage.setItem('_livepreviewscreen', 'is-screen-768');
|
76627
|
+
infoDevice.setAttribute('title', util.out('Tablet (Portrait)'));
|
76628
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>';
|
76629
|
+
} else if (modal.classList.contains('is-screen-768')) {
|
76630
|
+
modal.classList.remove('is-screen-768');
|
76631
|
+
modal.classList.add('is-screen-375');
|
76632
|
+
localStorage.setItem('_livepreviewscreen', 'is-screen-375');
|
76633
|
+
infoDevice.setAttribute('title', util.out('Mobile'));
|
76634
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-mobile"></use></svg>';
|
76635
|
+
} else if (modal.classList.contains('is-screen-375')) {
|
76636
|
+
modal.classList.remove('is-screen-375');
|
76637
|
+
modal.classList.add('is-screen-1920');
|
76638
|
+
localStorage.setItem('_livepreviewscreen', 'is-screen-1920');
|
76639
|
+
infoDevice.setAttribute('title', util.out('Desktop'));
|
76640
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-desktop"></use></svg>';
|
76641
|
+
}
|
76642
|
+
|
76643
|
+
this.previewRefresh(true);
|
76644
|
+
});
|
76645
|
+
const btnModalRefresh = modal.querySelector('.is-modal-refresh');
|
76646
|
+
btnModalRefresh.addEventListener('click', () => {
|
76647
|
+
this.previewRefresh();
|
76648
|
+
}); //Extend onChange
|
76649
|
+
|
76650
|
+
let old2 = this.builder.settings.onChange;
|
76651
|
+
|
76652
|
+
this.builder.settings.onChange = () => {
|
76653
|
+
old2.call(this);
|
76654
|
+
this.previewRefresh();
|
76655
|
+
};
|
76656
|
+
}
|
76657
|
+
}
|
76658
|
+
|
76659
|
+
previewRefresh(disableOnContentLoad) {
|
76660
|
+
if (this.modal.classList.contains('active')) {
|
76661
|
+
// let html = this.builder.html();
|
76662
|
+
// localStorage.setItem('preview-html', html);
|
76663
|
+
if (this.builder.onPreviewOpen) this.builder.onPreviewOpen();
|
76664
|
+
const iframe = this.modal.querySelector('iframe');
|
76665
|
+
|
76666
|
+
if (!this.builder.doc.querySelector('.is-wrapper')) {
|
76667
|
+
// ContentBuilder
|
76668
|
+
if (this.builder.previewURL) {
|
76669
|
+
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|
76670
|
+
} else {
|
76671
|
+
this.writeHtml(iframe);
|
76672
|
+
}
|
76673
|
+
} else {
|
76674
|
+
iframe.src = this.builder.previewURL + '?' + Math.floor(Date.now() / 1000);
|
76675
|
+
}
|
76676
|
+
|
76677
|
+
iframe.onload = () => {
|
76678
|
+
if (this.builder.onPreviewContentLoad && !disableOnContentLoad) this.builder.onPreviewContentLoad();
|
76679
|
+
iframe.contentWindow.document.addEventListener('click', () => {
|
76680
|
+
iframe.focus();
|
76681
|
+
});
|
76682
|
+
};
|
76683
|
+
}
|
76684
|
+
}
|
76685
|
+
|
76686
|
+
openPreview() {
|
76687
|
+
// if(!this.builder.previewURL) return;
|
76688
|
+
if (this.modal.classList.contains('active')) return;
|
76689
|
+
const util = this.util;
|
76690
|
+
const modal = this.modal;
|
76691
|
+
modal.classList.add('active');
|
76692
|
+
|
76693
|
+
if (localStorage.getItem('_livepreviewscreen') != null) {
|
76694
|
+
modal.classList.remove('is-screen-1920');
|
76695
|
+
modal.classList.remove('is-screen-1440');
|
76696
|
+
modal.classList.remove('is-screen-1024');
|
76697
|
+
modal.classList.remove('is-screen-768');
|
76698
|
+
modal.classList.remove('is-screen-375');
|
76699
|
+
modal.classList.add(localStorage.getItem('_livepreviewscreen'));
|
76700
|
+
const infoDevice = modal.querySelector('.is-modal-device');
|
76701
|
+
|
76702
|
+
if (modal.classList.contains('is-screen-1920')) {
|
76703
|
+
infoDevice.setAttribute('title', util.out('Desktop'));
|
76704
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-desktop"></use></svg>';
|
76705
|
+
} else if (modal.classList.contains('is-screen-1440')) {
|
76706
|
+
infoDevice.setAttribute('title', util.out('Laptop'));
|
76707
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:18px;height:18px"><use xlink:href="#icon-device-laptop"></use></svg>';
|
76708
|
+
} else if (modal.classList.contains('is-screen-1024')) {
|
76709
|
+
infoDevice.setAttribute('title', util.out('Tablet (Landscape)'));
|
76710
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px;transform:rotate(-90deg)"><use xlink:href="#icon-device-tablet"></use></svg>';
|
76711
|
+
} else if (modal.classList.contains('is-screen-768')) {
|
76712
|
+
infoDevice.setAttribute('title', util.out('Tablet (Portrait)'));
|
76713
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>';
|
76714
|
+
} else if (modal.classList.contains('is-screen-375')) {
|
76715
|
+
infoDevice.setAttribute('title', util.out('Mobile'));
|
76716
|
+
infoDevice.innerHTML = '<svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-mobile"></use></svg>';
|
76717
|
+
}
|
76718
|
+
}
|
76719
|
+
|
76720
|
+
this.previewRefresh();
|
76721
|
+
localStorage.setItem('_livepreview', '1');
|
76722
|
+
}
|
76723
|
+
|
76724
|
+
closePreview() {
|
76725
|
+
const modal = this.modal;
|
76726
|
+
modal.classList.remove('active');
|
76727
|
+
if (this.builder.onPreviewClose) this.builder.onPreviewClose();
|
76728
|
+
localStorage.removeItem('_livepreview');
|
76729
|
+
}
|
76730
|
+
|
76731
|
+
writeHtml(iframe) {
|
76732
|
+
let doc = this.builder.doc;
|
76733
|
+
let basehref = '';
|
76734
|
+
let base = doc.querySelectorAll('base[href]');
|
76735
|
+
|
76736
|
+
if (base.length > 0) {
|
76737
|
+
basehref = '<base href="' + base[0].href + '" />';
|
76738
|
+
}
|
76739
|
+
|
76740
|
+
let csslinks = '';
|
76741
|
+
let styles = doc.querySelectorAll('link[href]');
|
76742
|
+
|
76743
|
+
for (let i = 0; i < styles.length; i++) {
|
76744
|
+
if (styles[i].href.indexOf('.css') != -1 && styles[i].href.indexOf('contentbox.css') == -1 && styles[i].href.indexOf('contentbuilder.css') == -1) {
|
76745
|
+
csslinks += '<link href="' + styles[i].href + '" rel="stylesheet" type="text/css" />';
|
76746
|
+
}
|
76747
|
+
}
|
76748
|
+
|
76749
|
+
let jsincludes1 = '';
|
76750
|
+
let scripts = doc.head.querySelectorAll('script[src]');
|
76751
|
+
|
76752
|
+
for (let i = 0; i < scripts.length; i++) {
|
76753
|
+
if (scripts[i].src.indexOf('.js') != -1 && scripts[i].src.indexOf('_next/') == -1 && //next
|
76754
|
+
scripts[i].src.indexOf('static/js/') == -1 && //react
|
76755
|
+
scripts[i].src.indexOf('src/') == -1 && //vue
|
76756
|
+
scripts[i].src.indexOf('index') == -1 && scripts[i].src.indexOf('contentbox.js') == -1 && scripts[i].src.indexOf('contentbox.min.js') == -1 && scripts[i].src.indexOf('contentbuilder.js') == -1 && scripts[i].src.indexOf('contentbuilder.min.js') == -1 && scripts[i].src.indexOf('plugin.js') == -1 && scripts[i].src.indexOf('config.js') == -1 && scripts[i].src.indexOf('en.js') == -1 && scripts[i].src.indexOf('rangy') == -1 && scripts[i].src.indexOf('minimalist-blocks') == -1) {
|
76757
|
+
jsincludes1 += '<script src="' + scripts[i].src + '" type="text/javascript"></script>';
|
76758
|
+
}
|
76759
|
+
}
|
76760
|
+
|
76761
|
+
let jsincludes2 = '';
|
76762
|
+
scripts = doc.body.querySelectorAll('script[src]');
|
76763
|
+
|
76764
|
+
for (let i = 0; i < scripts.length; i++) {
|
76765
|
+
if (scripts[i].src.indexOf('.js') != -1 && scripts[i].src.indexOf('_next/') == -1 && //next
|
76766
|
+
scripts[i].src.indexOf('static/js/') == -1 && //react
|
76767
|
+
scripts[i].src.indexOf('src/') == -1 && //vue
|
76768
|
+
scripts[i].src.indexOf('index') == -1 && scripts[i].src.indexOf('contentbox.js') == -1 && scripts[i].src.indexOf('contentbox.min.js') == -1 && scripts[i].src.indexOf('contentbuilder.js') == -1 && scripts[i].src.indexOf('contentbuilder.min.js') == -1 && scripts[i].src.indexOf('plugin.js') == -1 && scripts[i].src.indexOf('config.js') == -1 && scripts[i].src.indexOf('en.js') == -1 && scripts[i].src.indexOf('rangy') == -1 && scripts[i].src.indexOf('minimalist-blocks') == -1) {
|
76769
|
+
jsincludes2 += '<script src="' + scripts[i].src + '" type="text/javascript"></script>';
|
76770
|
+
}
|
76771
|
+
}
|
76772
|
+
|
76773
|
+
let maxwidth = '800px';
|
76774
|
+
let maxw = window.getComputedStyle(doc.querySelector('.is-builder')).getPropertyValue('max-width');
|
76775
|
+
if (!isNaN(parseInt(maxw))) maxwidth = maxw;
|
76776
|
+
let content = this.builder.html();
|
76777
|
+
doc = iframe.contentWindow.document;
|
76778
|
+
doc.open();
|
76779
|
+
doc.write('<html>' + '<head>' + basehref + '<meta charset="utf-8">' + '<title></title>' + '<style>#_cbhtml > *:not(.is-lightbox) {display:none}</style>' + csslinks + (this.builder.useLightbox ? '<link href="' + this.builder.assetPath + 'scripts/lightbox/lightbox.css" rel="stylesheet" type="text/css" />' : '') + '<style>' + '.slider-image { display:block !important; }' + '.container {margin:35px auto 0; max-width: ' + maxwidth + '; width:100%; padding:0 20px; box-sizing: border-box;}' + '</style>' + '<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>' + jsincludes1 + '</head>' + '<body>' + '<div class="container preview">' + content + '</div>' + jsincludes2 + (this.builder.useLightbox ? '<script src="' + this.builder.assetPath + 'scripts/lightbox/lightbox.js"></script><script>window.lightbox.init();</script>' : '') + '</body>' + '</html>');
|
76780
|
+
doc.close();
|
76781
|
+
}
|
76782
|
+
|
76783
|
+
}
|
76784
|
+
|
76447
76785
|
class ContentBuilder {
|
76448
76786
|
constructor(opts = {}) {
|
76449
76787
|
let defaults = {
|
@@ -76459,6 +76797,15 @@ class ContentBuilder {
|
|
76459
76797
|
snippetJSON: {
|
76460
76798
|
'snippets': []
|
76461
76799
|
},
|
76800
|
+
// Live Preview
|
76801
|
+
// previewURL: 'preview.html',
|
76802
|
+
onPreviewOpen: () => {
|
76803
|
+
let html = this.html();
|
76804
|
+
localStorage.setItem('preview-html', html);
|
76805
|
+
},
|
76806
|
+
// onPreviewClose: ()=>{},
|
76807
|
+
previewStyle: 'top:auto;bottom:50px;left:50px;right:auto;',
|
76808
|
+
livePreviewOpen: false,
|
76462
76809
|
scriptPath: '',
|
76463
76810
|
// Deprecated
|
76464
76811
|
// Old way:
|
@@ -76588,11 +76935,11 @@ class ContentBuilder {
|
|
76588
76935
|
assetRefresh: false,
|
76589
76936
|
// asset manager specified in imageSelect, fileSelect & videoSelect will always refreshed on click/open
|
76590
76937
|
customTags: [],
|
76591
|
-
buttons: ['bold', 'italic', 'underline', 'formatting', 'color', 'align', 'textsettings', 'createLink', 'tags', '|', 'undo', 'redo', 'zoom', 'more'],
|
76938
|
+
buttons: ['bold', 'italic', 'underline', 'formatting', 'color', 'align', 'textsettings', 'createLink', 'tags', '|', 'undo', 'redo', 'zoom', 'livepreview', 'more'],
|
76592
76939
|
buttonsMore: ['icon', 'image', '|', 'list', 'font', 'formatPara', '|', 'html', 'preferences'],
|
76593
|
-
elementButtons: ['left', 'center', 'right', 'full', 'undo', 'redo', 'zoom', 'more'],
|
76940
|
+
elementButtons: ['left', 'center', 'right', 'full', 'undo', 'redo', 'zoom', 'livepreview', 'more'],
|
76594
76941
|
elementButtonsMore: ['|', 'html', 'preferences'],
|
76595
|
-
iconButtons: ['icon', 'color', 'textsettings', 'createLink', '|', 'undo', 'redo', 'zoom', 'more'],
|
76942
|
+
iconButtons: ['icon', 'color', 'textsettings', 'createLink', '|', 'undo', 'redo', 'zoom', 'livepreview', 'more'],
|
76596
76943
|
iconButtonsMore: ['|', 'html', 'preferences'],
|
76597
76944
|
lang: [],
|
76598
76945
|
checkLang: false,
|
@@ -77241,6 +77588,7 @@ class ContentBuilder {
|
|
77241
77588
|
this.colTool = new ColumnTool(this); // Render Column Tool
|
77242
77589
|
|
77243
77590
|
this._rowTool = new RowTool(this);
|
77591
|
+
this.livePreview = new LivePreview(this);
|
77244
77592
|
this.mediaPicker = new MediaPicker(this); // Extend the onChange function
|
77245
77593
|
|
77246
77594
|
var oldget = this.opts.onChange;
|
@@ -77506,6 +77854,16 @@ class ContentBuilder {
|
|
77506
77854
|
window.selectAsset = this.selectAsset.bind(this);
|
77507
77855
|
window.assetType = this.assetType.bind(this);
|
77508
77856
|
window.hideModal = this.hideModal.bind(this);
|
77857
|
+
setTimeout(() => {
|
77858
|
+
// Remember UI
|
77859
|
+
if (localStorage.getItem('_livepreview') != null) {
|
77860
|
+
this.openPreview();
|
77861
|
+
} else {
|
77862
|
+
if (this.opts.livePreviewOpen) {
|
77863
|
+
this.openPreview();
|
77864
|
+
}
|
77865
|
+
}
|
77866
|
+
}, 300);
|
77509
77867
|
} // constructor
|
77510
77868
|
// Convenience constructor, so that the plugin can be called directly using: ContentBuilder.run({ ... });
|
77511
77869
|
|
@@ -78547,6 +78905,14 @@ class ContentBuilder {
|
|
78547
78905
|
beautify(html) {
|
78548
78906
|
const htmlutil = new HtmlUtil(this);
|
78549
78907
|
return htmlutil.beautify(html);
|
78908
|
+
}
|
78909
|
+
|
78910
|
+
openPreview() {
|
78911
|
+
this.livePreview.openPreview();
|
78912
|
+
}
|
78913
|
+
|
78914
|
+
closePreview() {
|
78915
|
+
this.livePreview.closePreview();
|
78550
78916
|
} // Module related
|
78551
78917
|
|
78552
78918
|
|
@@ -79110,6 +79476,10 @@ class ContentBuilder {
|
|
79110
79476
|
this.opts.onChange(); //Trigger Render event
|
79111
79477
|
|
79112
79478
|
this.opts.onRender();
|
79479
|
+
|
79480
|
+
if (localStorage.getItem('_livepreview') != null) {
|
79481
|
+
this.livePreview.openPreview();
|
79482
|
+
}
|
79113
79483
|
} // loadHtml(html) {
|
79114
79484
|
// let area = this.getScope();
|
79115
79485
|
// area.innerHTML = html;
|