From 90e17767c06ddc68ca0b77444662612136ee0789 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 19 Sep 2019 00:14:30 +0100 Subject: [PATCH] Added: BSDialog 27 minified --- 2019/09/bsdialog-v0.1.0.027.min.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 2019/09/bsdialog-v0.1.0.027.min.js diff --git a/2019/09/bsdialog-v0.1.0.027.min.js b/2019/09/bsdialog-v0.1.0.027.min.js new file mode 100644 index 0000000..f3df81b --- /dev/null +++ b/2019/09/bsdialog-v0.1.0.027.min.js @@ -0,0 +1,5 @@ +/** + * BSDialog + * @version v0.1.0.027 (2019/09/19 0002) + */ +var BSDialog={Create:function(o,t,d,e,a){var s=this;s.id=o,s.title=t,s.url=d,s.isBig=void 0!==e&&1==e;var l=void 0===a||1==a;s.Exists(o)||s.renderContent(null),null!=d&&$.ajax({url:d,cache:!1,timeout:6e4,success:function(t,d,e){200==e.status||302==e.status||301==e.status?l?s.updateContentBody(o,t):$("#dlg"+o).find(".modal-content").html(t):s.updateContentBody(o,e.statusText+" ("+e.status+")")},error:function(t){s.updateContentBody(o,t.statusText+" ("+t.status+")")},complete:function(o,t){}}),s.initialiseComponents()},Close:function(o){$("#dlg"+o).modal("hide")},Clear:function(){$("body > div[class~='modal'][role='dialog']").remove(),$("body > div[class~='modal-backdrop']").remove(),$("body").removeClass("modal-open")},ShowToast:function(o,t,d,e){var a=this;a.Exists(o)||(a.id=o,a.title=t,a.url=null,a.isBig=void 0!==e&&1==e,a.renderContent(d),a.initialiseComponents())},Exists:function(o){return $("body > div[id='dlg"+o+"']").length>0},generateModalHtml:function(o){var t=this,d=void 0===t.isBig?"md":1==t.isBig?"lg":"md",e="";return e+='"},renderContent:function(o){$("body").append(this.generateModalHtml(o))},initialiseComponents:function(){var o=this,t=o.getElement(),d=$(t).find("button[data-modal-action='restore']");$(d).length>0&&($(d).off("click"),$(d).on("click",function(){o.toggleSize()})),$(t).modal("show"),$(t).off("hide.bs.modal"),$(t).on("hide.bs.modal",function(){$(t).next().is("div[class~='modal-backdrop']")&&$(t).next().remove(),$(t).remove()}),$(t).find(".modal-header").off("mousedown"),$(t).find(".modal-header").on("mousedown",function(o){var d=o.pageX-$(this).offset().left,e=o.pageY-$(this).offset().top;$("body").off("mousemove.draggable"),$("body").on("mousemove.draggable",function(o){$(t).children(".modal-dialog").offset({left:o.pageX-d,top:o.pageY-e})}),$("body").off("mouseup"),$("body").on("mouseup",function(){$("body").off("mousemove.draggable")}),$(t).off("bs.modal.hide"),$(t).on("bs.modal.hide",function(){$("body").off("mousemove.draggable")})})},updateContentBody:function(o,t){var d=$("#dlg"+o).find(".modal-body");$(d).hasClass("custom-loading")&&$(d).removeClass("custom-loading"),$(d).html(t)},getElement:function(){return $("#dlg"+this.id)},toggleSize:function(){var o=$(this.getElement()).find("div[class^='modal-dialog']");$(o).length<=0||($(o).hasClass("modal-md")?($(o).removeClass("modal-md"),$(o).addClass("modal-lg")):$(o).hasClass("modal-lg")&&($(o).removeClass("modal-lg"),$(o).addClass("modal-md")))}}; \ No newline at end of file