From 9e59f3ed65803f6af1b729e5987b25778933d562 Mon Sep 17 00:00:00 2001 From: Thomas Jang Date: Fri, 10 Feb 2017 17:17:55 +0900 Subject: [PATCH] 1.3.89 RELEASED --- bower.json | 2 +- dist/ax5modal.js | 2 +- dist/ax5modal.min.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bower.json b/bower.json index b4014b5..80a8c25 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ax5ui-modal", - "version": "1.3.88", + "version": "1.3.89", "authors": [ "ThomasJ " ], diff --git a/dist/ax5modal.js b/dist/ax5modal.js index da3465a..82e4381 100755 --- a/dist/ax5modal.js +++ b/dist/ax5modal.js @@ -9,7 +9,7 @@ UI.addClass({ className: "modal", - version: "1.3.88" + version: "1.3.89" }, function () { /** * @class ax5modal diff --git a/dist/ax5modal.min.js b/dist/ax5modal.min.js index 392d94d..83f5a0e 100755 --- a/dist/ax5modal.min.js +++ b/dist/ax5modal.min.js @@ -1 +1 @@ -"use strict";!function(){var t,i=ax5.ui,e=ax5.util;i.addClass({className:"modal",version:"1.3.88"},function(){var a=function(){var a=this,o=void 0,n={mousedown:ax5.info.supportTouch?"touchstart":"mousedown",mousemove:ax5.info.supportTouch?"touchmove":"mousemove",mouseup:ax5.info.supportTouch?"touchend":"mouseup"},d=function(t){var i=t;return"changedTouches"in t&&(i=t.changedTouches[0]),{clientX:i.clientX,clientY:i.clientY}};this.instanceId=ax5.getGuid(),this.config={id:"ax5-modal-"+this.instanceId,position:{left:"center",top:"middle",margin:10},minimizePosition:"bottom-right",clickEventName:"click",theme:"default",width:300,height:400,closeToEsc:!0,disableDrag:!1,animateTime:250},this.activeModal=null,this.watingModal=!1,this.$={},o=this.config;var s=function(t,i){return t&&t.onStateChanged?t.onStateChanged.call(i,i):this.onStateChanged&&this.onStateChanged.call(i,i),!0},l=function(i,e){var a={modalId:i,theme:e.theme,header:e.header,fullScreen:e.fullScreen?"fullscreen":"",styles:"",iframe:e.iframe,iframeLoadingMsg:e.iframeLoadingMsg};return e.zIndex&&(a.styles+="z-index:"+e.zIndex+";"),e.absolute&&(a.styles+="position:absolute;"),a.iframe&&"string"==typeof a.iframe.param&&(a.iframe.param=ax5.util.param(a.iframe.param)),t.tmpl.get.call(this,"content",a,{})},h=function(t,i){var h=void 0;jQuery(document.body).append(l.call(this,t.id,t)),this.activeModal=jQuery("#"+t.id),this.$={root:this.activeModal,header:this.activeModal.find('[data-modal-els="header"]'),body:this.activeModal.find('[data-modal-els="body"]')},t.iframe&&(this.$["iframe-wrap"]=this.activeModal.find('[data-modal-els="iframe-wrap"]'),this.$.iframe=this.activeModal.find('[data-modal-els="iframe"]'),this.$["iframe-form"]=this.activeModal.find('[data-modal-els="iframe-form"]'),this.$["iframe-loading"]=this.activeModal.find('[data-modal-els="iframe-loading"]')),this.align(),h={self:this,id:t.id,theme:t.theme,width:t.width,height:t.height,state:"open",$:this.$},t.iframe&&(this.$["iframe-wrap"].css({height:t.height}),this.$.iframe.css({height:t.height}),this.$["iframe-form"].attr({method:t.iframe.method}),this.$["iframe-form"].attr({target:t.id+"-frame"}),this.$["iframe-form"].attr({action:t.iframe.url}),this.$.iframe.on("load",function(){h.state="load",t.iframeLoadingMsg&&this.$["iframe-loading"].hide(),s.call(this,t,h)}.bind(this)),t.iframeLoadingMsg||this.$.iframe.show(),this.$["iframe-form"].submit()),i&&i.call(h),this.watingModal||s.call(this,t,h),t.closeToEsc&&jQuery(window).bind("keydown.ax-modal",function(t){m.call(this,t||window.event)}.bind(this)),jQuery(window).bind("resize.ax-modal",function(t){this.align(null,t||window.event)}.bind(this)),this.activeModal.find("[data-modal-header-btn]").on(o.clickEventName,function(i){r.call(this,i||window.event,t)}.bind(this)),this.$.header.bind(n.mousedown,function(i){if(t.isFullScreen)return!1;var o=e.findParentNode(i.target,function(t){if(t.getAttribute("data-modal-header-btn"))return!0});o||1==t.disableDrag||(a.mousePosition=d(i),f.on.call(a))}).bind("dragstart",function(t){return e.stopEvent(t),!1})},r=function(t,i,a,o,n){var d=void 0;t.srcElement&&(t.target=t.srcElement),o=e.findParentNode(t.target,function(t){if(t.getAttribute("data-modal-header-btn"))return!0}),o&&(n=o.getAttribute("data-modal-header-btn"),d={self:this,key:n,value:i.header.btns[n],dialogId:i.id,btnTarget:o},i.header.btns[n].onClick&&i.header.btns[n].onClick.call(d,n)),d=null,i=null,a=null,o=null,n=null},m=function(t){t.keyCode==ax5.info.eventKeys.ESC&&this.close()},c={"top-left":function(){this.align({left:"left",top:"top"})},"top-right":function(){this.align({left:"right",top:"top"})},"bottom-left":function(){this.align({left:"left",top:"bottom"})},"bottom-right":function(){this.align({left:"right",top:"bottom"})},"center-middle":function(){this.align({left:"center",top:"middle"})}},f={on:function(){var t=this.activeModal.css("z-index"),i=this.activeModal.position(),e={width:this.activeModal.outerWidth(),height:this.activeModal.outerHeight()},d={width:jQuery(window).width(),height:jQuery(window).height()},s=function(t){a.__dx=t.clientX-a.mousePosition.clientX,a.__dy=t.clientY-a.mousePosition.clientY;var o=0,n=d.width-e.width,s=0,l=d.height-e.height;return o>i.left+a.__dx?a.__dx=-i.left:ni.top+a.__dy?a.__dy=-i.top:l'),a.resizer=jQuery('
'),a.resizerBg.css({zIndex:t}),a.resizer.css({left:i.left,top:i.top,width:e.width,height:e.height,zIndex:t+1}),jQuery(document.body).append(a.resizerBg).append(a.resizer),a.activeModal.addClass("draged")),jQuery(document.body).bind(n.mousemove+".ax5modal-"+o.id,function(t){a.resizer.css(s(t))}).bind(n.mouseup+".ax5layout-"+this.instanceId,function(t){f.off.call(a)}).bind("mouseleave.ax5layout-"+this.instanceId,function(t){f.off.call(a)}),jQuery(document.body).attr("unselectable","on").css("user-select","none").on("selectstart",!1)},off:function(){var t=function(){var t=this.activeModal.offset();t.left+=this.__dx-$(document).scrollLeft(),t.top+=this.__dy-$(document).scrollTop(),this.activeModal.css(t)};this.resizer&&(this.activeModal.removeClass("draged"),this.resizer.remove(),this.resizer=null,this.resizerBg.remove(),this.resizerBg=null,t.call(this)),jQuery(document.body).unbind(n.mousemove+".ax5modal-"+o.id).unbind(n.mouseup+".ax5modal-"+o.id).unbind("mouseleave.ax5modal-"+o.id),jQuery(document.body).removeAttr("unselectable").css("user-select","auto").off("selectstart")}};this.init=function(){this.onStateChanged=o.onStateChanged},this.open=function(t,i,e){return"undefined"==typeof e&&(e=0),this.activeModal?e<3&&(this.watingModal=!0,setTimeout(function(){this.open(t,i,e+1)}.bind(this),o.animateTime)):(t=a.modalConfig=jQuery.extend(!0,{},o,t),h.call(this,t,i),this.watingModal=!1),this},this.close=function(t){return this.activeModal&&(t=a.modalConfig,this.activeModal.addClass("destroy"),jQuery(window).unbind("keydown.ax-modal"),jQuery(window).unbind("resize.ax-modal"),setTimeout(function(){if(this.activeModal){if(t.iframe){var i=this.$.iframe;if(i){var e=i.get(0),a=e.contentDocument?e.contentDocument:e.contentWindow.document;try{$(a.body).children().each(function(){$(this).remove()})}catch(o){}a.innerHTML="",i.attr("src","about:blank").remove(),window.CollectGarbage&&window.CollectGarbage()}}this.activeModal.remove(),this.activeModal=null}this.watingModal||s.call(this,t,{self:this,state:"close"})}.bind(this),o.animateTime)),this.minimized=!1,this},this.minimize=function(){return function(t){if(this.minimized!==!0){var i=a.modalConfig;"undefined"==typeof t&&(t=o.minimizePosition),this.minimized=!0,this.$.body.hide(),a.modalConfig.originalHeight=i.height,a.modalConfig.height=0,c[t].call(this),s.call(this,i,{self:this,state:"minimize"})}return this}}(),this.maximize=function(){var t=a.modalConfig;return this.minimized&&(this.minimized=!1,this.$.body.show(),a.modalConfig.height=a.modalConfig.originalHeight,a.modalConfig.originalHeight=void 0,this.align({left:"center",top:"middle"}),s.call(this,t,{self:this,state:"restore"})),this},this.css=function(t){return this.activeModal&&!a.fullScreen&&(this.activeModal.css(t),t.width&&(a.modalConfig.width=this.activeModal.width()),t.height&&(a.modalConfig.height=this.activeModal.height(),this.$.iframe&&(this.$["iframe-wrap"].css({height:a.modalConfig.height}),this.$.iframe.css({height:a.modalConfig.height})))),this},this.setModalConfig=function(t){return a.modalConfig=jQuery.extend({},a.modalConfig,t),this.align(),this},this.align=function(){return function(t,i){if(!this.activeModal)return this;var o=a.modalConfig,n={width:o.width,height:o.height},d=o.isFullScreen=function(t){return"undefined"!=typeof t&&(e.isFunction(t)?t():void 0)}(o.fullScreen);return d?(o.header&&this.$.header.show(),n.width=jQuery(window).width(),n.height=o.height,n.left=0,n.top=0):(o.header&&this.$.header.show(),t&&jQuery.extend(!0,o.position,t),o.header?(o.headerHeight=this.$.header.outerHeight(),n.height+=o.headerHeight):o.headerHeight=0,"left"==o.position.left?n.left=o.position.margin||0:"right"==o.position.left?n.left=jQuery(window).width()-n.width-(o.position.margin||0):"center"==o.position.left?n.left=jQuery(window).width()/2-n.width/2:n.left=o.position.left||0,"top"==o.position.top?n.top=o.position.margin||0:"bottom"==o.position.top?n.top=jQuery(window).height()-n.height-(o.position.margin||0):"middle"==o.position.top?n.top=jQuery(window).height()/2-n.height/2:n.top=o.position.top||0,n.left<0&&(n.left=0),n.top<0&&(n.top=0)),this.activeModal.css(n),o.iframe&&(this.$["iframe-wrap"].css({height:n.height-o.headerHeight}),this.$.iframe.css({height:n.height-o.headerHeight})),this}}(),this.main=function(){i.modal_instance=i.modal_instance||[],i.modal_instance.push(this),arguments&&e.isObject(arguments[0])&&this.setConfig(arguments[0])}.apply(this,arguments)};return a}()),t=ax5.ui.modal}(),function(){var t=ax5.ui.modal,i=function(){return' \n
\n {{#header}}\n
\n {{{title}}}\n {{#btns}}\n
\n {{#@each}}\n \n {{/@each}}\n
\n {{/btns}}\n
\n {{/header}}\n
\n {{#iframe}}\n \n
\n
{{{iframeLoadingMsg}}}
\n \n
\n
\n \n {{#param}}\n {{#@each}}\n \n {{/@each}}\n {{/param}}\n
\n {{/iframe}}\n
\n
\n
\n '};t.tmpl={content:i,get:function(i,e,a){return ax5.mustache.render(t.tmpl[i].call(this,a),e)}}}(); \ No newline at end of file +"use strict";!function(){var t,i=ax5.ui,e=ax5.util;i.addClass({className:"modal",version:"1.3.89"},function(){var a=function(){var a=this,o=void 0,n={mousedown:ax5.info.supportTouch?"touchstart":"mousedown",mousemove:ax5.info.supportTouch?"touchmove":"mousemove",mouseup:ax5.info.supportTouch?"touchend":"mouseup"},d=function(t){var i=t;return"changedTouches"in t&&(i=t.changedTouches[0]),{clientX:i.clientX,clientY:i.clientY}};this.instanceId=ax5.getGuid(),this.config={id:"ax5-modal-"+this.instanceId,position:{left:"center",top:"middle",margin:10},minimizePosition:"bottom-right",clickEventName:"click",theme:"default",width:300,height:400,closeToEsc:!0,disableDrag:!1,animateTime:250},this.activeModal=null,this.watingModal=!1,this.$={},o=this.config;var s=function(t,i){return t&&t.onStateChanged?t.onStateChanged.call(i,i):this.onStateChanged&&this.onStateChanged.call(i,i),!0},l=function(i,e){var a={modalId:i,theme:e.theme,header:e.header,fullScreen:e.fullScreen?"fullscreen":"",styles:"",iframe:e.iframe,iframeLoadingMsg:e.iframeLoadingMsg};return e.zIndex&&(a.styles+="z-index:"+e.zIndex+";"),e.absolute&&(a.styles+="position:absolute;"),a.iframe&&"string"==typeof a.iframe.param&&(a.iframe.param=ax5.util.param(a.iframe.param)),t.tmpl.get.call(this,"content",a,{})},h=function(t,i){var h=void 0;jQuery(document.body).append(l.call(this,t.id,t)),this.activeModal=jQuery("#"+t.id),this.$={root:this.activeModal,header:this.activeModal.find('[data-modal-els="header"]'),body:this.activeModal.find('[data-modal-els="body"]')},t.iframe&&(this.$["iframe-wrap"]=this.activeModal.find('[data-modal-els="iframe-wrap"]'),this.$.iframe=this.activeModal.find('[data-modal-els="iframe"]'),this.$["iframe-form"]=this.activeModal.find('[data-modal-els="iframe-form"]'),this.$["iframe-loading"]=this.activeModal.find('[data-modal-els="iframe-loading"]')),this.align(),h={self:this,id:t.id,theme:t.theme,width:t.width,height:t.height,state:"open",$:this.$},t.iframe&&(this.$["iframe-wrap"].css({height:t.height}),this.$.iframe.css({height:t.height}),this.$["iframe-form"].attr({method:t.iframe.method}),this.$["iframe-form"].attr({target:t.id+"-frame"}),this.$["iframe-form"].attr({action:t.iframe.url}),this.$.iframe.on("load",function(){h.state="load",t.iframeLoadingMsg&&this.$["iframe-loading"].hide(),s.call(this,t,h)}.bind(this)),t.iframeLoadingMsg||this.$.iframe.show(),this.$["iframe-form"].submit()),i&&i.call(h),this.watingModal||s.call(this,t,h),t.closeToEsc&&jQuery(window).bind("keydown.ax-modal",function(t){m.call(this,t||window.event)}.bind(this)),jQuery(window).bind("resize.ax-modal",function(t){this.align(null,t||window.event)}.bind(this)),this.activeModal.find("[data-modal-header-btn]").on(o.clickEventName,function(i){r.call(this,i||window.event,t)}.bind(this)),this.$.header.bind(n.mousedown,function(i){if(t.isFullScreen)return!1;var o=e.findParentNode(i.target,function(t){if(t.getAttribute("data-modal-header-btn"))return!0});o||1==t.disableDrag||(a.mousePosition=d(i),f.on.call(a))}).bind("dragstart",function(t){return e.stopEvent(t),!1})},r=function(t,i,a,o,n){var d=void 0;t.srcElement&&(t.target=t.srcElement),o=e.findParentNode(t.target,function(t){if(t.getAttribute("data-modal-header-btn"))return!0}),o&&(n=o.getAttribute("data-modal-header-btn"),d={self:this,key:n,value:i.header.btns[n],dialogId:i.id,btnTarget:o},i.header.btns[n].onClick&&i.header.btns[n].onClick.call(d,n)),d=null,i=null,a=null,o=null,n=null},m=function(t){t.keyCode==ax5.info.eventKeys.ESC&&this.close()},c={"top-left":function(){this.align({left:"left",top:"top"})},"top-right":function(){this.align({left:"right",top:"top"})},"bottom-left":function(){this.align({left:"left",top:"bottom"})},"bottom-right":function(){this.align({left:"right",top:"bottom"})},"center-middle":function(){this.align({left:"center",top:"middle"})}},f={on:function(){var t=this.activeModal.css("z-index"),i=this.activeModal.position(),e={width:this.activeModal.outerWidth(),height:this.activeModal.outerHeight()},d={width:jQuery(window).width(),height:jQuery(window).height()},s=function(t){a.__dx=t.clientX-a.mousePosition.clientX,a.__dy=t.clientY-a.mousePosition.clientY;var o=0,n=d.width-e.width,s=0,l=d.height-e.height;return o>i.left+a.__dx?a.__dx=-i.left:ni.top+a.__dy?a.__dy=-i.top:l'),a.resizer=jQuery('
'),a.resizerBg.css({zIndex:t}),a.resizer.css({left:i.left,top:i.top,width:e.width,height:e.height,zIndex:t+1}),jQuery(document.body).append(a.resizerBg).append(a.resizer),a.activeModal.addClass("draged")),jQuery(document.body).bind(n.mousemove+".ax5modal-"+o.id,function(t){a.resizer.css(s(t))}).bind(n.mouseup+".ax5layout-"+this.instanceId,function(t){f.off.call(a)}).bind("mouseleave.ax5layout-"+this.instanceId,function(t){f.off.call(a)}),jQuery(document.body).attr("unselectable","on").css("user-select","none").on("selectstart",!1)},off:function(){var t=function(){var t=this.activeModal.offset();t.left+=this.__dx-$(document).scrollLeft(),t.top+=this.__dy-$(document).scrollTop(),this.activeModal.css(t)};this.resizer&&(this.activeModal.removeClass("draged"),this.resizer.remove(),this.resizer=null,this.resizerBg.remove(),this.resizerBg=null,t.call(this)),jQuery(document.body).unbind(n.mousemove+".ax5modal-"+o.id).unbind(n.mouseup+".ax5modal-"+o.id).unbind("mouseleave.ax5modal-"+o.id),jQuery(document.body).removeAttr("unselectable").css("user-select","auto").off("selectstart")}};this.init=function(){this.onStateChanged=o.onStateChanged},this.open=function(t,i,e){return"undefined"==typeof e&&(e=0),this.activeModal?e<3&&(this.watingModal=!0,setTimeout(function(){this.open(t,i,e+1)}.bind(this),o.animateTime)):(t=a.modalConfig=jQuery.extend(!0,{},o,t),h.call(this,t,i),this.watingModal=!1),this},this.close=function(t){return this.activeModal&&(t=a.modalConfig,this.activeModal.addClass("destroy"),jQuery(window).unbind("keydown.ax-modal"),jQuery(window).unbind("resize.ax-modal"),setTimeout(function(){if(this.activeModal){if(t.iframe){var i=this.$.iframe;if(i){var e=i.get(0),a=e.contentDocument?e.contentDocument:e.contentWindow.document;try{$(a.body).children().each(function(){$(this).remove()})}catch(o){}a.innerHTML="",i.attr("src","about:blank").remove(),window.CollectGarbage&&window.CollectGarbage()}}this.activeModal.remove(),this.activeModal=null}this.watingModal||s.call(this,t,{self:this,state:"close"})}.bind(this),o.animateTime)),this.minimized=!1,this},this.minimize=function(){return function(t){if(this.minimized!==!0){var i=a.modalConfig;"undefined"==typeof t&&(t=o.minimizePosition),this.minimized=!0,this.$.body.hide(),a.modalConfig.originalHeight=i.height,a.modalConfig.height=0,c[t].call(this),s.call(this,i,{self:this,state:"minimize"})}return this}}(),this.maximize=function(){var t=a.modalConfig;return this.minimized&&(this.minimized=!1,this.$.body.show(),a.modalConfig.height=a.modalConfig.originalHeight,a.modalConfig.originalHeight=void 0,this.align({left:"center",top:"middle"}),s.call(this,t,{self:this,state:"restore"})),this},this.css=function(t){return this.activeModal&&!a.fullScreen&&(this.activeModal.css(t),t.width&&(a.modalConfig.width=this.activeModal.width()),t.height&&(a.modalConfig.height=this.activeModal.height(),this.$.iframe&&(this.$["iframe-wrap"].css({height:a.modalConfig.height}),this.$.iframe.css({height:a.modalConfig.height})))),this},this.setModalConfig=function(t){return a.modalConfig=jQuery.extend({},a.modalConfig,t),this.align(),this},this.align=function(){return function(t,i){if(!this.activeModal)return this;var o=a.modalConfig,n={width:o.width,height:o.height},d=o.isFullScreen=function(t){return"undefined"!=typeof t&&(e.isFunction(t)?t():void 0)}(o.fullScreen);return d?(o.header&&this.$.header.show(),n.width=jQuery(window).width(),n.height=o.height,n.left=0,n.top=0):(o.header&&this.$.header.show(),t&&jQuery.extend(!0,o.position,t),o.header?(o.headerHeight=this.$.header.outerHeight(),n.height+=o.headerHeight):o.headerHeight=0,"left"==o.position.left?n.left=o.position.margin||0:"right"==o.position.left?n.left=jQuery(window).width()-n.width-(o.position.margin||0):"center"==o.position.left?n.left=jQuery(window).width()/2-n.width/2:n.left=o.position.left||0,"top"==o.position.top?n.top=o.position.margin||0:"bottom"==o.position.top?n.top=jQuery(window).height()-n.height-(o.position.margin||0):"middle"==o.position.top?n.top=jQuery(window).height()/2-n.height/2:n.top=o.position.top||0,n.left<0&&(n.left=0),n.top<0&&(n.top=0)),this.activeModal.css(n),o.iframe&&(this.$["iframe-wrap"].css({height:n.height-o.headerHeight}),this.$.iframe.css({height:n.height-o.headerHeight})),this}}(),this.main=function(){i.modal_instance=i.modal_instance||[],i.modal_instance.push(this),arguments&&e.isObject(arguments[0])&&this.setConfig(arguments[0])}.apply(this,arguments)};return a}()),t=ax5.ui.modal}(),function(){var t=ax5.ui.modal,i=function(){return' \n
\n {{#header}}\n
\n {{{title}}}\n {{#btns}}\n
\n {{#@each}}\n \n {{/@each}}\n
\n {{/btns}}\n
\n {{/header}}\n
\n {{#iframe}}\n \n
\n
{{{iframeLoadingMsg}}}
\n \n
\n
\n \n {{#param}}\n {{#@each}}\n \n {{/@each}}\n {{/param}}\n
\n {{/iframe}}\n
\n
\n
\n '};t.tmpl={content:i,get:function(i,e,a){return ax5.mustache.render(t.tmpl[i].call(this,a),e)}}}(); \ No newline at end of file diff --git a/package.json b/package.json index d51c68a..b288e79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ax5ui-modal", - "version": "1.3.88", + "version": "1.3.89", "description": "A modal plugin that works with Bootstrap & jQuery", "license": "MIT", "repository": {