File manager - Edit - /home/familylifersmpc/htdocs/www.familylifersmpc.com/editor-js/iziModal/iziModal.min.js
Back
/* * iziModal | v1.0.1 * http://izimodal.dolce.ninja * by Marcelo Dolce. */ (function(t){"use strict";function e(){var t,e=document.createElement("fakeelement"),i={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(t in i)if(void 0!==e.style[t])return i[t]}var i="iziModal",n={CLOSING:"closing",CLOSED:"closed",OPENING:"opening",OPENED:"opened",DESTROYED:"destroyed"},s=e(),o=!1;/Mobi/.test(navigator.userAgent)&&(o=!0);var a=function(t,e){this.init(t,e)};a.prototype={constructor:a,init:function(e,s){var o=this;this.$element=t(e),this.id=this.$element.attr("id"),this.state=n.CLOSED,this.options=s,this.timer=null,this.headerHeight=0,this.$header=t('<div class="'+i+'-header"><h2 class="'+i+'-header-title">'+s.title+'</h2><p class="'+i+'-header-subtitle">'+s.subtitle+'</p><a href="javascript:void(0)" class="'+i+'-button-close" data-'+i+"-close></a></div>"),this.$overlay=t('<div class="'+i+'-overlay" style="background-color:'+s.overlayColor+'"></div>'),""===s.subtitle&&this.$header.addClass(i+"-noSubtitle"),s.iframe===!0?(this.$element.html('<div class="'+i+'-wrap"><div class="'+i+"-content "+i+'-content-loader"><iframe class="'+i+'-iframe"></iframe>'+this.$element.html()+"</div></div>"),null!==s.iframeHeight&&this.$element.find("."+i+"-iframe").css("height",s.iframeHeight)):this.$element.html('<div class="'+i+'-wrap"><div class="'+i+'-content">'+this.$element.html()+"</div></div>"),t(document.body).find("style[rel="+this.id+"]").remove(),"undefined"==typeof s.padding&&0===s.padding||this.$element.find("."+i+"-content").css("padding",s.padding),""===s.title&&""===s.subtitle||(null!==s.headerColor&&(this.$element.css("border-bottom","3px solid "+s.headerColor),this.$header.css("background",this.options.headerColor)),null!==s.iconClass&&(this.$header.prepend('<i class="'+i+"-header-icon "+s.iconClass+'"></i>'),this.$header.find("."+i+"-header-icon").css("color",s.iconColor)),this.$element.prepend(this.$header));var a=/%|px|em|cm/,l=String(s.width).split(a),r=String(s.width),h="px";l=String(l).split(",")[0],isNaN(s.width)&&(h=-1!=String(s.width).indexOf("%")?"%":r.slice("-2")),this.$element.css({"margin-left":-(l/2)+h,"max-width":parseInt(l)+h}),this.mediaQueries='<style rel="'+this.id+'">@media handheld, only screen and (max-width: '+l+"px) { #"+this.$element[0].id+"{ width: 100% !important; max-width: 100% !important; margin-left: 0 !important; left: 0 !important; } }</style>",t(document.body).append(this.mediaQueries),this.$element.addClass(i+" "+s.theme),this.$element.css("margin-top",parseInt(-(this.$element.innerHeight()/2))+"px"),this.$element.find("."+i+"-header").length&&this.$element.css("overflow","hidden"),this.$element.on("click","[data-"+i+"-close]",function(t){t.preventDefault(),o.close()})},toggle:function(){this.state==n.OPENED&&this.close(),this.state==n.CLOSED&&this.open()},open:function(e){function a(){l.$element.trigger(n.OPENED),l.state=n.OPENED,console.info("[ "+i+" | "+l.id+" ] Opened."),l.options.onOpened.call(this)}var l=this;if(e&&"function"==typeof e&&e(l),this.options.iframe===!0){var r=null;if(null!==this.options.iframeURL)r=this.options.iframeURL;else try{r=e.target.href,void 0!==r&&(r=e.target.href)}catch(h){console.warn(h)}this.$element.find("."+i+"-iframe").attr("src",r)}this.$element.trigger(n.OPENING),this.state=n.OPENING,console.info("[ "+i+" | "+this.id+" ] Opening..."),(this.options.bodyOverflow||o)&&t(document.body).css("overflow","hidden"),l.options.onOpening.call(this),this.$overlay.appendTo("body"),this.options.transitionInOverlay&&this.$overlay.addClass(this.options.transitionInOverlay),""!==this.options.transitionInModal?(this.$element.addClass(this.options.transitionInModal).show(),this.$element.find("."+i+"-wrap").one(s,function(){l.$element.removeClass(l.options.transitionInModal),l.$overlay.removeClass(l.options.transitionInOverlay),a()})):(this.$element.show(),a()),this.options.overlayClose&&!this.$element.hasClass(this.options.transitionOutModal)&&l.$overlay.click(function(){l.close()}),this.options.focusInput&&l.$element.find(":input:not(button):enabled:visible:first").focus(),function d(){l.recalculateLayout(),l.timer=setTimeout(d,500)}(),t(document).keydown(function(t){l.options.closeOnEscape&&27===t.keyCode&&l.close()})},close:function(e){function a(){l.options.iframe===!0&&l.$element.find("."+i+"-iframe").attr("src",""),(l.options.bodyOverflow||o)&&t(document.body).css("overflow","initial"),t(document.body).removeClass(i+"-attached"),l.$element.trigger(n.CLOSED),l.state=n.CLOSED,console.info("[ "+i+" | "+l.id+" ] Closed."),l.options.onClosed.call(this)}var l=this;e&&"function"==typeof e&&e(l),t(document).off("keydown"),this.state=n.CLOSING,this.$element.trigger(n.CLOSING),console.info("[ "+i+" | "+this.id+" ] Closing..."),clearTimeout(l.timer),l.options.onClosing.call(this),""!==this.options.transitionOutModal?(this.$element.attr("class",i+" "+this.options.theme+" "+this.options.transitionOutModal),this.$overlay.attr("class",i+"-overlay "+this.options.transitionOutOverlay),this.$element.one(s,function(){l.$element.hasClass(l.options.transitionOutModal)&&(l.$element.removeClass(l.options.transitionOutModal).hide(),l.$overlay.removeClass(l.options.transitionOutOverlay).remove(),a())})):(this.$element.hide(),this.$overlay.remove(),a())},destroy:function(){var e=t.Event("destroy");this.$element.trigger(e),t(document).off("keydown"),clearTimeout(this.timer),this.options.iframe===!0&&this.$element.find("."+i+"-iframe").remove(),this.$element.html(this.$element.find("."+i+"-content").html()),t(document.body).find("style[rel="+this.id+"]").remove(),this.$element.off("click","[data-"+i+"-close]"),this.$element.off("."+i).removeData(i).attr("style",""),this.$overlay.remove(),this.$element.trigger(n.DESTROYED),this.$element=null},getState:function(){return console.info(this.state),this.state},setTitle:function(t){null!==this.options.title&&(this.$header.find("."+i+"-header-title").html(t),this.options.title=t)},setSubtitle:function(t){null!==this.options.subtitle&&(this.$header.find("."+i+"-header-subtitle").html(t),this.options.subtitle=t)},setIconClass:function(t){null!==this.options.iconClass&&(this.$header.find("."+i+"-header-icon").attr("class",i+"-header-icon "+t),this.options.iconClass=t)},setHeaderColor:function(t){null!==this.options.headerColor&&(this.$element.css("border-bottom","3px solid "+t),this.$header.css("background",t),this.options.headerColor=t)},startLoading:function(){this.$element.find("."+i+"-loader").length||this.$element.append('<div class="'+i+"-loader "+this.options.transitionInOverlay+'"></div>')},stopLoading:function(){var t=this;this.$element.find("."+i+"-loader").removeClass(this.options.transitionInOverlay).addClass(this.options.transitionOutOverlay),this.$element.find("."+i+"-loader").one(s,function(){t.$element.find("."+i+"-loader").removeClass(t.options.transitionOutOverlay).remove()})},recalculateLayout:function(){this.$element.find("."+i+"-header").length&&(this.headerHeight=parseInt(this.$element.find("."+i+"-header").innerHeight())+2,this.$element.css("overflow","hidden"));var e=t(window).height(),s=this.$element.find("."+i+"-content")[0].scrollHeight,o=parseInt(-((this.$element.innerHeight()+1)/2))+"px";if(this.state==n.OPENED||this.state==n.OPENING)if(this.options.iframe===!0)e<this.options.iframeHeight+this.headerHeight?(t(document.body).addClass(i+"-attached"),this.$element.find("."+i+"-iframe").css({height:parseInt(e-this.headerHeight)+"px"})):(t(document.body).removeClass(i+"-attached"),this.$element.find("."+i+"-iframe").css({height:parseInt(this.options.iframeHeight)+"px"}));else{e>s+this.headerHeight&&(t(document.body).removeClass(i+"-attached"),this.$element.find("."+i+"-wrap").css({height:"auto"})),(this.$element.innerHeight()>e||this.$element.innerHeight()<s)&&(t(document.body).addClass(i+"-attached"),this.$element.find("."+i+"-wrap").css({height:parseInt(e-this.headerHeight)+"px"}));var a=this.$element.find("."+i+"-wrap").scrollTop(),l=this.$element.find("."+i+"-content").innerHeight(),r=this.$element.find("."+i+"-wrap").innerHeight();l-50>r+a?this.$element.addClass("hasScroll"):this.$element.removeClass("hasScroll")}this.$element.css("margin-top")!=o&&"0px"!=this.$element.css("margin-top")&&this.$element.css("margin-top",o)}},t.fn[i]=function(e,n){return this.each(function(){var s=t(this),o=s.data(i),l=t.extend({},t.fn.iziModal.defaults,s.data(),"object"==typeof e&&e);o||e&&"object"!=typeof e||s.data(i,o=new a(this,l)),"string"==typeof e&&"undefined"!=typeof o?o[e].apply(o,[].concat(n)):l.autoOpen&&o.open()})},t.fn[i].defaults={title:"",subtitle:"",theme:"",headerColor:"#88A0B9",overlayColor:"rgba(0, 0, 0, 0.4)",iconColor:"",iconClass:null,width:600,padding:0,iframe:!1,iframeHeight:400,iframeURL:null,overlayClose:!0,closeOnEscape:!0,bodyOverflow:!1,focusInput:!0,autoOpen:!1,transitionInModal:"transitionIn",transitionOutModal:"transitionOut",transitionInOverlay:"fadeIn",transitionOutOverlay:"fadeOut",onOpening:function(){},onOpened:function(){},onClosing:function(){},onClosed:function(){}},t.fn[i].Constructor=a}).call(this,window.jQuery);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.04 |
proxy
|
phpinfo
|
Settings