@innovastudio/contentbuilder 1.4.69 → 1.4.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.4.69",
4
+ "version": "1.4.71",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -3932,6 +3932,71 @@ class Util {
3932
3932
  return s;
3933
3933
  }
3934
3934
  }
3935
+ showMessage(message) {
3936
+ const dom = this.dom;
3937
+ let html = '';
3938
+ html = `<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
3939
+ <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">
3940
+ <div style="margin: 20px 0 30px;font-size: 17px;">${message}</div>
3941
+ <button title="${this.out('Ok')}" class="input-ok classic focus-warning">${this.out('Ok')}</button>
3942
+ </div>
3943
+ </div>`;
3944
+ const builderStuff = this.builder.builderStuff;
3945
+ let modalMessage = builderStuff.querySelector('.modalmessage');
3946
+ if (!modalMessage) {
3947
+ dom.appendHtml(builderStuff, html);
3948
+ modalMessage = builderStuff.querySelector('.modalmessage');
3949
+ }
3950
+ this.showModal(modalMessage, false, () => {
3951
+ modalMessage.parentNode.removeChild(modalMessage);
3952
+ });
3953
+ let buttonok = modalMessage.querySelector('.modalmessage .input-ok');
3954
+ dom.addEventListener(buttonok, 'click', () => {
3955
+ this.hideModal(modalMessage);
3956
+ modalMessage.parentNode.removeChild(modalMessage);
3957
+ });
3958
+ }
3959
+ showChoice(message, yestext, callback) {
3960
+ const dom = this.dom;
3961
+ let html = '';
3962
+ html = `<div class="is-modal modalmessage" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
3963
+ <div class="is-modal-content" style="padding-top: 15px;padding-bottom: 20px;max-width: 450px;">
3964
+ <div style="margin: 20px 0 30px;font-size: 17px;">${message}</div>
3965
+
3966
+ <div style="display:flex;">
3967
+ <button title="${this.out('Cancel')}" class="input-cancel classic-secondary" style="width:100%;margin-right:4px;">${this.out('Cancel')}</button>
3968
+ <button title="${yestext}" class="input-ok classic-primary" style="width:100%">${yestext}</button>
3969
+ </div>
3970
+ </div>
3971
+ </div>`;
3972
+ const builderStuff = this.builder.builderStuff;
3973
+ let modalMessage = builderStuff.querySelector('.modalmessage');
3974
+ if (!modalMessage) {
3975
+ dom.appendHtml(builderStuff, html);
3976
+ modalMessage = builderStuff.querySelector('.modalmessage');
3977
+ }
3978
+ this.showModal(modalMessage, false, () => {
3979
+ //this function runs when overlay is clicked. Remove modal.
3980
+ modalMessage.parentNode.removeChild(modalMessage);
3981
+ callback(false);
3982
+ });
3983
+ let btnCancel = modalMessage.querySelector('.modalmessage .input-cancel');
3984
+ dom.addEventListener(btnCancel, 'click', () => {
3985
+ this.hideModal(modalMessage);
3986
+ modalMessage.parentNode.removeChild(modalMessage); //remove modal
3987
+
3988
+ callback(false);
3989
+ });
3990
+ btnCancel.focus();
3991
+ let btnOk = modalMessage.querySelector('.modalmessage .input-ok');
3992
+ dom.addEventListener(btnOk, 'click', () => {
3993
+ this.hideModal(modalMessage);
3994
+ modalMessage.parentNode.removeChild(modalMessage); //remove modal
3995
+
3996
+ //do task
3997
+ callback(true);
3998
+ });
3999
+ }
3935
4000
  confirm(message, callback, yesno, yestext) {
3936
4001
  if (!this.builder.deleteConfirm) {
3937
4002
  callback(true);