From 431e6a6bd808d6fc8e6f179cf667c2301da373dc Mon Sep 17 00:00:00 2001 From: GedMarc Date: Thu, 11 Aug 2022 00:15:54 +0200 Subject: [PATCH] #46 4.4.3 allow any build with version 5 --- bower.json | 2 +- dist/css/bootstrap-dialog.min.css | 3 ++- dist/css/bootstrap-dialog.min.css.map | 1 + dist/js/bootstrap-dialog.min.js | 2 +- package.json | 2 +- src/js/bootstrap-dialog.min.js | 2 +- update.json | 2 +- 7 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 dist/css/bootstrap-dialog.min.css.map diff --git a/bower.json b/bower.json index a651f90..70bc71b 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "bootstrap4-dialog", "description": "Make use of Bootstrap Modal more monkey-friendly. https://github.com/GedMarc/bootstrap4-dialog", - "version": "4.4.2", + "version": "4.4.3", "keywords": [ "css", "js", diff --git a/dist/css/bootstrap-dialog.min.css b/dist/css/bootstrap-dialog.min.css index 0cdf137..0c2a046 100644 --- a/dist/css/bootstrap-dialog.min.css +++ b/dist/css/bootstrap-dialog.min.css @@ -1 +1,2 @@ -@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.bootstrap-dialog .modal-header{border-top-left-radius:4px;border-top-right-radius:4px}.bootstrap-dialog .bootstrap-dialog-title{color:#fff;display:inline-block;font-size:16px}.bootstrap-dialog .bootstrap-dialog-message{font-size:14px}.bootstrap-dialog .bootstrap-dialog-button-icon{margin-right:3px}.bootstrap-dialog .bootstrap-dialog-close-button{float:right;opacity:.9;filter:alpha(opacity=90)}.bootstrap-dialog .bootstrap-dialog-close-button:hover{cursor:pointer;opacity:1;filter:alpha(opacity=100)}@media (min-width:1172px){.bootstrap-dialog .modal-xl{max-width:95%}}.bootstrap-dialog .modal-lg .bootstrap4-dialog-button:first-child{margin-top:8px}.bootstrap-dialog.type-default .modal-header{background-color:#fff}.bootstrap-dialog.type-default .bootstrap-dialog-title{color:#333}.bootstrap-dialog.type-info .modal-header{background-color:#17a2b8}.bootstrap-dialog.type-primary .modal-header{background-color:#007bff}.bootstrap-dialog.type-secondary .modal-header{background-color:#6c757d}.bootstrap-dialog.type-success .modal-header{background-color:#28a745}.bootstrap-dialog.type-warning .modal-header{background-color:#ffc107}.bootstrap-dialog.type-danger .modal-header{background-color:#dc3545}.bootstrap-dialog.type-light .modal-header{background-color:#f8f9fa}.bootstrap-dialog.type-dark .modal-header{background-color:#343a40}.bootstrap-dialog.size-large .bootstrap-dialog-title{font-size:24px}.bootstrap-dialog.size-large .bootstrap-dialog-close-button{font-size:30px}.bootstrap-dialog.size-large .bootstrap-dialog-message{font-size:18px}.bootstrap-dialog .icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}.bootstrap-dialog-footer-buttons{display:flex}.bootstrap-dialog-header{display:contents} \ No newline at end of file +@-moz-keyframes spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(359deg)}}@-ms-keyframes spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(359deg)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}.bootstrap-dialog .modal-header{border-top-left-radius:4px;border-top-right-radius:4px}.bootstrap-dialog .bootstrap-dialog-title{color:#fff;display:inline-block;font-size:16px}.bootstrap-dialog .bootstrap-dialog-message{font-size:14px}.bootstrap-dialog .bootstrap-dialog-button-icon{margin-right:3px}.bootstrap-dialog .bootstrap-dialog-close-button{float:right;opacity:.9;filter:alpha(opacity=90)}.bootstrap-dialog .bootstrap-dialog-close-button:hover{cursor:pointer;opacity:1;filter:alpha(opacity=100)}@media (min-width:1172px){.bootstrap-dialog .modal-xl{max-width:95%}}.bootstrap-dialog .modal-lg .bootstrap4-dialog-button:first-child{margin-top:8px}.bootstrap-dialog.type-default .modal-header{background-color:#fff}.bootstrap-dialog.type-default .bootstrap-dialog-title{color:#333}.bootstrap-dialog.type-info .modal-header{background-color:#17a2b8}.bootstrap-dialog.type-primary .modal-header{background-color:#007bff}.bootstrap-dialog.type-secondary .modal-header{background-color:#6c757d}.bootstrap-dialog.type-success .modal-header{background-color:#28a745}.bootstrap-dialog.type-warning .modal-header{background-color:#ffc107}.bootstrap-dialog.type-danger .modal-header{background-color:#dc3545}.bootstrap-dialog.type-light .modal-header{background-color:#f8f9fa}.bootstrap-dialog.type-dark .modal-header{background-color:#343a40}.bootstrap-dialog.size-large .bootstrap-dialog-title{font-size:24px}.bootstrap-dialog.size-large .bootstrap-dialog-close-button{font-size:30px}.bootstrap-dialog.size-large .bootstrap-dialog-message{font-size:18px}.bootstrap-dialog .icon-spin{display:inline-block;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;-webkit-animation:spin 2s infinite linear;animation:spin 2s infinite linear}.bootstrap-dialog-footer-buttons{display:flex}.bootstrap-dialog-header{display:contents} +/*# sourceMappingURL=bootstrap-dialog.min.css.map */ \ No newline at end of file diff --git a/dist/css/bootstrap-dialog.min.css.map b/dist/css/bootstrap-dialog.min.css.map new file mode 100644 index 0000000..c78744d --- /dev/null +++ b/dist/css/bootstrap-dialog.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["bootstrap-dialog.css"],"names":[],"mappings":"AAyFA,A,qBACE,E,CACE,2B,CACF,E,CACE,+BAEJ,A,wBACE,E,CACE,8B,CACF,E,CACE,kCAEJ,A,mBACE,E,CACE,yB,CACF,E,CACE,6BAEJ,A,oBACE,E,CACE,0B,CACF,E,CACE,8BAEJ,A,gBACE,E,CACE,sB,CACF,E,CACE,0BA7GJ,+B,CACE,0B,CACA,2B,CAEF,yC,CACE,U,CACA,oB,CACA,c,CAEF,2C,CACE,c,CAEF,+C,CACE,gB,CAEF,gD,CACE,W,CACA,U,CACA,wB,CAEF,sD,CACE,c,CACA,S,CACA,yB,CAEF,0BACE,2B,CACE,eAEJ,iE,CACE,c,CAEF,4C,CACE,qB,CAEF,sD,CACE,U,CAEF,yC,CACE,wB,CAEF,4C,CACE,wB,CAEF,8C,CACE,wB,CAEF,4C,CACE,wB,CAEF,4C,CACE,wB,CAEF,2C,CACE,wB,CAEF,0C,CACE,wB,CAEF,yC,CACE,wB,CAEF,oD,CACE,c,CAEF,2D,CACE,c,CAEF,sD,CACE,c,CAEF,4B,CACE,oB,CACA,sC,CACA,oC,CACA,yC,CACA,iC,CAEF,gC,CACE,Y,CAgCF,wB,CACE,gB","file":"bootstrap-dialog.css","sourcesContent":[".bootstrap-dialog {\r\n /* dialog types */\r\n /**\r\n * Icon animation\r\n * Copied from font-awesome: http://fontawesome.io/\r\n **/\r\n /** End of icon animation **/ }\r\n\r\n.bootstrap-dialog .modal-header {\r\n border-top-left-radius: 4px;\r\n border-top-right-radius: 4px; }\r\n\r\n.bootstrap-dialog .bootstrap-dialog-title {\r\n color: #fff;\r\n display: inline-block;\r\n font-size: 16px; }\r\n\r\n.bootstrap-dialog .bootstrap-dialog-message {\r\n font-size: 14px; }\r\n\r\n.bootstrap-dialog .bootstrap-dialog-button-icon {\r\n margin-right: 3px; }\r\n\r\n.bootstrap-dialog .bootstrap-dialog-close-button {\r\n float: right;\r\n opacity: 0.9;\r\n filter: alpha(opacity=90); }\r\n\r\n.bootstrap-dialog .bootstrap-dialog-close-button:hover {\r\n cursor: pointer;\r\n opacity: 1;\r\n filter: alpha(opacity=100); }\r\n\r\n@media (min-width: 1172px) {\r\n .bootstrap-dialog .modal-xl {\r\n max-width: 95%; } }\r\n\r\n.bootstrap-dialog .modal-lg .bootstrap4-dialog-button:first-child {\r\n margin-top: 8px; }\r\n\r\n.bootstrap-dialog.type-default .modal-header {\r\n background-color: #fff; }\r\n\r\n.bootstrap-dialog.type-default .bootstrap-dialog-title {\r\n color: #333; }\r\n\r\n.bootstrap-dialog.type-info .modal-header {\r\n background-color: #17a2b8; }\r\n\r\n.bootstrap-dialog.type-primary .modal-header {\r\n background-color: #007bff; }\r\n\r\n.bootstrap-dialog.type-secondary .modal-header {\r\n background-color: #6c757d; }\r\n\r\n.bootstrap-dialog.type-success .modal-header {\r\n background-color: #28a745; }\r\n\r\n.bootstrap-dialog.type-warning .modal-header {\r\n background-color: #ffc107; }\r\n\r\n.bootstrap-dialog.type-danger .modal-header {\r\n background-color: #dc3545; }\r\n\r\n.bootstrap-dialog.type-light .modal-header {\r\n background-color: #f8f9fa; }\r\n\r\n.bootstrap-dialog.type-dark .modal-header {\r\n background-color: #343a40; }\r\n\r\n.bootstrap-dialog.size-large .bootstrap-dialog-title {\r\n font-size: 24px; }\r\n\r\n.bootstrap-dialog.size-large .bootstrap-dialog-close-button {\r\n font-size: 30px; }\r\n\r\n.bootstrap-dialog.size-large .bootstrap-dialog-message {\r\n font-size: 18px; }\r\n\r\n.bootstrap-dialog .icon-spin {\r\n display: inline-block;\r\n -moz-animation: spin 2s infinite linear;\r\n -o-animation: spin 2s infinite linear;\r\n -webkit-animation: spin 2s infinite linear;\r\n animation: spin 2s infinite linear; }\r\n\r\n.bootstrap-dialog-footer-buttons {\r\n display: flex; }\r\n\r\n@-moz-keyframes spin {\r\n 0% {\r\n -moz-transform: rotate(0deg); }\r\n 100% {\r\n -moz-transform: rotate(359deg); } }\r\n\r\n@-webkit-keyframes spin {\r\n 0% {\r\n -webkit-transform: rotate(0deg); }\r\n 100% {\r\n -webkit-transform: rotate(359deg); } }\r\n\r\n@-o-keyframes spin {\r\n 0% {\r\n -o-transform: rotate(0deg); }\r\n 100% {\r\n -o-transform: rotate(359deg); } }\r\n\r\n@-ms-keyframes spin {\r\n 0% {\r\n -ms-transform: rotate(0deg); }\r\n 100% {\r\n -ms-transform: rotate(359deg); } }\r\n\r\n@keyframes spin {\r\n 0% {\r\n transform: rotate(0deg); }\r\n 100% {\r\n transform: rotate(359deg); } }\r\n\r\n.bootstrap-dialog-header {\r\n display: contents; }\r\n\r\n/*# sourceMappingURL=bootstrap-dialog.css.map */\r\n"]} \ No newline at end of file diff --git a/dist/js/bootstrap-dialog.min.js b/dist/js/bootstrap-dialog.min.js index bcc0b77..5c4dd05 100644 --- a/dist/js/bootstrap-dialog.min.js +++ b/dist/js/bootstrap-dialog.min.js @@ -1 +1 @@ -!function(t,e){"use strict";"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery"),require("bootstrap")):"function"==typeof define&&define.amd?define("bootstrap-dialog",["jquery","bootstrap"],e):t.BootstrapDialog=e(t.jQuery)}(this||window,function(a){"use strict";function t(t,e){return bootstrap&&bootstrap.Modal&&/^5\.[^\D0]\./.test(bootstrap.Modal.VERSION)||bootstrap&&bootstrap.Modal&&/^5\.0\.2/.test(bootstrap.Modal.VERSION)||/4\.1\.\d+/.test(a.fn.modal.Constructor.VERSION)?new o(t,e):void o.call(this,t,e)}var o=bootstrap.Modal||a.fn.modal.Constructor;t.getModalVersion=function(){return bootstrap&&bootstrap.Modal&&/^5\.[^\D0]\./.test(bootstrap.Modal.VERSION)||bootstrap&&bootstrap.Modal&&/^5\.0\.[23456789]/.test(bootstrap.Modal.VERSION)?"v5.1":void 0===a.fn.modal.Constructor.VERSION?"v3.1":/3\.2\.\d+/.test(a.fn.modal.Constructor.VERSION)?"v3.2":/3\.3\.[1,2]/.test(a.fn.modal.Constructor.VERSION)?"v3.3":/4\.\d\.\d+/.test(a.fn.modal.Constructor.VERSION)?"v4.1":"v3.3.4"},t.ORIGINAL_BODY_PADDING=parseInt(a("body").css("padding-right")||0,10),(t.METHODS_TO_OVERRIDE={})["v3.1"]={},t.METHODS_TO_OVERRIDE["v3.2"]={hide:function(t){t&&t.preventDefault(),t=a.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,0===this.getGlobalOpenedDialogs().length&&this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())}},t.METHODS_TO_OVERRIDE["v3.3"]={setScrollbar:function(){this.bodyIsOverflowing&&this.$body.css("padding-right",t.ORIGINAL_BODY_PADDING+this.scrollbarWidth)},resetScrollbar:function(){0===this.getGlobalOpenedDialogs().length&&this.$body.css("padding-right",t.ORIGINAL_BODY_PADDING)},hideModal:function(){this.$element.hide(),this.backdrop(a.proxy(function(){0===this.getGlobalOpenedDialogs().length&&this.$body.removeClass("modal-open"),this.resetAdjustments(),this.resetScrollbar(),this.$element.trigger("hidden.bs.modal")},this))}},t.METHODS_TO_OVERRIDE["v3.3.4"]=a.extend({},t.METHODS_TO_OVERRIDE["v3.3"]),t.METHODS_TO_OVERRIDE["v4.1"]=a.extend({},t.METHODS_TO_OVERRIDE["v3.3"]),t.METHODS_TO_OVERRIDE["v5.1"]=a.extend({},t.METHODS_TO_OVERRIDE["v4.1"]),t.prototype={constructor:t,getGlobalOpenedDialogs:function(){var o=[];return a.each(d.dialogs,function(t,e){e.isRealized()&&e.isOpened()&&o.push(e)}),o}},t.prototype=a.extend(t.prototype,o.prototype,t.METHODS_TO_OVERRIDE[t.getModalVersion()]);var d=function(t){this.defaultOptions=a.extend(!0,{id:d.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},d.defaultOptions),this.indexedButtons={},this.registeredButtonHotkeys={},this.draggableData={isMouseDown:!1,mouseOffset:{}},this.realized=!1,this.opened=!1,this.initOptions(t),this.holdThisInstance()};return d.BootstrapDialogModal=t,d.NAMESPACE="bootstrap-dialog",d.TYPE_DEFAULT="type-default",d.TYPE_INFO="type-info",d.TYPE_PRIMARY="type-primary",d.TYPE_SECONDARY="type-secondary",d.TYPE_SUCCESS="type-success",d.TYPE_WARNING="type-warning",d.TYPE_DANGER="type-danger",d.TYPE_DARK="type-dark",d.TYPE_LIGHT="type-light",d.DEFAULT_TEXTS={},d.DEFAULT_TEXTS[d.TYPE_DEFAULT]="Default",d.DEFAULT_TEXTS[d.TYPE_INFO]="Information",d.DEFAULT_TEXTS[d.TYPE_PRIMARY]="Primary",d.DEFAULT_TEXTS[d.TYPE_SECONDARY]="Secondary",d.DEFAULT_TEXTS[d.TYPE_SUCCESS]="Success",d.DEFAULT_TEXTS[d.TYPE_WARNING]="Warning",d.DEFAULT_TEXTS[d.TYPE_DANGER]="Danger",d.DEFAULT_TEXTS[d.TYPE_DARK]="Dark",d.DEFAULT_TEXTS[d.TYPE_LIGHT]="Light",d.DEFAULT_TEXTS.OK="OK",d.DEFAULT_TEXTS.CANCEL="Cancel",d.DEFAULT_TEXTS.CONFIRM="Confirmation",d.SIZE_NORMAL="size-normal",d.SIZE_SMALL="size-small",d.SIZE_WIDE="size-wide",d.SIZE_EXTRAWIDE="size-extrawide",d.SIZE_LARGE="size-large",d.BUTTON_SIZES={},d.BUTTON_SIZES[d.SIZE_NORMAL]="",d.BUTTON_SIZES[d.SIZE_SMALL]="btn-small",d.BUTTON_SIZES[d.SIZE_WIDE]="btn-block",d.BUTTON_SIZES[d.SIZE_LARGE]="btn-lg",d.ICON_SPINNER="fas fa-spinner",d.BUTTONS_ORDER_CANCEL_OK="btns-order-cancel-ok",d.BUTTONS_ORDER_OK_CANCEL="btns-order-ok-cancel",d.Z_INDEX_BACKDROP=1040,d.Z_INDEX_MODAL=1050,d.defaultOptions={type:d.TYPE_PRIMARY,size:d.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:!0,closable:!0,closeByBackdrop:!0,closeByKeyboard:!0,closeIcon:"×",spinicon:d.ICON_SPINNER,autodestroy:!0,draggable:!1,animate:!0,description:"",tabindex:-1,verticalCentered:!1,btnsOrder:d.BUTTONS_ORDER_CANCEL_OK},d.configDefaultOptions=function(t){d.defaultOptions=a.extend(!0,d.defaultOptions,t)},d.dialogs={},d.openAll=function(){a.each(d.dialogs,function(t,e){e.open()})},d.closeAll=function(){a.each(d.dialogs,function(t,e){e.close()})},d.getDialog=function(t){var e=null;return e=void 0!==d.dialogs[t]?d.dialogs[t]:e},d.setDialog=function(t){return d.dialogs[t.getId()]=t},d.addDialog=function(t){return d.setDialog(t)},d.moveFocus=function(){var o=null;a.each(d.dialogs,function(t,e){e.isRealized()&&e.isOpened()&&(o=e)}),null!==o&&o.getModal().focus()},d.METHODS_TO_OVERRIDE={},d.METHODS_TO_OVERRIDE["v3.1"]={updateZIndex:function(){var t,e,o,n,i;return this.isOpened()&&(t=d.Z_INDEX_BACKDROP,e=d.Z_INDEX_MODAL,o=0,a.each(d.dialogs,function(t,e){e.isRealized()&&e.isOpened()&&o++}),n=this.getModal(),i=this.getModalBackdrop(n),n.css("z-index",e+20*(o-1)),i.css("z-index",t+20*(o-1))),this},open:function(){return this.isRealized()||this.realize(),this.getModal().modal("show"),this.updateZIndex(),this}},d.METHODS_TO_OVERRIDE["v3.2"]={updateZIndex:d.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:d.METHODS_TO_OVERRIDE["v3.1"].open},d.METHODS_TO_OVERRIDE["v3.3"]={},d.METHODS_TO_OVERRIDE["v3.3.4"]=a.extend({},d.METHODS_TO_OVERRIDE["v3.1"]),d.METHODS_TO_OVERRIDE["v4.0"]={getModalBackdrop:function(t){return a(t.data("bs.modal")._backdrop)},updateZIndex:d.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:d.METHODS_TO_OVERRIDE["v3.1"].open,getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}},d.METHODS_TO_OVERRIDE["v4.1"]={getModalBackdrop:function(t){return a(t.data("bs.modal")._backdrop)},updateZIndex:d.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:d.METHODS_TO_OVERRIDE["v3.1"].open,getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}},d.METHODS_TO_OVERRIDE["v5.1"]=a.extend({},d.METHODS_TO_OVERRIDE["v4.1"],{createCloseButton:function(){var t=a("
");t.addClass(this.getNamespace("close-button"));var e=a('');return t.append(e),t.on("click",{dialog:this},function(t){t.data.dialog.close()}),t}}),d.prototype={constructor:d,initOptions:function(t){return this.options=a.extend(!0,this.defaultOptions,t),this},holdThisInstance:function(){return d.addDialog(this),this},initModalStuff:function(){return this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter()),this.getModal().append(this.getModalDialog()),this.getModalDialog().append(this.getModalContent()),this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter()),this},createModal:function(){var t=a('');return t.prop("id",this.getId()),t.attr("aria-labelledby",this.getId()+"_title"),t},getModal:function(){return this.$modal},setModal:function(t){return this.$modal=t,this},getModalBackdrop:function(t){return t.data("bs.modal").$backdrop},getModalForBootstrapDialogModal:function(){return this.getModal()},createModalDialog:function(){return a('')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function(t){return this.$modalDialog=t,this},createModalContent:function(){return a('')},getModalContent:function(){return this.$modalContent},setModalContent:function(t){return this.$modalContent=t,this},createModalHeader:function(){return a('')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function(t){return this.$modalHeader=t,this},createModalBody:function(){return a('')},getModalBody:function(){return this.$modalBody},setModalBody:function(t){return this.$modalBody=t,this},createModalFooter:function(){return a('')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function(t){return this.$modalFooter=t,this},createDynamicContent:function(t){var e=null;return e="string"==typeof(e="function"==typeof t?t.call(t,this):t)?this.formatStringContent(e):e},formatStringContent:function(t){return this.options.nl2br?t.replace(/\r\n/g,"
").replace(/[\r\n]/g,"
"):t},setData:function(t,e){return this.options.data[t]=e,this},getData:function(t){return this.options.data[t]},setId:function(t){return this.options.id=t,this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(t){return this.options.type=t,this.updateType(),this},updateType:function(){var t;return this.isRealized()&&(t=[d.TYPE_DEFAULT,d.TYPE_INFO,d.TYPE_PRIMARY,d.TYPE_SECONDARY,d.TYPE_SUCCESS,d.TYPE_WARNING,d.TYPE_DARK,d.TYPE_LIGHT,d.TYPE_DANGER],this.getModal().removeClass(t.join(" ")).addClass(this.getType())),this},getSize:function(){return this.options.size},setSize:function(t){return this.options.size=t,this.updateSize(),this},updateSize:function(){var s;return this.isRealized()&&((s=this).getModal().removeClass(d.SIZE_NORMAL).removeClass(d.SIZE_SMALL).removeClass(d.SIZE_WIDE).removeClass(d.SIZE_EXTRAWIDE).removeClass(d.SIZE_LARGE),this.getModal().addClass(this.getSize()),this.getModalDialog().removeClass("modal-sm"),this.getSize()===d.SIZE_SMALL&&this.getModalDialog().addClass("modal-sm"),this.getModalDialog().removeClass("modal-lg"),this.getSize()===d.SIZE_WIDE&&this.getModalDialog().addClass("modal-lg"),this.getModalDialog().removeClass("modal-xl"),this.getSize()===d.SIZE_EXTRAWIDE&&this.getModalDialog().addClass("modal-xl"),a.each(this.options.buttons,function(t,e){var o=s.getButton(e.id),n=["btn-lg","btn-sm","btn-xs"],i=!1;"string"==typeof e.cssClass&&(e=e.cssClass.split(" "),a.each(e,function(t,e){-1!==a.inArray(e,n)&&(i=!0)})),i||(o.removeClass(n.join(" ")),o.addClass(s.getButtonSize()))})),this},getCssClass:function(){return this.options.cssClass},setCssClass:function(t){return this.options.cssClass=t,this},getTitle:function(){return this.options.title},setTitle:function(t){return this.options.title=t,this.updateTitle(),this},updateTitle:function(){var t;return this.isRealized()&&(t=null!==this.getTitle()?this.createDynamicContent(this.getTitle()):this.getDefaultText(),this.getModalHeader().find("."+this.getNamespace("title")).html("").append(t).prop("id",this.getId()+"_title")),this},getMessage:function(){return this.options.message},setMessage:function(t){return this.options.message=t,this.updateMessage(),this},updateMessage:function(){var t;return this.isRealized()&&(t=this.createDynamicContent(this.getMessage()),this.getModalBody().find("."+this.getNamespace("message")).html("").append(t)),this},isClosable:function(){return this.options.closable},setClosable:function(t){return this.options.closable=t,this.updateClosable(),this},setCloseByBackdrop:function(t){return this.options.closeByBackdrop=t,this},canCloseByBackdrop:function(){return this.options.closeByBackdrop},setCloseByKeyboard:function(t){return this.options.closeByKeyboard=t,this},canCloseByKeyboard:function(){return this.options.closeByKeyboard},isAnimate:function(){return this.options.animate},setAnimate:function(t){return this.options.animate=t,this},updateAnimate:function(){return this.isRealized()&&this.getModal().toggleClass("fade",this.isAnimate()),this},getSpinicon:function(){return this.options.spinicon},setSpinicon:function(t){return this.options.spinicon=t,this},addButton:function(t){return this.options.buttons.push(t),this},addButtons:function(t){var o=this;return a.each(t,function(t,e){o.addButton(e)}),this},getButtons:function(){return this.options.buttons},setButtons:function(t){return this.options.buttons=t,this.updateButtons(),this},getButton:function(t){return void 0!==this.indexedButtons[t]?this.indexedButtons[t]:null},getButtonSize:function(){return void 0!==d.BUTTON_SIZES[this.getSize()]?d.BUTTON_SIZES[this.getSize()]:""},updateButtons:function(){return this.isRealized()&&(0===this.getButtons().length?this.getModalFooter().hide():this.getModalFooter().show().closest(".modal-footer").append(this.createFooterButtons())),this},isAutodestroy:function(){return this.options.autodestroy},setAutodestroy:function(t){this.options.autodestroy=t},getDescription:function(){return this.options.description},setDescription:function(t){return this.options.description=t,this},getVerticalCentered:function(){return this.options.verticalCentered},setVerticalCentered:function(t){return this.options.verticalCentered=verticalCentered,this},setTabindex:function(t){return this.options.tabindex=t,this},getTabindex:function(){return this.options.tabindex},updateTabindex:function(){return this.isRealized()&&this.getModal().attr("tabindex",this.getTabindex()),this},getDefaultText:function(){return d.DEFAULT_TEXTS[this.getType()]},getNamespace:function(t){return d.NAMESPACE+"-"+t},createHeaderContent:function(){var t=a("
");return t.addClass(this.getNamespace("header")),t.append(this.createTitleContent()),t.append(this.createCloseButton()),t},createTitleContent:function(){var t=a("
");return t.addClass(this.getNamespace("title")),t},createCloseButton:function(){var t=a("
");t.addClass(this.getNamespace("close-button"));var e=a('');return e.append(this.options.closeIcon),t.append(e),t.on("click",{dialog:this},function(t){t.data.dialog.close()}),t},createBodyContent:function(){var t=a("
");return t.addClass(this.getNamespace("body")),t.append(this.createMessageContent()),t},createMessageContent:function(){var t=a("
");return t.addClass(this.getNamespace("message")),t},createFooterContent:function(){var t=a("
");return t.addClass(this.getNamespace("footer")),t},createFooterButtons:function(){var n=this,i=n.$modalFooter;return this.indexedButtons={},a.each(this.options.buttons,function(t,e){e.id||(e.id=d.newGuid());var o=n.createButton(e);n.indexedButtons[e.id]=o,i.append(o)}),i},createButton:function(t){var o=a('');return o.prop("id",t.id),o.data("button",t),void 0!==t.icon&&""!==a.trim(t.icon)&&o.append(this.createButtonIcon(t.icon)),void 0!==t.label&&o.append(t.label),void 0!==t.title&&o.attr("title",t.title),void 0!==t.cssClass&&""!==a.trim(t.cssClass)?o.addClass(t.cssClass):o.addClass("btn-secondary"),"object"==typeof t.data&&t.data.constructor==={}.constructor&&a.each(t.data,function(t,e){o.attr("data-"+t,e)}),void 0!==t.hotkey&&(this.registeredButtonHotkeys[t.hotkey]=o),o.on("click",{dialog:this,$button:o,button:t},function(t){var e=t.data.dialog,o=t.data.$button,n=o.data("button");if(n.autospin&&o.toggleSpin(!0),"function"==typeof n.action)return n.action.call(o,e,t)}),this.enhanceButton(o),void 0!==t.enabled&&o.toggleEnable(t.enabled),o.addClass("bootstrap4-dialog-button"),o},enhanceButton:function(n){return n.dialog=this,n.toggleEnable=function(t){return void 0!==t?this.prop("disabled",!t).toggleClass("disabled",!t):this.prop("disabled",!this.prop("disabled")),this},n.enable=function(){return this.toggleEnable(!0),this},n.disable=function(){return this.toggleEnable(!1),this},n.toggleSpin=function(t){var e=this.dialog,o=this.find("."+e.getNamespace("button-icon"));return(t=void 0===t?!(0");return e.addClass(this.getNamespace("button-icon")).addClass(t),e},enableButtons:function(o){return a.each(this.indexedButtons,function(t,e){e.toggleEnable(o)}),this},updateClosable:function(){return this.isRealized()&&this.getModalHeader().find("."+this.getNamespace("close-button")).toggle(this.isClosable()),this},onShow:function(t){return this.options.onshow=t,this},onShown:function(t){return this.options.onshown=t,this},onHide:function(t){return this.options.onhide=t,this},onHidden:function(t){return this.options.onhidden=t,this},isRealized:function(){return this.realized},setRealized:function(t){return this.realized=t,this},isOpened:function(){return this.opened},setOpened:function(t){return this.opened=t,this},handleModalEvents:function(){return this.getModal().on("show.bs.modal",{dialog:this},function(t){var e=t.data.dialog;if(e.setOpened(!0),e.isModalEvent(t)&&"function"==typeof e.options.onshow){t=e.options.onshow(e);return!1===t&&e.setOpened(!1),t}}),this.getModal().on("shown.bs.modal",{dialog:this},function(t){var e=t.data.dialog;e.isModalEvent(t)&&"function"==typeof e.options.onshown&&e.options.onshown(e)}),this.getModal().on("hide.bs.modal",{dialog:this},function(t){var e=t.data.dialog;if(e.setOpened(!1),e.isModalEvent(t)&&"function"==typeof e.options.onhide){t=e.options.onhide(e);return!1===t&&e.setOpened(!0),t}}),this.getModal().on("hidden.bs.modal",{dialog:this},function(t){var e=t.data.dialog;e.isModalEvent(t)&&"function"==typeof e.options.onhidden&&e.options.onhidden(e),e.isAutodestroy()&&(e.setRealized(!1),delete d.dialogs[e.getId()],a(this).remove()),d.moveFocus(),(a(".modal").hasClass("in")||a(".modal").hasClass("show"))&&a("body").addClass("modal-open")}),this.getModal().on("keyup",{dialog:this},function(t){27===t.which&&t.data.dialog.isClosable()&&t.data.dialog.canCloseByKeyboard()&&t.data.dialog.close()}),this.getModal().on("keyup",{dialog:this},function(t){var e=t.data.dialog;void 0!==e.registeredButtonHotkeys[t.which]&&((t=a(e.registeredButtonHotkeys[t.which])).prop("disabled")||t.is(":focus")||t.focus().trigger("click"))}),this},isModalEvent:function(t){return void 0!==t.namespace&&"bs.modal"===t.namespace},makeModalDraggable:function(){return this.options.draggable&&(this.getModalHeader().addClass(this.getNamespace("draggable")).on("mousedown",{dialog:this},function(t){t.preventDefault();var e=t.data.dialog;e.draggableData.isMouseDown=!0;var o=e.getModalDialog().offset();e.draggableData.mouseOffset={top:t.clientY-o.top,left:t.clientX-o.left}}),this.getModal().on("mouseup",{dialog:this},function(t){t.data.dialog.draggableData.isMouseDown=!1}),a("body").on("mousemove",{dialog:this},function(t){var e=t.data.dialog;e.draggableData.isMouseDown&&e.getModalDialog().offset({top:t.clientY-e.draggableData.mouseOffset.top,left:t.clientX-e.draggableData.mouseOffset.left})}).on("mouseleave",{dialog:this},function(t){t.data.dialog.draggableData.isMouseDown=!1})),this},realize:function(){return this.initModalStuff(),this.getModal().addClass(d.NAMESPACE).addClass(this.getCssClass()),this.updateSize(),this.getDescription()&&this.getModal().attr("aria-describedby",this.getDescription()),this.getVerticalCentered()&&this.getModalDialog().addClass("modal-dialog-centered"),this.getModalHeader().append(this.createHeaderContent()),this.getModalBody().append(this.createBodyContent()),this.getModal().data("bs.modal",new t(this.getModalForBootstrapDialogModal(),{backdrop:!(!this.isClosable()||!this.canCloseByBackdrop())||"static",keyboard:!1,show:!1})),this.makeModalDraggable(),this.handleModalEvents(),this.setRealized(!0),this.updateButtons(),this.updateType(),this.updateTitle(),this.updateMessage(),this.updateClosable(),this.updateAnimate(),this.updateSize(),this.updateTabindex(),this},open:function(){return this.isRealized()||this.realize(),this.getModal().modal("show"),this},close:function(){return this.isRealized()||this.realize(),this.getModal().modal("hide"),this}},d.prototype=a.extend(d.prototype,d.METHODS_TO_OVERRIDE[t.getModalVersion()]),d.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})},d.show=function(t){return new d(t).open()},d.alert=function(){var t={},e={type:d.TYPE_PRIMARY,title:null,message:null,closable:!1,draggable:!1,buttonLabel:d.DEFAULT_TEXTS.OK,buttonHotkey:null,callback:null},t="object"==typeof arguments[0]&&arguments[0].constructor==={}.constructor?a.extend(!0,e,arguments[0]):a.extend(!0,e,{message:arguments[0],callback:void 0!==arguments[1]?arguments[1]:null}),e=new d(t);return e.setData("callback",t.callback),e.addButton({label:t.buttonLabel,hotkey:t.buttonHotkey,action:function(t){return("function"!=typeof t.getData("callback")||!1!==t.getData("callback").call(this,!0))&&(t.setData("btnClicked",!0),t.close())}}),"function"==typeof e.options.onhide?e.onHide(function(t){var e=!0;return!1!==(e=!t.getData("btnClicked")&&t.isClosable()&&"function"==typeof t.getData("callback")?t.getData("callback")(!1):e)&&(e=this.onhide(t))}.bind({onhide:e.options.onhide})):e.onHide(function(t){var e=!0;return e=!t.getData("btnClicked")&&t.isClosable()&&"function"==typeof t.getData("callback")?t.getData("callback")(!1):e}),e.open()},d.confirm=function(){var t={},e={type:d.TYPE_PRIMARY,title:null,message:null,closable:!1,draggable:!1,btnCancelLabel:d.DEFAULT_TEXTS.CANCEL,btnCancelClass:null,btnCancelHotkey:null,btnOKLabel:d.DEFAULT_TEXTS.OK,btnOKClass:null,btnOKHotkey:null,btnsOrder:d.defaultOptions.btnsOrder,callback:null};null===(t="object"==typeof arguments[0]&&arguments[0].constructor==={}.constructor?a.extend(!0,e,arguments[0]):a.extend(!0,e,{message:arguments[0],callback:void 0!==arguments[1]?arguments[1]:null})).btnOKClass&&(t.btnOKClass=["btn",t.type.split("-")[1]].join("-"));var o=new d(t);o.setData("callback",t.callback);e=[{label:t.btnCancelLabel,cssClass:t.btnCancelClass,hotkey:t.btnCancelHotkey,action:function(t){return("function"!=typeof t.getData("callback")||!1!==t.getData("callback").call(this,!1))&&t.close()}},{label:t.btnOKLabel,cssClass:t.btnOKClass,hotkey:t.btnOKHotkey,action:function(t){return("function"!=typeof t.getData("callback")||!1!==t.getData("callback").call(this,!0))&&t.close()}}];return t.btnsOrder===d.BUTTONS_ORDER_OK_CANCEL&&e.reverse(),o.addButtons(e),o.open()},d.warning=function(t,e){return new d({type:d.TYPE_WARNING,message:t}).open()},d.danger=function(t,e){return new d({type:d.TYPE_DANGER,message:t}).open()},d.success=function(t,e){return new d({type:d.TYPE_SUCCESS,message:t}).open()},d}); \ No newline at end of file +(function(root,factory){"use strict";if(typeof module!=="undefined"&&module.exports){module.exports=factory(require("jquery"),require("bootstrap"))}else if(typeof define==="function"&&define.amd){define("bootstrap-dialog",["jquery","bootstrap"],function($){return factory($)})}else{root.BootstrapDialog=factory(root.jQuery)}})(this?this:window,function($){"use strict";var Modal=bootstrap.Modal?bootstrap.Modal:$.fn.modal.Constructor;var BootstrapDialogModal=function(element,options){if(bootstrap&&bootstrap.Modal&&/^5\.[^\D0]\./.test(bootstrap.Modal.VERSION)){return new Modal(element,options)}else if(bootstrap&&bootstrap.Modal&&/^5\.0\.2/.test(bootstrap.Modal.VERSION)){return new Modal(element,options)}else if(/4\.1\.\d+/.test($.fn.modal.Constructor.VERSION)){return new Modal(element,options)}else{Modal.call(this,element,options)}};BootstrapDialogModal.getModalVersion=function(){var version=null;if(bootstrap&&bootstrap.Modal&&/^5\.[^\D0]\./.test(bootstrap.Modal.VERSION)){version="v5.1"}else if(bootstrap&&bootstrap.Modal&&/^5\.0\.[23456789]/.test(bootstrap.Modal.VERSION)){version="v5.1"}else if(typeof $.fn.modal.Constructor.VERSION==="undefined"){version="v3.1"}else if(/3\.2\.\d+/.test($.fn.modal.Constructor.VERSION)){version="v3.2"}else if(/3\.3\.[1,2]/.test($.fn.modal.Constructor.VERSION)){version="v3.3"}else if(/4\.\d\.\d+/.test($.fn.modal.Constructor.VERSION)){version="v4.1"}else{version="v3.3.4"}return version};BootstrapDialogModal.ORIGINAL_BODY_PADDING=parseInt($("body").css("padding-right")||0,10);BootstrapDialogModal.METHODS_TO_OVERRIDE={};BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.1"]={};BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.2"]={hide:function(e){if(e){e.preventDefault()}e=$.Event("hide.bs.modal");this.$element.trigger(e);if(!this.isShown||e.isDefaultPrevented()){return}this.isShown=false;var openedDialogs=this.getGlobalOpenedDialogs();if(openedDialogs.length===0){this.$body.removeClass("modal-open")}this.resetScrollbar();this.escape();$(document).off("focusin.bs.modal");this.$element.removeClass("in").attr("aria-hidden",true).off("click.dismiss.bs.modal");$.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",$.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}};BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.3"]={setScrollbar:function(){var bodyPad=BootstrapDialogModal.ORIGINAL_BODY_PADDING;if(this.bodyIsOverflowing){this.$body.css("padding-right",bodyPad+this.scrollbarWidth)}},resetScrollbar:function(){var openedDialogs=this.getGlobalOpenedDialogs();if(openedDialogs.length===0){this.$body.css("padding-right",BootstrapDialogModal.ORIGINAL_BODY_PADDING)}},hideModal:function(){this.$element.hide();this.backdrop($.proxy(function(){var openedDialogs=this.getGlobalOpenedDialogs();if(openedDialogs.length===0){this.$body.removeClass("modal-open")}this.resetAdjustments();this.resetScrollbar();this.$element.trigger("hidden.bs.modal")},this))}};BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.3.4"]=$.extend({},BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.3"]);BootstrapDialogModal.METHODS_TO_OVERRIDE["v4.1"]=$.extend({},BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.3"]);BootstrapDialogModal.METHODS_TO_OVERRIDE["v5.1"]=$.extend({},BootstrapDialogModal.METHODS_TO_OVERRIDE["v4.1"]);BootstrapDialogModal.prototype={constructor:BootstrapDialogModal,getGlobalOpenedDialogs:function(){var openedDialogs=[];$.each(BootstrapDialog.dialogs,function(id,dialogInstance){if(dialogInstance.isRealized()&&dialogInstance.isOpened()){openedDialogs.push(dialogInstance)}});return openedDialogs}};BootstrapDialogModal.prototype=$.extend(BootstrapDialogModal.prototype,Modal.prototype,BootstrapDialogModal.METHODS_TO_OVERRIDE[BootstrapDialogModal.getModalVersion()]);var BootstrapDialog=function(options){this.defaultOptions=$.extend(true,{id:BootstrapDialog.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},BootstrapDialog.defaultOptions);this.indexedButtons={};this.registeredButtonHotkeys={};this.draggableData={isMouseDown:false,mouseOffset:{}};this.realized=false;this.opened=false;this.initOptions(options);this.holdThisInstance()};BootstrapDialog.BootstrapDialogModal=BootstrapDialogModal;BootstrapDialog.NAMESPACE="bootstrap-dialog";BootstrapDialog.TYPE_DEFAULT="type-default";BootstrapDialog.TYPE_INFO="type-info";BootstrapDialog.TYPE_PRIMARY="type-primary";BootstrapDialog.TYPE_SECONDARY="type-secondary";BootstrapDialog.TYPE_SUCCESS="type-success";BootstrapDialog.TYPE_WARNING="type-warning";BootstrapDialog.TYPE_DANGER="type-danger";BootstrapDialog.TYPE_DARK="type-dark";BootstrapDialog.TYPE_LIGHT="type-light";BootstrapDialog.DEFAULT_TEXTS={};BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DEFAULT]="Default";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_INFO]="Information";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_PRIMARY]="Primary";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_SECONDARY]="Secondary";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_SUCCESS]="Success";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_WARNING]="Warning";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DANGER]="Danger";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DARK]="Dark";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_LIGHT]="Light";BootstrapDialog.DEFAULT_TEXTS["OK"]="OK";BootstrapDialog.DEFAULT_TEXTS["CANCEL"]="Cancel";BootstrapDialog.DEFAULT_TEXTS["CONFIRM"]="Confirmation";BootstrapDialog.SIZE_NORMAL="size-normal";BootstrapDialog.SIZE_SMALL="size-small";BootstrapDialog.SIZE_WIDE="size-wide";BootstrapDialog.SIZE_EXTRAWIDE="size-extrawide";BootstrapDialog.SIZE_LARGE="size-large";BootstrapDialog.BUTTON_SIZES={};BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_NORMAL]="";BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_SMALL]="btn-small";BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_WIDE]="btn-block";BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_LARGE]="btn-lg";BootstrapDialog.ICON_SPINNER="fas fa-spinner";BootstrapDialog.BUTTONS_ORDER_CANCEL_OK="btns-order-cancel-ok";BootstrapDialog.BUTTONS_ORDER_OK_CANCEL="btns-order-ok-cancel";BootstrapDialog.Z_INDEX_BACKDROP=1040;BootstrapDialog.Z_INDEX_MODAL=1050;BootstrapDialog.defaultOptions={type:BootstrapDialog.TYPE_PRIMARY,size:BootstrapDialog.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:true,closable:true,closeByBackdrop:true,closeByKeyboard:true,closeIcon:"×",spinicon:BootstrapDialog.ICON_SPINNER,autodestroy:true,draggable:false,animate:true,description:"",tabindex:-1,verticalCentered:false,btnsOrder:BootstrapDialog.BUTTONS_ORDER_CANCEL_OK};BootstrapDialog.configDefaultOptions=function(options){BootstrapDialog.defaultOptions=$.extend(true,BootstrapDialog.defaultOptions,options)};BootstrapDialog.dialogs={};BootstrapDialog.openAll=function(){$.each(BootstrapDialog.dialogs,function(id,dialogInstance){dialogInstance.open()})};BootstrapDialog.closeAll=function(){$.each(BootstrapDialog.dialogs,function(id,dialogInstance){dialogInstance.close()})};BootstrapDialog.getDialog=function(id){var dialog=null;if(typeof BootstrapDialog.dialogs[id]!=="undefined"){dialog=BootstrapDialog.dialogs[id]}return dialog};BootstrapDialog.setDialog=function(dialog){BootstrapDialog.dialogs[dialog.getId()]=dialog;return dialog};BootstrapDialog.addDialog=function(dialog){return BootstrapDialog.setDialog(dialog)};BootstrapDialog.moveFocus=function(){var lastDialogInstance=null;$.each(BootstrapDialog.dialogs,function(id,dialogInstance){if(dialogInstance.isRealized()&&dialogInstance.isOpened()){lastDialogInstance=dialogInstance}});if(lastDialogInstance!==null){lastDialogInstance.getModal().focus()}};BootstrapDialog.METHODS_TO_OVERRIDE={};BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]={updateZIndex:function(){if(this.isOpened()){var zIndexBackdrop=BootstrapDialog.Z_INDEX_BACKDROP;var zIndexModal=BootstrapDialog.Z_INDEX_MODAL;var dialogCount=0;$.each(BootstrapDialog.dialogs,function(dialogId,dialogInstance){if(dialogInstance.isRealized()&&dialogInstance.isOpened()){dialogCount++}});var $modal=this.getModal();var $backdrop=this.getModalBackdrop($modal);$modal.css("z-index",zIndexModal+(dialogCount-1)*20);$backdrop.css("z-index",zIndexBackdrop+(dialogCount-1)*20)}return this},open:function(){!this.isRealized()&&this.realize();this.getModal().modal("show");this.updateZIndex();return this}};BootstrapDialog.METHODS_TO_OVERRIDE["v3.2"]={updateZIndex:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["open"]};BootstrapDialog.METHODS_TO_OVERRIDE["v3.3"]={};BootstrapDialog.METHODS_TO_OVERRIDE["v3.3.4"]=$.extend({},BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]);BootstrapDialog.METHODS_TO_OVERRIDE["v4.0"]={getModalBackdrop:function($modal){return $($modal.data("bs.modal")._backdrop)},updateZIndex:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["open"],getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}};BootstrapDialog.METHODS_TO_OVERRIDE["v4.1"]={getModalBackdrop:function($modal){return $($modal.data("bs.modal")._backdrop)},updateZIndex:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["open"],getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}};BootstrapDialog.METHODS_TO_OVERRIDE["v5.1"]=$.extend({},BootstrapDialog.METHODS_TO_OVERRIDE["v4.1"],{createCloseButton:function(){var $container=$("
");$container.addClass(this.getNamespace("close-button"));var $icon=$('');$container.append($icon);$container.on("click",{dialog:this},function(event){event.data.dialog.close()});return $container}});BootstrapDialog.prototype={constructor:BootstrapDialog,initOptions:function(options){this.options=$.extend(true,this.defaultOptions,options);return this},holdThisInstance:function(){BootstrapDialog.addDialog(this);return this},initModalStuff:function(){this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter());this.getModal().append(this.getModalDialog());this.getModalDialog().append(this.getModalContent());this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter());return this},createModal:function(){var $modal=$('');$modal.prop("id",this.getId());$modal.attr("aria-labelledby",this.getId()+"_title");return $modal},getModal:function(){return this.$modal},setModal:function($modal){this.$modal=$modal;return this},getModalBackdrop:function($modal){return $modal.data("bs.modal").$backdrop},getModalForBootstrapDialogModal:function(){return this.getModal()},createModalDialog:function(){return $('')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function($modalDialog){this.$modalDialog=$modalDialog;return this},createModalContent:function(){return $('')},getModalContent:function(){return this.$modalContent},setModalContent:function($modalContent){this.$modalContent=$modalContent;return this},createModalHeader:function(){return $('')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function($modalHeader){this.$modalHeader=$modalHeader;return this},createModalBody:function(){return $('')},getModalBody:function(){return this.$modalBody},setModalBody:function($modalBody){this.$modalBody=$modalBody;return this},createModalFooter:function(){return $('')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function($modalFooter){this.$modalFooter=$modalFooter;return this},createDynamicContent:function(rawContent){var content=null;if(typeof rawContent==="function"){content=rawContent.call(rawContent,this)}else{content=rawContent}if(typeof content==="string"){content=this.formatStringContent(content)}return content},formatStringContent:function(content){if(this.options.nl2br){return content.replace(/\r\n/g,"
").replace(/[\r\n]/g,"
")}return content},setData:function(key,value){this.options.data[key]=value;return this},getData:function(key){return this.options.data[key]},setId:function(id){this.options.id=id;return this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(type){this.options.type=type;this.updateType();return this},updateType:function(){if(this.isRealized()){var types=[BootstrapDialog.TYPE_DEFAULT,BootstrapDialog.TYPE_INFO,BootstrapDialog.TYPE_PRIMARY,BootstrapDialog.TYPE_SECONDARY,BootstrapDialog.TYPE_SUCCESS,BootstrapDialog.TYPE_WARNING,BootstrapDialog.TYPE_DARK,BootstrapDialog.TYPE_LIGHT,BootstrapDialog.TYPE_DANGER];this.getModal().removeClass(types.join(" ")).addClass(this.getType())}return this},getSize:function(){return this.options.size},setSize:function(size){this.options.size=size;this.updateSize();return this},updateSize:function(){if(this.isRealized()){var dialog=this;this.getModal().removeClass(BootstrapDialog.SIZE_NORMAL).removeClass(BootstrapDialog.SIZE_SMALL).removeClass(BootstrapDialog.SIZE_WIDE).removeClass(BootstrapDialog.SIZE_EXTRAWIDE).removeClass(BootstrapDialog.SIZE_LARGE);this.getModal().addClass(this.getSize());this.getModalDialog().removeClass("modal-sm");if(this.getSize()===BootstrapDialog.SIZE_SMALL){this.getModalDialog().addClass("modal-sm")}this.getModalDialog().removeClass("modal-lg");if(this.getSize()===BootstrapDialog.SIZE_WIDE){this.getModalDialog().addClass("modal-lg")}this.getModalDialog().removeClass("modal-xl");if(this.getSize()===BootstrapDialog.SIZE_EXTRAWIDE){this.getModalDialog().addClass("modal-xl")}$.each(this.options.buttons,function(index,button){var $button=dialog.getButton(button.id);var buttonSizes=["btn-lg","btn-sm","btn-xs"];var sizeClassSpecified=false;if(typeof button["cssClass"]==="string"){var btnClasses=button["cssClass"].split(" ");$.each(btnClasses,function(index,btnClass){if($.inArray(btnClass,buttonSizes)!==-1){sizeClassSpecified=true}})}if(!sizeClassSpecified){$button.removeClass(buttonSizes.join(" "));$button.addClass(dialog.getButtonSize())}})}return this},getCssClass:function(){return this.options.cssClass},setCssClass:function(cssClass){this.options.cssClass=cssClass;return this},getTitle:function(){return this.options.title},setTitle:function(title){this.options.title=title;this.updateTitle();return this},updateTitle:function(){if(this.isRealized()){var title=this.getTitle()!==null?this.createDynamicContent(this.getTitle()):this.getDefaultText();this.getModalHeader().find("."+this.getNamespace("title")).html("").append(title).prop("id",this.getId()+"_title")}return this},getMessage:function(){return this.options.message},setMessage:function(message){this.options.message=message;this.updateMessage();return this},updateMessage:function(){if(this.isRealized()){var message=this.createDynamicContent(this.getMessage());this.getModalBody().find("."+this.getNamespace("message")).html("").append(message)}return this},isClosable:function(){return this.options.closable},setClosable:function(closable){this.options.closable=closable;this.updateClosable();return this},setCloseByBackdrop:function(closeByBackdrop){this.options.closeByBackdrop=closeByBackdrop;return this},canCloseByBackdrop:function(){return this.options.closeByBackdrop},setCloseByKeyboard:function(closeByKeyboard){this.options.closeByKeyboard=closeByKeyboard;return this},canCloseByKeyboard:function(){return this.options.closeByKeyboard},isAnimate:function(){return this.options.animate},setAnimate:function(animate){this.options.animate=animate;return this},updateAnimate:function(){if(this.isRealized()){this.getModal().toggleClass("fade",this.isAnimate())}return this},getSpinicon:function(){return this.options.spinicon},setSpinicon:function(spinicon){this.options.spinicon=spinicon;return this},addButton:function(button){this.options.buttons.push(button);return this},addButtons:function(buttons){var that=this;$.each(buttons,function(index,button){that.addButton(button)});return this},getButtons:function(){return this.options.buttons},setButtons:function(buttons){this.options.buttons=buttons;this.updateButtons();return this},getButton:function(id){if(typeof this.indexedButtons[id]!=="undefined"){return this.indexedButtons[id]}return null},getButtonSize:function(){if(typeof BootstrapDialog.BUTTON_SIZES[this.getSize()]!=="undefined"){return BootstrapDialog.BUTTON_SIZES[this.getSize()]}return""},updateButtons:function(){if(this.isRealized()){if(this.getButtons().length===0){this.getModalFooter().hide()}else{this.getModalFooter().show().closest(".modal-footer").append(this.createFooterButtons())}}return this},isAutodestroy:function(){return this.options.autodestroy},setAutodestroy:function(autodestroy){this.options.autodestroy=autodestroy},getDescription:function(){return this.options.description},setDescription:function(description){this.options.description=description;return this},getVerticalCentered:function(){return this.options.verticalCentered},setVerticalCentered:function(verticalcentered){this.options.verticalCentered=verticalCentered;return this},setTabindex:function(tabindex){this.options.tabindex=tabindex;return this},getTabindex:function(){return this.options.tabindex},updateTabindex:function(){if(this.isRealized()){this.getModal().attr("tabindex",this.getTabindex())}return this},getDefaultText:function(){return BootstrapDialog.DEFAULT_TEXTS[this.getType()]},getNamespace:function(name){return BootstrapDialog.NAMESPACE+"-"+name},createHeaderContent:function(){var $container=$("
");$container.addClass(this.getNamespace("header"));$container.append(this.createTitleContent());$container.append(this.createCloseButton());return $container},createTitleContent:function(){var $title=$("
");$title.addClass(this.getNamespace("title"));return $title},createCloseButton:function(){var $container=$("
");$container.addClass(this.getNamespace("close-button"));var $icon=$('');$icon.append(this.options.closeIcon);$container.append($icon);$container.on("click",{dialog:this},function(event){event.data.dialog.close()});return $container},createBodyContent:function(){var $container=$("
");$container.addClass(this.getNamespace("body"));$container.append(this.createMessageContent());return $container},createMessageContent:function(){var $message=$("
");$message.addClass(this.getNamespace("message"));return $message},createFooterContent:function(){var $container=$("
");$container.addClass(this.getNamespace("footer"));return $container},createFooterButtons:function(){var that=this;var $container=that.$modalFooter;this.indexedButtons={};$.each(this.options.buttons,function(index,button){if(!button.id){button.id=BootstrapDialog.newGuid()}var $button=that.createButton(button);that.indexedButtons[button.id]=$button;$container.append($button)});return $container},createButton:function(button){var $button=$('');$button.prop("id",button.id);$button.data("button",button);if(typeof button.icon!=="undefined"&&$.trim(button.icon)!==""){$button.append(this.createButtonIcon(button.icon))}if(typeof button.label!=="undefined"){$button.append(button.label)}if(typeof button.title!=="undefined"){$button.attr("title",button.title)}if(typeof button.cssClass!=="undefined"&&$.trim(button.cssClass)!==""){$button.addClass(button.cssClass)}else{$button.addClass("btn-secondary")}if(typeof button.data==="object"&&button.data.constructor==={}.constructor){$.each(button.data,function(key,value){$button.attr("data-"+key,value)})}if(typeof button.hotkey!=="undefined"){this.registeredButtonHotkeys[button.hotkey]=$button}$button.on("click",{dialog:this,$button:$button,button:button},function(event){var dialog=event.data.dialog;var $button=event.data.$button;var button=$button.data("button");if(button.autospin){$button.toggleSpin(true)}if(typeof button.action==="function"){return button.action.call($button,dialog,event)}});this.enhanceButton($button);if(typeof button.enabled!=="undefined"){$button.toggleEnable(button.enabled)}$button.addClass("bootstrap4-dialog-button");return $button},enhanceButton:function($button){$button.dialog=this;$button.toggleEnable=function(enable){var $this=this;if(typeof enable!=="undefined"){$this.prop("disabled",!enable).toggleClass("disabled",!enable)}else{$this.prop("disabled",!$this.prop("disabled"))}return $this};$button.enable=function(){var $this=this;$this.toggleEnable(true);return $this};$button.disable=function(){var $this=this;$this.toggleEnable(false);return $this};$button.toggleSpin=function(spin){var $this=this;var dialog=$this.dialog;var $icon=$this.find("."+dialog.getNamespace("button-icon"));if(typeof spin==="undefined"){spin=!($button.find(".icon-spin").length>0)}if(spin){$icon.hide();$button.prepend(dialog.createButtonIcon(dialog.getSpinicon()).addClass("icon-spin"))}else{$icon.show();$button.find(".icon-spin").remove()}return $this};$button.spin=function(){var $this=this;$this.toggleSpin(true);return $this};$button.stopSpin=function(){var $this=this;$this.toggleSpin(false);return $this};return this},createButtonIcon:function(icon){var $icon=$("");$icon.addClass(this.getNamespace("button-icon")).addClass(icon);return $icon},enableButtons:function(enable){$.each(this.indexedButtons,function(id,$button){$button.toggleEnable(enable)});return this},updateClosable:function(){if(this.isRealized()){this.getModalHeader().find("."+this.getNamespace("close-button")).toggle(this.isClosable())}return this},onShow:function(onshow){this.options.onshow=onshow;return this},onShown:function(onshown){this.options.onshown=onshown;return this},onHide:function(onhide){this.options.onhide=onhide;return this},onHidden:function(onhidden){this.options.onhidden=onhidden;return this},isRealized:function(){return this.realized},setRealized:function(realized){this.realized=realized;return this},isOpened:function(){return this.opened},setOpened:function(opened){this.opened=opened;return this},handleModalEvents:function(){this.getModal().on("show.bs.modal",{dialog:this},function(event){var dialog=event.data.dialog;dialog.setOpened(true);if(dialog.isModalEvent(event)&&typeof dialog.options.onshow==="function"){var openIt=dialog.options.onshow(dialog);if(openIt===false){dialog.setOpened(false)}return openIt}});this.getModal().on("shown.bs.modal",{dialog:this},function(event){var dialog=event.data.dialog;dialog.isModalEvent(event)&&typeof dialog.options.onshown==="function"&&dialog.options.onshown(dialog)});this.getModal().on("hide.bs.modal",{dialog:this},function(event){var dialog=event.data.dialog;dialog.setOpened(false);if(dialog.isModalEvent(event)&&typeof dialog.options.onhide==="function"){var hideIt=dialog.options.onhide(dialog);if(hideIt===false){dialog.setOpened(true)}return hideIt}});this.getModal().on("hidden.bs.modal",{dialog:this},function(event){var dialog=event.data.dialog;dialog.isModalEvent(event)&&typeof dialog.options.onhidden==="function"&&dialog.options.onhidden(dialog);if(dialog.isAutodestroy()){dialog.setRealized(false);delete BootstrapDialog.dialogs[dialog.getId()];$(this).remove()}BootstrapDialog.moveFocus();if($(".modal").hasClass("in")||$(".modal").hasClass("show")){$("body").addClass("modal-open")}});this.getModal().on("keyup",{dialog:this},function(event){event.which===27&&event.data.dialog.isClosable()&&event.data.dialog.canCloseByKeyboard()&&event.data.dialog.close()});this.getModal().on("keyup",{dialog:this},function(event){var dialog=event.data.dialog;if(typeof dialog.registeredButtonHotkeys[event.which]!=="undefined"){var $button=$(dialog.registeredButtonHotkeys[event.which]);!$button.prop("disabled")&&!$button.is(":focus")&&$button.focus().trigger("click")}});return this},isModalEvent:function(event){return typeof event.namespace!=="undefined"&&event.namespace==="bs.modal"},makeModalDraggable:function(){if(this.options.draggable){this.getModalHeader().addClass(this.getNamespace("draggable")).on("mousedown",{dialog:this},function(event){event.preventDefault();var dialog=event.data.dialog;dialog.draggableData.isMouseDown=true;var dialogOffset=dialog.getModalDialog().offset();dialog.draggableData.mouseOffset={top:event.clientY-dialogOffset.top,left:event.clientX-dialogOffset.left}});this.getModal().on("mouseup",{dialog:this},function(event){event.data.dialog.draggableData.isMouseDown=false});$("body").on("mousemove",{dialog:this},function(event){var dialog=event.data.dialog;if(!dialog.draggableData.isMouseDown){return}dialog.getModalDialog().offset({top:event.clientY-dialog.draggableData.mouseOffset.top,left:event.clientX-dialog.draggableData.mouseOffset.left})}).on("mouseleave",{dialog:this},function(event){event.data.dialog.draggableData.isMouseDown=false})}return this},realize:function(){this.initModalStuff();this.getModal().addClass(BootstrapDialog.NAMESPACE).addClass(this.getCssClass());this.updateSize();if(this.getDescription()){this.getModal().attr("aria-describedby",this.getDescription())}if(this.getVerticalCentered()){this.getModalDialog().addClass("modal-dialog-centered")}this.getModalHeader().append(this.createHeaderContent());this.getModalBody().append(this.createBodyContent());this.getModal().data("bs.modal",new BootstrapDialogModal(this.getModalForBootstrapDialogModal(),{backdrop:this.isClosable()&&this.canCloseByBackdrop()?true:"static",keyboard:false,show:false}));this.makeModalDraggable();this.handleModalEvents();this.setRealized(true);this.updateButtons();this.updateType();this.updateTitle();this.updateMessage();this.updateClosable();this.updateAnimate();this.updateSize();this.updateTabindex();return this},open:function(){!this.isRealized()&&this.realize();this.getModal().modal("show");return this},close:function(){!this.isRealized()&&this.realize();this.getModal().modal("hide");return this}};BootstrapDialog.prototype=$.extend(BootstrapDialog.prototype,BootstrapDialog.METHODS_TO_OVERRIDE[BootstrapDialogModal.getModalVersion()]);BootstrapDialog.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c==="x"?r:r&3|8;return v.toString(16)})};BootstrapDialog.show=function(options){return new BootstrapDialog(options).open()};BootstrapDialog.alert=function(){var alertOptions={};var defaultAlertOptions={type:BootstrapDialog.TYPE_PRIMARY,title:null,message:null,closable:false,draggable:false,buttonLabel:BootstrapDialog.DEFAULT_TEXTS.OK,buttonHotkey:null,callback:null};if(typeof arguments[0]==="object"&&arguments[0].constructor==={}.constructor){alertOptions=$.extend(true,defaultAlertOptions,arguments[0])}else{alertOptions=$.extend(true,defaultAlertOptions,{message:arguments[0],callback:typeof arguments[1]!=="undefined"?arguments[1]:null})}var dialog=new BootstrapDialog(alertOptions);dialog.setData("callback",alertOptions.callback);dialog.addButton({label:alertOptions.buttonLabel,hotkey:alertOptions.buttonHotkey,action:function(dialog){if(typeof dialog.getData("callback")==="function"&&dialog.getData("callback").call(this,true)===false){return false}dialog.setData("btnClicked",true);return dialog.close()}});if(typeof dialog.options.onhide==="function"){dialog.onHide(function(dialog){var hideIt=true;if(!dialog.getData("btnClicked")&&dialog.isClosable()&&typeof dialog.getData("callback")==="function"){hideIt=dialog.getData("callback")(false)}if(hideIt===false){return false}hideIt=this.onhide(dialog);return hideIt}.bind({onhide:dialog.options.onhide}))}else{dialog.onHide(function(dialog){var hideIt=true;if(!dialog.getData("btnClicked")&&dialog.isClosable()&&typeof dialog.getData("callback")==="function"){hideIt=dialog.getData("callback")(false)}return hideIt})}return dialog.open()};BootstrapDialog.confirm=function(){var confirmOptions={};var defaultConfirmOptions={type:BootstrapDialog.TYPE_PRIMARY,title:null,message:null,closable:false,draggable:false,btnCancelLabel:BootstrapDialog.DEFAULT_TEXTS.CANCEL,btnCancelClass:null,btnCancelHotkey:null,btnOKLabel:BootstrapDialog.DEFAULT_TEXTS.OK,btnOKClass:null,btnOKHotkey:null,btnsOrder:BootstrapDialog.defaultOptions.btnsOrder,callback:null};if(typeof arguments[0]==="object"&&arguments[0].constructor==={}.constructor){confirmOptions=$.extend(true,defaultConfirmOptions,arguments[0])}else{confirmOptions=$.extend(true,defaultConfirmOptions,{message:arguments[0],callback:typeof arguments[1]!=="undefined"?arguments[1]:null})}if(confirmOptions.btnOKClass===null){confirmOptions.btnOKClass=["btn",confirmOptions.type.split("-")[1]].join("-")}var dialog=new BootstrapDialog(confirmOptions);dialog.setData("callback",confirmOptions.callback);var buttons=[{label:confirmOptions.btnCancelLabel,cssClass:confirmOptions.btnCancelClass,hotkey:confirmOptions.btnCancelHotkey,action:function(dialog){if(typeof dialog.getData("callback")==="function"&&dialog.getData("callback").call(this,false)===false){return false}return dialog.close()}},{label:confirmOptions.btnOKLabel,cssClass:confirmOptions.btnOKClass,hotkey:confirmOptions.btnOKHotkey,action:function(dialog){if(typeof dialog.getData("callback")==="function"&&dialog.getData("callback").call(this,true)===false){return false}return dialog.close()}}];if(confirmOptions.btnsOrder===BootstrapDialog.BUTTONS_ORDER_OK_CANCEL){buttons.reverse()}dialog.addButtons(buttons);return dialog.open()};BootstrapDialog.warning=function(message,callback){return new BootstrapDialog({type:BootstrapDialog.TYPE_WARNING,message:message}).open()};BootstrapDialog.danger=function(message,callback){return new BootstrapDialog({type:BootstrapDialog.TYPE_DANGER,message:message}).open()};BootstrapDialog.success=function(message,callback){return new BootstrapDialog({type:BootstrapDialog.TYPE_SUCCESS,message:message}).open()};return BootstrapDialog}); \ No newline at end of file diff --git a/package.json b/package.json index e628947..dac2bda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bootstrap4-dialog", - "version": "4.4.2", + "version": "4.4.3", "description": "Make use of Bootstrap Modal more monkey-friendly.", "directories": { "example": "examples" diff --git a/src/js/bootstrap-dialog.min.js b/src/js/bootstrap-dialog.min.js index bcc0b77..5c4dd05 100644 --- a/src/js/bootstrap-dialog.min.js +++ b/src/js/bootstrap-dialog.min.js @@ -1 +1 @@ -!function(t,e){"use strict";"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery"),require("bootstrap")):"function"==typeof define&&define.amd?define("bootstrap-dialog",["jquery","bootstrap"],e):t.BootstrapDialog=e(t.jQuery)}(this||window,function(a){"use strict";function t(t,e){return bootstrap&&bootstrap.Modal&&/^5\.[^\D0]\./.test(bootstrap.Modal.VERSION)||bootstrap&&bootstrap.Modal&&/^5\.0\.2/.test(bootstrap.Modal.VERSION)||/4\.1\.\d+/.test(a.fn.modal.Constructor.VERSION)?new o(t,e):void o.call(this,t,e)}var o=bootstrap.Modal||a.fn.modal.Constructor;t.getModalVersion=function(){return bootstrap&&bootstrap.Modal&&/^5\.[^\D0]\./.test(bootstrap.Modal.VERSION)||bootstrap&&bootstrap.Modal&&/^5\.0\.[23456789]/.test(bootstrap.Modal.VERSION)?"v5.1":void 0===a.fn.modal.Constructor.VERSION?"v3.1":/3\.2\.\d+/.test(a.fn.modal.Constructor.VERSION)?"v3.2":/3\.3\.[1,2]/.test(a.fn.modal.Constructor.VERSION)?"v3.3":/4\.\d\.\d+/.test(a.fn.modal.Constructor.VERSION)?"v4.1":"v3.3.4"},t.ORIGINAL_BODY_PADDING=parseInt(a("body").css("padding-right")||0,10),(t.METHODS_TO_OVERRIDE={})["v3.1"]={},t.METHODS_TO_OVERRIDE["v3.2"]={hide:function(t){t&&t.preventDefault(),t=a.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,0===this.getGlobalOpenedDialogs().length&&this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())}},t.METHODS_TO_OVERRIDE["v3.3"]={setScrollbar:function(){this.bodyIsOverflowing&&this.$body.css("padding-right",t.ORIGINAL_BODY_PADDING+this.scrollbarWidth)},resetScrollbar:function(){0===this.getGlobalOpenedDialogs().length&&this.$body.css("padding-right",t.ORIGINAL_BODY_PADDING)},hideModal:function(){this.$element.hide(),this.backdrop(a.proxy(function(){0===this.getGlobalOpenedDialogs().length&&this.$body.removeClass("modal-open"),this.resetAdjustments(),this.resetScrollbar(),this.$element.trigger("hidden.bs.modal")},this))}},t.METHODS_TO_OVERRIDE["v3.3.4"]=a.extend({},t.METHODS_TO_OVERRIDE["v3.3"]),t.METHODS_TO_OVERRIDE["v4.1"]=a.extend({},t.METHODS_TO_OVERRIDE["v3.3"]),t.METHODS_TO_OVERRIDE["v5.1"]=a.extend({},t.METHODS_TO_OVERRIDE["v4.1"]),t.prototype={constructor:t,getGlobalOpenedDialogs:function(){var o=[];return a.each(d.dialogs,function(t,e){e.isRealized()&&e.isOpened()&&o.push(e)}),o}},t.prototype=a.extend(t.prototype,o.prototype,t.METHODS_TO_OVERRIDE[t.getModalVersion()]);var d=function(t){this.defaultOptions=a.extend(!0,{id:d.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},d.defaultOptions),this.indexedButtons={},this.registeredButtonHotkeys={},this.draggableData={isMouseDown:!1,mouseOffset:{}},this.realized=!1,this.opened=!1,this.initOptions(t),this.holdThisInstance()};return d.BootstrapDialogModal=t,d.NAMESPACE="bootstrap-dialog",d.TYPE_DEFAULT="type-default",d.TYPE_INFO="type-info",d.TYPE_PRIMARY="type-primary",d.TYPE_SECONDARY="type-secondary",d.TYPE_SUCCESS="type-success",d.TYPE_WARNING="type-warning",d.TYPE_DANGER="type-danger",d.TYPE_DARK="type-dark",d.TYPE_LIGHT="type-light",d.DEFAULT_TEXTS={},d.DEFAULT_TEXTS[d.TYPE_DEFAULT]="Default",d.DEFAULT_TEXTS[d.TYPE_INFO]="Information",d.DEFAULT_TEXTS[d.TYPE_PRIMARY]="Primary",d.DEFAULT_TEXTS[d.TYPE_SECONDARY]="Secondary",d.DEFAULT_TEXTS[d.TYPE_SUCCESS]="Success",d.DEFAULT_TEXTS[d.TYPE_WARNING]="Warning",d.DEFAULT_TEXTS[d.TYPE_DANGER]="Danger",d.DEFAULT_TEXTS[d.TYPE_DARK]="Dark",d.DEFAULT_TEXTS[d.TYPE_LIGHT]="Light",d.DEFAULT_TEXTS.OK="OK",d.DEFAULT_TEXTS.CANCEL="Cancel",d.DEFAULT_TEXTS.CONFIRM="Confirmation",d.SIZE_NORMAL="size-normal",d.SIZE_SMALL="size-small",d.SIZE_WIDE="size-wide",d.SIZE_EXTRAWIDE="size-extrawide",d.SIZE_LARGE="size-large",d.BUTTON_SIZES={},d.BUTTON_SIZES[d.SIZE_NORMAL]="",d.BUTTON_SIZES[d.SIZE_SMALL]="btn-small",d.BUTTON_SIZES[d.SIZE_WIDE]="btn-block",d.BUTTON_SIZES[d.SIZE_LARGE]="btn-lg",d.ICON_SPINNER="fas fa-spinner",d.BUTTONS_ORDER_CANCEL_OK="btns-order-cancel-ok",d.BUTTONS_ORDER_OK_CANCEL="btns-order-ok-cancel",d.Z_INDEX_BACKDROP=1040,d.Z_INDEX_MODAL=1050,d.defaultOptions={type:d.TYPE_PRIMARY,size:d.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:!0,closable:!0,closeByBackdrop:!0,closeByKeyboard:!0,closeIcon:"×",spinicon:d.ICON_SPINNER,autodestroy:!0,draggable:!1,animate:!0,description:"",tabindex:-1,verticalCentered:!1,btnsOrder:d.BUTTONS_ORDER_CANCEL_OK},d.configDefaultOptions=function(t){d.defaultOptions=a.extend(!0,d.defaultOptions,t)},d.dialogs={},d.openAll=function(){a.each(d.dialogs,function(t,e){e.open()})},d.closeAll=function(){a.each(d.dialogs,function(t,e){e.close()})},d.getDialog=function(t){var e=null;return e=void 0!==d.dialogs[t]?d.dialogs[t]:e},d.setDialog=function(t){return d.dialogs[t.getId()]=t},d.addDialog=function(t){return d.setDialog(t)},d.moveFocus=function(){var o=null;a.each(d.dialogs,function(t,e){e.isRealized()&&e.isOpened()&&(o=e)}),null!==o&&o.getModal().focus()},d.METHODS_TO_OVERRIDE={},d.METHODS_TO_OVERRIDE["v3.1"]={updateZIndex:function(){var t,e,o,n,i;return this.isOpened()&&(t=d.Z_INDEX_BACKDROP,e=d.Z_INDEX_MODAL,o=0,a.each(d.dialogs,function(t,e){e.isRealized()&&e.isOpened()&&o++}),n=this.getModal(),i=this.getModalBackdrop(n),n.css("z-index",e+20*(o-1)),i.css("z-index",t+20*(o-1))),this},open:function(){return this.isRealized()||this.realize(),this.getModal().modal("show"),this.updateZIndex(),this}},d.METHODS_TO_OVERRIDE["v3.2"]={updateZIndex:d.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:d.METHODS_TO_OVERRIDE["v3.1"].open},d.METHODS_TO_OVERRIDE["v3.3"]={},d.METHODS_TO_OVERRIDE["v3.3.4"]=a.extend({},d.METHODS_TO_OVERRIDE["v3.1"]),d.METHODS_TO_OVERRIDE["v4.0"]={getModalBackdrop:function(t){return a(t.data("bs.modal")._backdrop)},updateZIndex:d.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:d.METHODS_TO_OVERRIDE["v3.1"].open,getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}},d.METHODS_TO_OVERRIDE["v4.1"]={getModalBackdrop:function(t){return a(t.data("bs.modal")._backdrop)},updateZIndex:d.METHODS_TO_OVERRIDE["v3.1"].updateZIndex,open:d.METHODS_TO_OVERRIDE["v3.1"].open,getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}},d.METHODS_TO_OVERRIDE["v5.1"]=a.extend({},d.METHODS_TO_OVERRIDE["v4.1"],{createCloseButton:function(){var t=a("
");t.addClass(this.getNamespace("close-button"));var e=a('');return t.append(e),t.on("click",{dialog:this},function(t){t.data.dialog.close()}),t}}),d.prototype={constructor:d,initOptions:function(t){return this.options=a.extend(!0,this.defaultOptions,t),this},holdThisInstance:function(){return d.addDialog(this),this},initModalStuff:function(){return this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter()),this.getModal().append(this.getModalDialog()),this.getModalDialog().append(this.getModalContent()),this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter()),this},createModal:function(){var t=a('');return t.prop("id",this.getId()),t.attr("aria-labelledby",this.getId()+"_title"),t},getModal:function(){return this.$modal},setModal:function(t){return this.$modal=t,this},getModalBackdrop:function(t){return t.data("bs.modal").$backdrop},getModalForBootstrapDialogModal:function(){return this.getModal()},createModalDialog:function(){return a('')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function(t){return this.$modalDialog=t,this},createModalContent:function(){return a('')},getModalContent:function(){return this.$modalContent},setModalContent:function(t){return this.$modalContent=t,this},createModalHeader:function(){return a('')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function(t){return this.$modalHeader=t,this},createModalBody:function(){return a('')},getModalBody:function(){return this.$modalBody},setModalBody:function(t){return this.$modalBody=t,this},createModalFooter:function(){return a('')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function(t){return this.$modalFooter=t,this},createDynamicContent:function(t){var e=null;return e="string"==typeof(e="function"==typeof t?t.call(t,this):t)?this.formatStringContent(e):e},formatStringContent:function(t){return this.options.nl2br?t.replace(/\r\n/g,"
").replace(/[\r\n]/g,"
"):t},setData:function(t,e){return this.options.data[t]=e,this},getData:function(t){return this.options.data[t]},setId:function(t){return this.options.id=t,this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(t){return this.options.type=t,this.updateType(),this},updateType:function(){var t;return this.isRealized()&&(t=[d.TYPE_DEFAULT,d.TYPE_INFO,d.TYPE_PRIMARY,d.TYPE_SECONDARY,d.TYPE_SUCCESS,d.TYPE_WARNING,d.TYPE_DARK,d.TYPE_LIGHT,d.TYPE_DANGER],this.getModal().removeClass(t.join(" ")).addClass(this.getType())),this},getSize:function(){return this.options.size},setSize:function(t){return this.options.size=t,this.updateSize(),this},updateSize:function(){var s;return this.isRealized()&&((s=this).getModal().removeClass(d.SIZE_NORMAL).removeClass(d.SIZE_SMALL).removeClass(d.SIZE_WIDE).removeClass(d.SIZE_EXTRAWIDE).removeClass(d.SIZE_LARGE),this.getModal().addClass(this.getSize()),this.getModalDialog().removeClass("modal-sm"),this.getSize()===d.SIZE_SMALL&&this.getModalDialog().addClass("modal-sm"),this.getModalDialog().removeClass("modal-lg"),this.getSize()===d.SIZE_WIDE&&this.getModalDialog().addClass("modal-lg"),this.getModalDialog().removeClass("modal-xl"),this.getSize()===d.SIZE_EXTRAWIDE&&this.getModalDialog().addClass("modal-xl"),a.each(this.options.buttons,function(t,e){var o=s.getButton(e.id),n=["btn-lg","btn-sm","btn-xs"],i=!1;"string"==typeof e.cssClass&&(e=e.cssClass.split(" "),a.each(e,function(t,e){-1!==a.inArray(e,n)&&(i=!0)})),i||(o.removeClass(n.join(" ")),o.addClass(s.getButtonSize()))})),this},getCssClass:function(){return this.options.cssClass},setCssClass:function(t){return this.options.cssClass=t,this},getTitle:function(){return this.options.title},setTitle:function(t){return this.options.title=t,this.updateTitle(),this},updateTitle:function(){var t;return this.isRealized()&&(t=null!==this.getTitle()?this.createDynamicContent(this.getTitle()):this.getDefaultText(),this.getModalHeader().find("."+this.getNamespace("title")).html("").append(t).prop("id",this.getId()+"_title")),this},getMessage:function(){return this.options.message},setMessage:function(t){return this.options.message=t,this.updateMessage(),this},updateMessage:function(){var t;return this.isRealized()&&(t=this.createDynamicContent(this.getMessage()),this.getModalBody().find("."+this.getNamespace("message")).html("").append(t)),this},isClosable:function(){return this.options.closable},setClosable:function(t){return this.options.closable=t,this.updateClosable(),this},setCloseByBackdrop:function(t){return this.options.closeByBackdrop=t,this},canCloseByBackdrop:function(){return this.options.closeByBackdrop},setCloseByKeyboard:function(t){return this.options.closeByKeyboard=t,this},canCloseByKeyboard:function(){return this.options.closeByKeyboard},isAnimate:function(){return this.options.animate},setAnimate:function(t){return this.options.animate=t,this},updateAnimate:function(){return this.isRealized()&&this.getModal().toggleClass("fade",this.isAnimate()),this},getSpinicon:function(){return this.options.spinicon},setSpinicon:function(t){return this.options.spinicon=t,this},addButton:function(t){return this.options.buttons.push(t),this},addButtons:function(t){var o=this;return a.each(t,function(t,e){o.addButton(e)}),this},getButtons:function(){return this.options.buttons},setButtons:function(t){return this.options.buttons=t,this.updateButtons(),this},getButton:function(t){return void 0!==this.indexedButtons[t]?this.indexedButtons[t]:null},getButtonSize:function(){return void 0!==d.BUTTON_SIZES[this.getSize()]?d.BUTTON_SIZES[this.getSize()]:""},updateButtons:function(){return this.isRealized()&&(0===this.getButtons().length?this.getModalFooter().hide():this.getModalFooter().show().closest(".modal-footer").append(this.createFooterButtons())),this},isAutodestroy:function(){return this.options.autodestroy},setAutodestroy:function(t){this.options.autodestroy=t},getDescription:function(){return this.options.description},setDescription:function(t){return this.options.description=t,this},getVerticalCentered:function(){return this.options.verticalCentered},setVerticalCentered:function(t){return this.options.verticalCentered=verticalCentered,this},setTabindex:function(t){return this.options.tabindex=t,this},getTabindex:function(){return this.options.tabindex},updateTabindex:function(){return this.isRealized()&&this.getModal().attr("tabindex",this.getTabindex()),this},getDefaultText:function(){return d.DEFAULT_TEXTS[this.getType()]},getNamespace:function(t){return d.NAMESPACE+"-"+t},createHeaderContent:function(){var t=a("
");return t.addClass(this.getNamespace("header")),t.append(this.createTitleContent()),t.append(this.createCloseButton()),t},createTitleContent:function(){var t=a("
");return t.addClass(this.getNamespace("title")),t},createCloseButton:function(){var t=a("
");t.addClass(this.getNamespace("close-button"));var e=a('');return e.append(this.options.closeIcon),t.append(e),t.on("click",{dialog:this},function(t){t.data.dialog.close()}),t},createBodyContent:function(){var t=a("
");return t.addClass(this.getNamespace("body")),t.append(this.createMessageContent()),t},createMessageContent:function(){var t=a("
");return t.addClass(this.getNamespace("message")),t},createFooterContent:function(){var t=a("
");return t.addClass(this.getNamespace("footer")),t},createFooterButtons:function(){var n=this,i=n.$modalFooter;return this.indexedButtons={},a.each(this.options.buttons,function(t,e){e.id||(e.id=d.newGuid());var o=n.createButton(e);n.indexedButtons[e.id]=o,i.append(o)}),i},createButton:function(t){var o=a('');return o.prop("id",t.id),o.data("button",t),void 0!==t.icon&&""!==a.trim(t.icon)&&o.append(this.createButtonIcon(t.icon)),void 0!==t.label&&o.append(t.label),void 0!==t.title&&o.attr("title",t.title),void 0!==t.cssClass&&""!==a.trim(t.cssClass)?o.addClass(t.cssClass):o.addClass("btn-secondary"),"object"==typeof t.data&&t.data.constructor==={}.constructor&&a.each(t.data,function(t,e){o.attr("data-"+t,e)}),void 0!==t.hotkey&&(this.registeredButtonHotkeys[t.hotkey]=o),o.on("click",{dialog:this,$button:o,button:t},function(t){var e=t.data.dialog,o=t.data.$button,n=o.data("button");if(n.autospin&&o.toggleSpin(!0),"function"==typeof n.action)return n.action.call(o,e,t)}),this.enhanceButton(o),void 0!==t.enabled&&o.toggleEnable(t.enabled),o.addClass("bootstrap4-dialog-button"),o},enhanceButton:function(n){return n.dialog=this,n.toggleEnable=function(t){return void 0!==t?this.prop("disabled",!t).toggleClass("disabled",!t):this.prop("disabled",!this.prop("disabled")),this},n.enable=function(){return this.toggleEnable(!0),this},n.disable=function(){return this.toggleEnable(!1),this},n.toggleSpin=function(t){var e=this.dialog,o=this.find("."+e.getNamespace("button-icon"));return(t=void 0===t?!(0");return e.addClass(this.getNamespace("button-icon")).addClass(t),e},enableButtons:function(o){return a.each(this.indexedButtons,function(t,e){e.toggleEnable(o)}),this},updateClosable:function(){return this.isRealized()&&this.getModalHeader().find("."+this.getNamespace("close-button")).toggle(this.isClosable()),this},onShow:function(t){return this.options.onshow=t,this},onShown:function(t){return this.options.onshown=t,this},onHide:function(t){return this.options.onhide=t,this},onHidden:function(t){return this.options.onhidden=t,this},isRealized:function(){return this.realized},setRealized:function(t){return this.realized=t,this},isOpened:function(){return this.opened},setOpened:function(t){return this.opened=t,this},handleModalEvents:function(){return this.getModal().on("show.bs.modal",{dialog:this},function(t){var e=t.data.dialog;if(e.setOpened(!0),e.isModalEvent(t)&&"function"==typeof e.options.onshow){t=e.options.onshow(e);return!1===t&&e.setOpened(!1),t}}),this.getModal().on("shown.bs.modal",{dialog:this},function(t){var e=t.data.dialog;e.isModalEvent(t)&&"function"==typeof e.options.onshown&&e.options.onshown(e)}),this.getModal().on("hide.bs.modal",{dialog:this},function(t){var e=t.data.dialog;if(e.setOpened(!1),e.isModalEvent(t)&&"function"==typeof e.options.onhide){t=e.options.onhide(e);return!1===t&&e.setOpened(!0),t}}),this.getModal().on("hidden.bs.modal",{dialog:this},function(t){var e=t.data.dialog;e.isModalEvent(t)&&"function"==typeof e.options.onhidden&&e.options.onhidden(e),e.isAutodestroy()&&(e.setRealized(!1),delete d.dialogs[e.getId()],a(this).remove()),d.moveFocus(),(a(".modal").hasClass("in")||a(".modal").hasClass("show"))&&a("body").addClass("modal-open")}),this.getModal().on("keyup",{dialog:this},function(t){27===t.which&&t.data.dialog.isClosable()&&t.data.dialog.canCloseByKeyboard()&&t.data.dialog.close()}),this.getModal().on("keyup",{dialog:this},function(t){var e=t.data.dialog;void 0!==e.registeredButtonHotkeys[t.which]&&((t=a(e.registeredButtonHotkeys[t.which])).prop("disabled")||t.is(":focus")||t.focus().trigger("click"))}),this},isModalEvent:function(t){return void 0!==t.namespace&&"bs.modal"===t.namespace},makeModalDraggable:function(){return this.options.draggable&&(this.getModalHeader().addClass(this.getNamespace("draggable")).on("mousedown",{dialog:this},function(t){t.preventDefault();var e=t.data.dialog;e.draggableData.isMouseDown=!0;var o=e.getModalDialog().offset();e.draggableData.mouseOffset={top:t.clientY-o.top,left:t.clientX-o.left}}),this.getModal().on("mouseup",{dialog:this},function(t){t.data.dialog.draggableData.isMouseDown=!1}),a("body").on("mousemove",{dialog:this},function(t){var e=t.data.dialog;e.draggableData.isMouseDown&&e.getModalDialog().offset({top:t.clientY-e.draggableData.mouseOffset.top,left:t.clientX-e.draggableData.mouseOffset.left})}).on("mouseleave",{dialog:this},function(t){t.data.dialog.draggableData.isMouseDown=!1})),this},realize:function(){return this.initModalStuff(),this.getModal().addClass(d.NAMESPACE).addClass(this.getCssClass()),this.updateSize(),this.getDescription()&&this.getModal().attr("aria-describedby",this.getDescription()),this.getVerticalCentered()&&this.getModalDialog().addClass("modal-dialog-centered"),this.getModalHeader().append(this.createHeaderContent()),this.getModalBody().append(this.createBodyContent()),this.getModal().data("bs.modal",new t(this.getModalForBootstrapDialogModal(),{backdrop:!(!this.isClosable()||!this.canCloseByBackdrop())||"static",keyboard:!1,show:!1})),this.makeModalDraggable(),this.handleModalEvents(),this.setRealized(!0),this.updateButtons(),this.updateType(),this.updateTitle(),this.updateMessage(),this.updateClosable(),this.updateAnimate(),this.updateSize(),this.updateTabindex(),this},open:function(){return this.isRealized()||this.realize(),this.getModal().modal("show"),this},close:function(){return this.isRealized()||this.realize(),this.getModal().modal("hide"),this}},d.prototype=a.extend(d.prototype,d.METHODS_TO_OVERRIDE[t.getModalVersion()]),d.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})},d.show=function(t){return new d(t).open()},d.alert=function(){var t={},e={type:d.TYPE_PRIMARY,title:null,message:null,closable:!1,draggable:!1,buttonLabel:d.DEFAULT_TEXTS.OK,buttonHotkey:null,callback:null},t="object"==typeof arguments[0]&&arguments[0].constructor==={}.constructor?a.extend(!0,e,arguments[0]):a.extend(!0,e,{message:arguments[0],callback:void 0!==arguments[1]?arguments[1]:null}),e=new d(t);return e.setData("callback",t.callback),e.addButton({label:t.buttonLabel,hotkey:t.buttonHotkey,action:function(t){return("function"!=typeof t.getData("callback")||!1!==t.getData("callback").call(this,!0))&&(t.setData("btnClicked",!0),t.close())}}),"function"==typeof e.options.onhide?e.onHide(function(t){var e=!0;return!1!==(e=!t.getData("btnClicked")&&t.isClosable()&&"function"==typeof t.getData("callback")?t.getData("callback")(!1):e)&&(e=this.onhide(t))}.bind({onhide:e.options.onhide})):e.onHide(function(t){var e=!0;return e=!t.getData("btnClicked")&&t.isClosable()&&"function"==typeof t.getData("callback")?t.getData("callback")(!1):e}),e.open()},d.confirm=function(){var t={},e={type:d.TYPE_PRIMARY,title:null,message:null,closable:!1,draggable:!1,btnCancelLabel:d.DEFAULT_TEXTS.CANCEL,btnCancelClass:null,btnCancelHotkey:null,btnOKLabel:d.DEFAULT_TEXTS.OK,btnOKClass:null,btnOKHotkey:null,btnsOrder:d.defaultOptions.btnsOrder,callback:null};null===(t="object"==typeof arguments[0]&&arguments[0].constructor==={}.constructor?a.extend(!0,e,arguments[0]):a.extend(!0,e,{message:arguments[0],callback:void 0!==arguments[1]?arguments[1]:null})).btnOKClass&&(t.btnOKClass=["btn",t.type.split("-")[1]].join("-"));var o=new d(t);o.setData("callback",t.callback);e=[{label:t.btnCancelLabel,cssClass:t.btnCancelClass,hotkey:t.btnCancelHotkey,action:function(t){return("function"!=typeof t.getData("callback")||!1!==t.getData("callback").call(this,!1))&&t.close()}},{label:t.btnOKLabel,cssClass:t.btnOKClass,hotkey:t.btnOKHotkey,action:function(t){return("function"!=typeof t.getData("callback")||!1!==t.getData("callback").call(this,!0))&&t.close()}}];return t.btnsOrder===d.BUTTONS_ORDER_OK_CANCEL&&e.reverse(),o.addButtons(e),o.open()},d.warning=function(t,e){return new d({type:d.TYPE_WARNING,message:t}).open()},d.danger=function(t,e){return new d({type:d.TYPE_DANGER,message:t}).open()},d.success=function(t,e){return new d({type:d.TYPE_SUCCESS,message:t}).open()},d}); \ No newline at end of file +(function(root,factory){"use strict";if(typeof module!=="undefined"&&module.exports){module.exports=factory(require("jquery"),require("bootstrap"))}else if(typeof define==="function"&&define.amd){define("bootstrap-dialog",["jquery","bootstrap"],function($){return factory($)})}else{root.BootstrapDialog=factory(root.jQuery)}})(this?this:window,function($){"use strict";var Modal=bootstrap.Modal?bootstrap.Modal:$.fn.modal.Constructor;var BootstrapDialogModal=function(element,options){if(bootstrap&&bootstrap.Modal&&/^5\.[^\D0]\./.test(bootstrap.Modal.VERSION)){return new Modal(element,options)}else if(bootstrap&&bootstrap.Modal&&/^5\.0\.2/.test(bootstrap.Modal.VERSION)){return new Modal(element,options)}else if(/4\.1\.\d+/.test($.fn.modal.Constructor.VERSION)){return new Modal(element,options)}else{Modal.call(this,element,options)}};BootstrapDialogModal.getModalVersion=function(){var version=null;if(bootstrap&&bootstrap.Modal&&/^5\.[^\D0]\./.test(bootstrap.Modal.VERSION)){version="v5.1"}else if(bootstrap&&bootstrap.Modal&&/^5\.0\.[23456789]/.test(bootstrap.Modal.VERSION)){version="v5.1"}else if(typeof $.fn.modal.Constructor.VERSION==="undefined"){version="v3.1"}else if(/3\.2\.\d+/.test($.fn.modal.Constructor.VERSION)){version="v3.2"}else if(/3\.3\.[1,2]/.test($.fn.modal.Constructor.VERSION)){version="v3.3"}else if(/4\.\d\.\d+/.test($.fn.modal.Constructor.VERSION)){version="v4.1"}else{version="v3.3.4"}return version};BootstrapDialogModal.ORIGINAL_BODY_PADDING=parseInt($("body").css("padding-right")||0,10);BootstrapDialogModal.METHODS_TO_OVERRIDE={};BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.1"]={};BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.2"]={hide:function(e){if(e){e.preventDefault()}e=$.Event("hide.bs.modal");this.$element.trigger(e);if(!this.isShown||e.isDefaultPrevented()){return}this.isShown=false;var openedDialogs=this.getGlobalOpenedDialogs();if(openedDialogs.length===0){this.$body.removeClass("modal-open")}this.resetScrollbar();this.escape();$(document).off("focusin.bs.modal");this.$element.removeClass("in").attr("aria-hidden",true).off("click.dismiss.bs.modal");$.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",$.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal()}};BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.3"]={setScrollbar:function(){var bodyPad=BootstrapDialogModal.ORIGINAL_BODY_PADDING;if(this.bodyIsOverflowing){this.$body.css("padding-right",bodyPad+this.scrollbarWidth)}},resetScrollbar:function(){var openedDialogs=this.getGlobalOpenedDialogs();if(openedDialogs.length===0){this.$body.css("padding-right",BootstrapDialogModal.ORIGINAL_BODY_PADDING)}},hideModal:function(){this.$element.hide();this.backdrop($.proxy(function(){var openedDialogs=this.getGlobalOpenedDialogs();if(openedDialogs.length===0){this.$body.removeClass("modal-open")}this.resetAdjustments();this.resetScrollbar();this.$element.trigger("hidden.bs.modal")},this))}};BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.3.4"]=$.extend({},BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.3"]);BootstrapDialogModal.METHODS_TO_OVERRIDE["v4.1"]=$.extend({},BootstrapDialogModal.METHODS_TO_OVERRIDE["v3.3"]);BootstrapDialogModal.METHODS_TO_OVERRIDE["v5.1"]=$.extend({},BootstrapDialogModal.METHODS_TO_OVERRIDE["v4.1"]);BootstrapDialogModal.prototype={constructor:BootstrapDialogModal,getGlobalOpenedDialogs:function(){var openedDialogs=[];$.each(BootstrapDialog.dialogs,function(id,dialogInstance){if(dialogInstance.isRealized()&&dialogInstance.isOpened()){openedDialogs.push(dialogInstance)}});return openedDialogs}};BootstrapDialogModal.prototype=$.extend(BootstrapDialogModal.prototype,Modal.prototype,BootstrapDialogModal.METHODS_TO_OVERRIDE[BootstrapDialogModal.getModalVersion()]);var BootstrapDialog=function(options){this.defaultOptions=$.extend(true,{id:BootstrapDialog.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},BootstrapDialog.defaultOptions);this.indexedButtons={};this.registeredButtonHotkeys={};this.draggableData={isMouseDown:false,mouseOffset:{}};this.realized=false;this.opened=false;this.initOptions(options);this.holdThisInstance()};BootstrapDialog.BootstrapDialogModal=BootstrapDialogModal;BootstrapDialog.NAMESPACE="bootstrap-dialog";BootstrapDialog.TYPE_DEFAULT="type-default";BootstrapDialog.TYPE_INFO="type-info";BootstrapDialog.TYPE_PRIMARY="type-primary";BootstrapDialog.TYPE_SECONDARY="type-secondary";BootstrapDialog.TYPE_SUCCESS="type-success";BootstrapDialog.TYPE_WARNING="type-warning";BootstrapDialog.TYPE_DANGER="type-danger";BootstrapDialog.TYPE_DARK="type-dark";BootstrapDialog.TYPE_LIGHT="type-light";BootstrapDialog.DEFAULT_TEXTS={};BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DEFAULT]="Default";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_INFO]="Information";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_PRIMARY]="Primary";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_SECONDARY]="Secondary";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_SUCCESS]="Success";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_WARNING]="Warning";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DANGER]="Danger";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DARK]="Dark";BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_LIGHT]="Light";BootstrapDialog.DEFAULT_TEXTS["OK"]="OK";BootstrapDialog.DEFAULT_TEXTS["CANCEL"]="Cancel";BootstrapDialog.DEFAULT_TEXTS["CONFIRM"]="Confirmation";BootstrapDialog.SIZE_NORMAL="size-normal";BootstrapDialog.SIZE_SMALL="size-small";BootstrapDialog.SIZE_WIDE="size-wide";BootstrapDialog.SIZE_EXTRAWIDE="size-extrawide";BootstrapDialog.SIZE_LARGE="size-large";BootstrapDialog.BUTTON_SIZES={};BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_NORMAL]="";BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_SMALL]="btn-small";BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_WIDE]="btn-block";BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_LARGE]="btn-lg";BootstrapDialog.ICON_SPINNER="fas fa-spinner";BootstrapDialog.BUTTONS_ORDER_CANCEL_OK="btns-order-cancel-ok";BootstrapDialog.BUTTONS_ORDER_OK_CANCEL="btns-order-ok-cancel";BootstrapDialog.Z_INDEX_BACKDROP=1040;BootstrapDialog.Z_INDEX_MODAL=1050;BootstrapDialog.defaultOptions={type:BootstrapDialog.TYPE_PRIMARY,size:BootstrapDialog.SIZE_NORMAL,cssClass:"",title:null,message:null,nl2br:true,closable:true,closeByBackdrop:true,closeByKeyboard:true,closeIcon:"×",spinicon:BootstrapDialog.ICON_SPINNER,autodestroy:true,draggable:false,animate:true,description:"",tabindex:-1,verticalCentered:false,btnsOrder:BootstrapDialog.BUTTONS_ORDER_CANCEL_OK};BootstrapDialog.configDefaultOptions=function(options){BootstrapDialog.defaultOptions=$.extend(true,BootstrapDialog.defaultOptions,options)};BootstrapDialog.dialogs={};BootstrapDialog.openAll=function(){$.each(BootstrapDialog.dialogs,function(id,dialogInstance){dialogInstance.open()})};BootstrapDialog.closeAll=function(){$.each(BootstrapDialog.dialogs,function(id,dialogInstance){dialogInstance.close()})};BootstrapDialog.getDialog=function(id){var dialog=null;if(typeof BootstrapDialog.dialogs[id]!=="undefined"){dialog=BootstrapDialog.dialogs[id]}return dialog};BootstrapDialog.setDialog=function(dialog){BootstrapDialog.dialogs[dialog.getId()]=dialog;return dialog};BootstrapDialog.addDialog=function(dialog){return BootstrapDialog.setDialog(dialog)};BootstrapDialog.moveFocus=function(){var lastDialogInstance=null;$.each(BootstrapDialog.dialogs,function(id,dialogInstance){if(dialogInstance.isRealized()&&dialogInstance.isOpened()){lastDialogInstance=dialogInstance}});if(lastDialogInstance!==null){lastDialogInstance.getModal().focus()}};BootstrapDialog.METHODS_TO_OVERRIDE={};BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]={updateZIndex:function(){if(this.isOpened()){var zIndexBackdrop=BootstrapDialog.Z_INDEX_BACKDROP;var zIndexModal=BootstrapDialog.Z_INDEX_MODAL;var dialogCount=0;$.each(BootstrapDialog.dialogs,function(dialogId,dialogInstance){if(dialogInstance.isRealized()&&dialogInstance.isOpened()){dialogCount++}});var $modal=this.getModal();var $backdrop=this.getModalBackdrop($modal);$modal.css("z-index",zIndexModal+(dialogCount-1)*20);$backdrop.css("z-index",zIndexBackdrop+(dialogCount-1)*20)}return this},open:function(){!this.isRealized()&&this.realize();this.getModal().modal("show");this.updateZIndex();return this}};BootstrapDialog.METHODS_TO_OVERRIDE["v3.2"]={updateZIndex:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["open"]};BootstrapDialog.METHODS_TO_OVERRIDE["v3.3"]={};BootstrapDialog.METHODS_TO_OVERRIDE["v3.3.4"]=$.extend({},BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]);BootstrapDialog.METHODS_TO_OVERRIDE["v4.0"]={getModalBackdrop:function($modal){return $($modal.data("bs.modal")._backdrop)},updateZIndex:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["open"],getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}};BootstrapDialog.METHODS_TO_OVERRIDE["v4.1"]={getModalBackdrop:function($modal){return $($modal.data("bs.modal")._backdrop)},updateZIndex:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["updateZIndex"],open:BootstrapDialog.METHODS_TO_OVERRIDE["v3.1"]["open"],getModalForBootstrapDialogModal:function(){return this.getModal().get(0)}};BootstrapDialog.METHODS_TO_OVERRIDE["v5.1"]=$.extend({},BootstrapDialog.METHODS_TO_OVERRIDE["v4.1"],{createCloseButton:function(){var $container=$("
");$container.addClass(this.getNamespace("close-button"));var $icon=$('');$container.append($icon);$container.on("click",{dialog:this},function(event){event.data.dialog.close()});return $container}});BootstrapDialog.prototype={constructor:BootstrapDialog,initOptions:function(options){this.options=$.extend(true,this.defaultOptions,options);return this},holdThisInstance:function(){BootstrapDialog.addDialog(this);return this},initModalStuff:function(){this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter());this.getModal().append(this.getModalDialog());this.getModalDialog().append(this.getModalContent());this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter());return this},createModal:function(){var $modal=$('');$modal.prop("id",this.getId());$modal.attr("aria-labelledby",this.getId()+"_title");return $modal},getModal:function(){return this.$modal},setModal:function($modal){this.$modal=$modal;return this},getModalBackdrop:function($modal){return $modal.data("bs.modal").$backdrop},getModalForBootstrapDialogModal:function(){return this.getModal()},createModalDialog:function(){return $('')},getModalDialog:function(){return this.$modalDialog},setModalDialog:function($modalDialog){this.$modalDialog=$modalDialog;return this},createModalContent:function(){return $('')},getModalContent:function(){return this.$modalContent},setModalContent:function($modalContent){this.$modalContent=$modalContent;return this},createModalHeader:function(){return $('')},getModalHeader:function(){return this.$modalHeader},setModalHeader:function($modalHeader){this.$modalHeader=$modalHeader;return this},createModalBody:function(){return $('')},getModalBody:function(){return this.$modalBody},setModalBody:function($modalBody){this.$modalBody=$modalBody;return this},createModalFooter:function(){return $('')},getModalFooter:function(){return this.$modalFooter},setModalFooter:function($modalFooter){this.$modalFooter=$modalFooter;return this},createDynamicContent:function(rawContent){var content=null;if(typeof rawContent==="function"){content=rawContent.call(rawContent,this)}else{content=rawContent}if(typeof content==="string"){content=this.formatStringContent(content)}return content},formatStringContent:function(content){if(this.options.nl2br){return content.replace(/\r\n/g,"
").replace(/[\r\n]/g,"
")}return content},setData:function(key,value){this.options.data[key]=value;return this},getData:function(key){return this.options.data[key]},setId:function(id){this.options.id=id;return this},getId:function(){return this.options.id},getType:function(){return this.options.type},setType:function(type){this.options.type=type;this.updateType();return this},updateType:function(){if(this.isRealized()){var types=[BootstrapDialog.TYPE_DEFAULT,BootstrapDialog.TYPE_INFO,BootstrapDialog.TYPE_PRIMARY,BootstrapDialog.TYPE_SECONDARY,BootstrapDialog.TYPE_SUCCESS,BootstrapDialog.TYPE_WARNING,BootstrapDialog.TYPE_DARK,BootstrapDialog.TYPE_LIGHT,BootstrapDialog.TYPE_DANGER];this.getModal().removeClass(types.join(" ")).addClass(this.getType())}return this},getSize:function(){return this.options.size},setSize:function(size){this.options.size=size;this.updateSize();return this},updateSize:function(){if(this.isRealized()){var dialog=this;this.getModal().removeClass(BootstrapDialog.SIZE_NORMAL).removeClass(BootstrapDialog.SIZE_SMALL).removeClass(BootstrapDialog.SIZE_WIDE).removeClass(BootstrapDialog.SIZE_EXTRAWIDE).removeClass(BootstrapDialog.SIZE_LARGE);this.getModal().addClass(this.getSize());this.getModalDialog().removeClass("modal-sm");if(this.getSize()===BootstrapDialog.SIZE_SMALL){this.getModalDialog().addClass("modal-sm")}this.getModalDialog().removeClass("modal-lg");if(this.getSize()===BootstrapDialog.SIZE_WIDE){this.getModalDialog().addClass("modal-lg")}this.getModalDialog().removeClass("modal-xl");if(this.getSize()===BootstrapDialog.SIZE_EXTRAWIDE){this.getModalDialog().addClass("modal-xl")}$.each(this.options.buttons,function(index,button){var $button=dialog.getButton(button.id);var buttonSizes=["btn-lg","btn-sm","btn-xs"];var sizeClassSpecified=false;if(typeof button["cssClass"]==="string"){var btnClasses=button["cssClass"].split(" ");$.each(btnClasses,function(index,btnClass){if($.inArray(btnClass,buttonSizes)!==-1){sizeClassSpecified=true}})}if(!sizeClassSpecified){$button.removeClass(buttonSizes.join(" "));$button.addClass(dialog.getButtonSize())}})}return this},getCssClass:function(){return this.options.cssClass},setCssClass:function(cssClass){this.options.cssClass=cssClass;return this},getTitle:function(){return this.options.title},setTitle:function(title){this.options.title=title;this.updateTitle();return this},updateTitle:function(){if(this.isRealized()){var title=this.getTitle()!==null?this.createDynamicContent(this.getTitle()):this.getDefaultText();this.getModalHeader().find("."+this.getNamespace("title")).html("").append(title).prop("id",this.getId()+"_title")}return this},getMessage:function(){return this.options.message},setMessage:function(message){this.options.message=message;this.updateMessage();return this},updateMessage:function(){if(this.isRealized()){var message=this.createDynamicContent(this.getMessage());this.getModalBody().find("."+this.getNamespace("message")).html("").append(message)}return this},isClosable:function(){return this.options.closable},setClosable:function(closable){this.options.closable=closable;this.updateClosable();return this},setCloseByBackdrop:function(closeByBackdrop){this.options.closeByBackdrop=closeByBackdrop;return this},canCloseByBackdrop:function(){return this.options.closeByBackdrop},setCloseByKeyboard:function(closeByKeyboard){this.options.closeByKeyboard=closeByKeyboard;return this},canCloseByKeyboard:function(){return this.options.closeByKeyboard},isAnimate:function(){return this.options.animate},setAnimate:function(animate){this.options.animate=animate;return this},updateAnimate:function(){if(this.isRealized()){this.getModal().toggleClass("fade",this.isAnimate())}return this},getSpinicon:function(){return this.options.spinicon},setSpinicon:function(spinicon){this.options.spinicon=spinicon;return this},addButton:function(button){this.options.buttons.push(button);return this},addButtons:function(buttons){var that=this;$.each(buttons,function(index,button){that.addButton(button)});return this},getButtons:function(){return this.options.buttons},setButtons:function(buttons){this.options.buttons=buttons;this.updateButtons();return this},getButton:function(id){if(typeof this.indexedButtons[id]!=="undefined"){return this.indexedButtons[id]}return null},getButtonSize:function(){if(typeof BootstrapDialog.BUTTON_SIZES[this.getSize()]!=="undefined"){return BootstrapDialog.BUTTON_SIZES[this.getSize()]}return""},updateButtons:function(){if(this.isRealized()){if(this.getButtons().length===0){this.getModalFooter().hide()}else{this.getModalFooter().show().closest(".modal-footer").append(this.createFooterButtons())}}return this},isAutodestroy:function(){return this.options.autodestroy},setAutodestroy:function(autodestroy){this.options.autodestroy=autodestroy},getDescription:function(){return this.options.description},setDescription:function(description){this.options.description=description;return this},getVerticalCentered:function(){return this.options.verticalCentered},setVerticalCentered:function(verticalcentered){this.options.verticalCentered=verticalCentered;return this},setTabindex:function(tabindex){this.options.tabindex=tabindex;return this},getTabindex:function(){return this.options.tabindex},updateTabindex:function(){if(this.isRealized()){this.getModal().attr("tabindex",this.getTabindex())}return this},getDefaultText:function(){return BootstrapDialog.DEFAULT_TEXTS[this.getType()]},getNamespace:function(name){return BootstrapDialog.NAMESPACE+"-"+name},createHeaderContent:function(){var $container=$("
");$container.addClass(this.getNamespace("header"));$container.append(this.createTitleContent());$container.append(this.createCloseButton());return $container},createTitleContent:function(){var $title=$("
");$title.addClass(this.getNamespace("title"));return $title},createCloseButton:function(){var $container=$("
");$container.addClass(this.getNamespace("close-button"));var $icon=$('');$icon.append(this.options.closeIcon);$container.append($icon);$container.on("click",{dialog:this},function(event){event.data.dialog.close()});return $container},createBodyContent:function(){var $container=$("
");$container.addClass(this.getNamespace("body"));$container.append(this.createMessageContent());return $container},createMessageContent:function(){var $message=$("
");$message.addClass(this.getNamespace("message"));return $message},createFooterContent:function(){var $container=$("
");$container.addClass(this.getNamespace("footer"));return $container},createFooterButtons:function(){var that=this;var $container=that.$modalFooter;this.indexedButtons={};$.each(this.options.buttons,function(index,button){if(!button.id){button.id=BootstrapDialog.newGuid()}var $button=that.createButton(button);that.indexedButtons[button.id]=$button;$container.append($button)});return $container},createButton:function(button){var $button=$('');$button.prop("id",button.id);$button.data("button",button);if(typeof button.icon!=="undefined"&&$.trim(button.icon)!==""){$button.append(this.createButtonIcon(button.icon))}if(typeof button.label!=="undefined"){$button.append(button.label)}if(typeof button.title!=="undefined"){$button.attr("title",button.title)}if(typeof button.cssClass!=="undefined"&&$.trim(button.cssClass)!==""){$button.addClass(button.cssClass)}else{$button.addClass("btn-secondary")}if(typeof button.data==="object"&&button.data.constructor==={}.constructor){$.each(button.data,function(key,value){$button.attr("data-"+key,value)})}if(typeof button.hotkey!=="undefined"){this.registeredButtonHotkeys[button.hotkey]=$button}$button.on("click",{dialog:this,$button:$button,button:button},function(event){var dialog=event.data.dialog;var $button=event.data.$button;var button=$button.data("button");if(button.autospin){$button.toggleSpin(true)}if(typeof button.action==="function"){return button.action.call($button,dialog,event)}});this.enhanceButton($button);if(typeof button.enabled!=="undefined"){$button.toggleEnable(button.enabled)}$button.addClass("bootstrap4-dialog-button");return $button},enhanceButton:function($button){$button.dialog=this;$button.toggleEnable=function(enable){var $this=this;if(typeof enable!=="undefined"){$this.prop("disabled",!enable).toggleClass("disabled",!enable)}else{$this.prop("disabled",!$this.prop("disabled"))}return $this};$button.enable=function(){var $this=this;$this.toggleEnable(true);return $this};$button.disable=function(){var $this=this;$this.toggleEnable(false);return $this};$button.toggleSpin=function(spin){var $this=this;var dialog=$this.dialog;var $icon=$this.find("."+dialog.getNamespace("button-icon"));if(typeof spin==="undefined"){spin=!($button.find(".icon-spin").length>0)}if(spin){$icon.hide();$button.prepend(dialog.createButtonIcon(dialog.getSpinicon()).addClass("icon-spin"))}else{$icon.show();$button.find(".icon-spin").remove()}return $this};$button.spin=function(){var $this=this;$this.toggleSpin(true);return $this};$button.stopSpin=function(){var $this=this;$this.toggleSpin(false);return $this};return this},createButtonIcon:function(icon){var $icon=$("");$icon.addClass(this.getNamespace("button-icon")).addClass(icon);return $icon},enableButtons:function(enable){$.each(this.indexedButtons,function(id,$button){$button.toggleEnable(enable)});return this},updateClosable:function(){if(this.isRealized()){this.getModalHeader().find("."+this.getNamespace("close-button")).toggle(this.isClosable())}return this},onShow:function(onshow){this.options.onshow=onshow;return this},onShown:function(onshown){this.options.onshown=onshown;return this},onHide:function(onhide){this.options.onhide=onhide;return this},onHidden:function(onhidden){this.options.onhidden=onhidden;return this},isRealized:function(){return this.realized},setRealized:function(realized){this.realized=realized;return this},isOpened:function(){return this.opened},setOpened:function(opened){this.opened=opened;return this},handleModalEvents:function(){this.getModal().on("show.bs.modal",{dialog:this},function(event){var dialog=event.data.dialog;dialog.setOpened(true);if(dialog.isModalEvent(event)&&typeof dialog.options.onshow==="function"){var openIt=dialog.options.onshow(dialog);if(openIt===false){dialog.setOpened(false)}return openIt}});this.getModal().on("shown.bs.modal",{dialog:this},function(event){var dialog=event.data.dialog;dialog.isModalEvent(event)&&typeof dialog.options.onshown==="function"&&dialog.options.onshown(dialog)});this.getModal().on("hide.bs.modal",{dialog:this},function(event){var dialog=event.data.dialog;dialog.setOpened(false);if(dialog.isModalEvent(event)&&typeof dialog.options.onhide==="function"){var hideIt=dialog.options.onhide(dialog);if(hideIt===false){dialog.setOpened(true)}return hideIt}});this.getModal().on("hidden.bs.modal",{dialog:this},function(event){var dialog=event.data.dialog;dialog.isModalEvent(event)&&typeof dialog.options.onhidden==="function"&&dialog.options.onhidden(dialog);if(dialog.isAutodestroy()){dialog.setRealized(false);delete BootstrapDialog.dialogs[dialog.getId()];$(this).remove()}BootstrapDialog.moveFocus();if($(".modal").hasClass("in")||$(".modal").hasClass("show")){$("body").addClass("modal-open")}});this.getModal().on("keyup",{dialog:this},function(event){event.which===27&&event.data.dialog.isClosable()&&event.data.dialog.canCloseByKeyboard()&&event.data.dialog.close()});this.getModal().on("keyup",{dialog:this},function(event){var dialog=event.data.dialog;if(typeof dialog.registeredButtonHotkeys[event.which]!=="undefined"){var $button=$(dialog.registeredButtonHotkeys[event.which]);!$button.prop("disabled")&&!$button.is(":focus")&&$button.focus().trigger("click")}});return this},isModalEvent:function(event){return typeof event.namespace!=="undefined"&&event.namespace==="bs.modal"},makeModalDraggable:function(){if(this.options.draggable){this.getModalHeader().addClass(this.getNamespace("draggable")).on("mousedown",{dialog:this},function(event){event.preventDefault();var dialog=event.data.dialog;dialog.draggableData.isMouseDown=true;var dialogOffset=dialog.getModalDialog().offset();dialog.draggableData.mouseOffset={top:event.clientY-dialogOffset.top,left:event.clientX-dialogOffset.left}});this.getModal().on("mouseup",{dialog:this},function(event){event.data.dialog.draggableData.isMouseDown=false});$("body").on("mousemove",{dialog:this},function(event){var dialog=event.data.dialog;if(!dialog.draggableData.isMouseDown){return}dialog.getModalDialog().offset({top:event.clientY-dialog.draggableData.mouseOffset.top,left:event.clientX-dialog.draggableData.mouseOffset.left})}).on("mouseleave",{dialog:this},function(event){event.data.dialog.draggableData.isMouseDown=false})}return this},realize:function(){this.initModalStuff();this.getModal().addClass(BootstrapDialog.NAMESPACE).addClass(this.getCssClass());this.updateSize();if(this.getDescription()){this.getModal().attr("aria-describedby",this.getDescription())}if(this.getVerticalCentered()){this.getModalDialog().addClass("modal-dialog-centered")}this.getModalHeader().append(this.createHeaderContent());this.getModalBody().append(this.createBodyContent());this.getModal().data("bs.modal",new BootstrapDialogModal(this.getModalForBootstrapDialogModal(),{backdrop:this.isClosable()&&this.canCloseByBackdrop()?true:"static",keyboard:false,show:false}));this.makeModalDraggable();this.handleModalEvents();this.setRealized(true);this.updateButtons();this.updateType();this.updateTitle();this.updateMessage();this.updateClosable();this.updateAnimate();this.updateSize();this.updateTabindex();return this},open:function(){!this.isRealized()&&this.realize();this.getModal().modal("show");return this},close:function(){!this.isRealized()&&this.realize();this.getModal().modal("hide");return this}};BootstrapDialog.prototype=$.extend(BootstrapDialog.prototype,BootstrapDialog.METHODS_TO_OVERRIDE[BootstrapDialogModal.getModalVersion()]);BootstrapDialog.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c==="x"?r:r&3|8;return v.toString(16)})};BootstrapDialog.show=function(options){return new BootstrapDialog(options).open()};BootstrapDialog.alert=function(){var alertOptions={};var defaultAlertOptions={type:BootstrapDialog.TYPE_PRIMARY,title:null,message:null,closable:false,draggable:false,buttonLabel:BootstrapDialog.DEFAULT_TEXTS.OK,buttonHotkey:null,callback:null};if(typeof arguments[0]==="object"&&arguments[0].constructor==={}.constructor){alertOptions=$.extend(true,defaultAlertOptions,arguments[0])}else{alertOptions=$.extend(true,defaultAlertOptions,{message:arguments[0],callback:typeof arguments[1]!=="undefined"?arguments[1]:null})}var dialog=new BootstrapDialog(alertOptions);dialog.setData("callback",alertOptions.callback);dialog.addButton({label:alertOptions.buttonLabel,hotkey:alertOptions.buttonHotkey,action:function(dialog){if(typeof dialog.getData("callback")==="function"&&dialog.getData("callback").call(this,true)===false){return false}dialog.setData("btnClicked",true);return dialog.close()}});if(typeof dialog.options.onhide==="function"){dialog.onHide(function(dialog){var hideIt=true;if(!dialog.getData("btnClicked")&&dialog.isClosable()&&typeof dialog.getData("callback")==="function"){hideIt=dialog.getData("callback")(false)}if(hideIt===false){return false}hideIt=this.onhide(dialog);return hideIt}.bind({onhide:dialog.options.onhide}))}else{dialog.onHide(function(dialog){var hideIt=true;if(!dialog.getData("btnClicked")&&dialog.isClosable()&&typeof dialog.getData("callback")==="function"){hideIt=dialog.getData("callback")(false)}return hideIt})}return dialog.open()};BootstrapDialog.confirm=function(){var confirmOptions={};var defaultConfirmOptions={type:BootstrapDialog.TYPE_PRIMARY,title:null,message:null,closable:false,draggable:false,btnCancelLabel:BootstrapDialog.DEFAULT_TEXTS.CANCEL,btnCancelClass:null,btnCancelHotkey:null,btnOKLabel:BootstrapDialog.DEFAULT_TEXTS.OK,btnOKClass:null,btnOKHotkey:null,btnsOrder:BootstrapDialog.defaultOptions.btnsOrder,callback:null};if(typeof arguments[0]==="object"&&arguments[0].constructor==={}.constructor){confirmOptions=$.extend(true,defaultConfirmOptions,arguments[0])}else{confirmOptions=$.extend(true,defaultConfirmOptions,{message:arguments[0],callback:typeof arguments[1]!=="undefined"?arguments[1]:null})}if(confirmOptions.btnOKClass===null){confirmOptions.btnOKClass=["btn",confirmOptions.type.split("-")[1]].join("-")}var dialog=new BootstrapDialog(confirmOptions);dialog.setData("callback",confirmOptions.callback);var buttons=[{label:confirmOptions.btnCancelLabel,cssClass:confirmOptions.btnCancelClass,hotkey:confirmOptions.btnCancelHotkey,action:function(dialog){if(typeof dialog.getData("callback")==="function"&&dialog.getData("callback").call(this,false)===false){return false}return dialog.close()}},{label:confirmOptions.btnOKLabel,cssClass:confirmOptions.btnOKClass,hotkey:confirmOptions.btnOKHotkey,action:function(dialog){if(typeof dialog.getData("callback")==="function"&&dialog.getData("callback").call(this,true)===false){return false}return dialog.close()}}];if(confirmOptions.btnsOrder===BootstrapDialog.BUTTONS_ORDER_OK_CANCEL){buttons.reverse()}dialog.addButtons(buttons);return dialog.open()};BootstrapDialog.warning=function(message,callback){return new BootstrapDialog({type:BootstrapDialog.TYPE_WARNING,message:message}).open()};BootstrapDialog.danger=function(message,callback){return new BootstrapDialog({type:BootstrapDialog.TYPE_DANGER,message:message}).open()};BootstrapDialog.success=function(message,callback){return new BootstrapDialog({type:BootstrapDialog.TYPE_SUCCESS,message:message}).open()};return BootstrapDialog}); \ No newline at end of file diff --git a/update.json b/update.json index 1af18ef..8e69bd7 100644 --- a/update.json +++ b/update.json @@ -3,7 +3,7 @@ "name": "bootstrap4-dialog", "repo": "GedMarc/bootstrap4-dialog", "files": { - "include": ["dist/css/bootstrap-dialog.css", "dist/js/bootstrap-dialog.js", "dist/css/bootstrap-dialog.min.css", "dist/js/bootstrap-dialog.min.js"] + "include": ["dist/css/bootstrap-dialog.css", "dist/js/bootstrap-dialog.js", "dist/css/bootstrap-dialog.min.css", "dist/css/bootstrap-dialog.min.css.map", "dist/js/bootstrap-dialog.min.js"] }, "branch": "bootstrap4-dev" } \ No newline at end of file