Файловый менеджер - Редактировать - /home/lmsyaran/public_html/joomla5/media/com_fabrik/js/dist/window.js
Назад
/*! Fabrik */ define(["jquery","fab/fabrik","jQueryUI","fab/utils"],function(a,l,t){return l.getWindow=function(t){if(l.Windows[t.id])!1!==t.visible&&l.Windows[t.id].open(),l.Windows[t.id]=a.extend(l.Windows[t.id],t);else switch(t.type||""){case"redirect":l.Windows[t.id]=new l.RedirectWindow(t);break;case"modal":l.Windows[t.id]=new l.Modal(t),a(window).on("resize",function(){t.id in l.Windows&&l.Windows[t.id].fitToContent(!1)});break;default:l.Windows[t.id]=new l.Window(t)}return l.Windows[t.id]},l.Window=new Class({Implements:[Events,Options],options:{id:"FabrikWindow",data:{},title:" ",container:!1,loadMethod:"html",contentURL:"",createShowOverLay:!1,width:300,height:300,loadHeight:100,expandable:!0,offset_x:null,offset_y:null,visible:!0,modalId:"",onClose:function(){},onOpen:function(){},onContentLoaded:function(){this.fitToContent(!1)},destroy:!0},modal:!1,classSuffix:"",expanded:!1,initialize:function(t){this.options=a.extend(this.options,t),this.makeWindow()},watchTabs:function(){var t=this;a(".nav-tabs a").on("mouseup",function(){t.fitToWidth(),t.drawWindow()})},deleteButton:function(){return a(l.jLayouts["modal-close"])[0]},contentHeight:function(){var t;return"iframe"===this.options.loadMethod?this.contentWrapperEl.find("iframe").height():((t=this.window.find(".contentWrapper")).css("height","auto"),t[0].getDimensions(!0).height)},center:function(){var t=this.window,i=this.windowDimensionInPx("width"),n=this.windowDimensionInPx("height"),o={},e=null===(e=t.width())||"auto"===e?i:e,i=null===(i=t.height())||"auto"===i?n:i;e=parseInt(e,10),i=parseInt(i,10),n=a(window).height()/2-i/2,-1===a.inArray(a(t).css("position"),["fixed","static"])&&(n+=window.getScroll().y),o.top=null!==this.options.offset_y?window.getScroll().y+this.options.offset_y:n,i=a(window).width()/2+window.getScroll().x-e/2,o.left=null!==this.options.offset_x?window.getScroll().x+this.options.offset_x:i,o["margin-left"]=0,t.css(o)},windowDimensionInPx:function(t){var i=this.options[t]+"";return-1!==i.indexOf("%")?"height"===t?Math.floor(a(window).height()*(i.toFloat()/100)):Math.floor(a(window).width()*(i.toFloat()/100)):parseInt(i,10)},makeWindow:function(){var t,i=this,n=(l.jLayouts[this.options.modalId]?(this.window=this.buildWinFromLayout(),this.window.find('*[data-role="title"]').text(this.options.title)):this.window=this.buildWinViaJS(),this.options.visible||this.window.addClass("fabrikHide"),a(document.body).append(this.window),this.loadContent(),this.options.visible||(this.window.hide(),this.window.removeClass("fabrikHide")),a(this.window).find('*[data-role="close"]').on("click",function(t){t.preventDefault(),i.close()}),this.window.find('*[data-role="expand"]').on("click",function(t){t.preventDefault(),i.expand()}),t=this.windowDimensionInPx("width"),n=this.contentHeight(),this.contentWrapperEl.css({height:n,width:t+"px"}),this.window.find('*[data-role="title"]'));this.options.modal||((t=0===this.window.find("*[data-draggable]").length?this.window:this.window.find("*[data-draggable]")).draggable({handle:n,drag:function(){l.fireEvent("fabrik.window.resized",i.window),i.drawWindow()}}),t.resizable({containment:i.options.container?a("#"+i.options.container):null,handles:{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",ne:".ui-resizable-ne",se:".ui-resizable-se",sw:".ui-resizable-sw",nw:".ui-resizable-nw"},resize:function(){l.fireEvent("fabrik.window.resized",i.window),i.drawWindow()}}),l.fireEvent("fabrik.window.opened",i.window)),0===a("div.modal-header .handlelabel").text().length&&void 0!==a("div.itemContentPadder form").context&&a("div.itemContentPadder form").context.title.length&&a("div.modal-header .handlelabel").text(a("div.itemContentPadder form").context.title),this.window.css("width",this.options.width),this.window.css("height",parseInt(this.options.height)+this.window.find('*[data-role="title"]').height()),this.options.modal?this.fitToContent(!1):this.center(),this.options.visible&&this.open()},buildWinFromLayout:function(){var t=a(l.jLayouts[this.options.modalId]);return this.contentEl=t.find(".itemContentPadder"),this.contentWrapperEl=t.find("div.contentWrapper"),t},buildWinViaJS:function(){var t,i,n,o=[],e=this,s=(this.window=new Element("div",{id:this.options.id,class:"fabrikWindow "+this.classSuffix+" modal"}),this.deleteButton()),d=(a(s).on("click",function(){e.close()}),"handlelabel"),h=(this.options.modal||(d+=" draggable",t=a("<div />").addClass("bottomBar modal-footer"),h=a("<div />").addClass("dragger"),t.append(h)),h=a(l.jLayouts["icon-full-screen"]),d=a("<h3 />").addClass(d).text(this.options.title),a(d).data("role","title"),a(d).attr("data-role","title"),o.push(d),this.options.expandable&&!1===this.options.modal&&(d=a("<a />").addClass("expand").attr({href:"#"}).append(h),o.push(d)),o.push(s),this.handle=this.getHandle().append(o),+parseInt(this.options.height)-15),d=(h<this.options.loadHeight&&(h=this.options.loadHeight),this.contentWrapperEl=a("<div />").addClass("contentWrapper").css({height:h+"px"}),a("<div />").addClass("itemContent"));if(this.contentEl=a("<div />").addClass("itemContentPadder"),d.append(this.contentEl),this.contentWrapperEl.append(d),this.window=a(this.window),this.options.modal)this.window.append([this.handle,this.contentWrapperEl]);else for(this.window.append([this.handle,this.contentWrapperEl,t]),i=["n","e","s","w","nw","ne","se","sw"],n=0;n<i.length;n++)this.window.append(a('<div class="ui-resizable-'+i[n]+' ui-resizable-handle"></div>'));return this.window},expand:function(){var t;this.expanded?(this.window.css({left:this.unexpanded.left+"px",top:this.unexpanded.top+"px"}),this.window.css({width:this.unexpanded.width,height:this.unexpanded.height}),this.expanded=!1):(this.expanded=!0,this.unexpanded=a.extend({},this.window.position(),{width:this.window.width(),height:this.window.height()}),t=window.getScroll(),this.window.css({left:t.x+"px",top:t.y+"px"}),this.window.css({width:a(window).width(),height:a(window).height()})),this.drawWindow()},getHandle:function(){var t=this.handleClass();return a("<div />").addClass("draggable "+t)},handleClass:function(){return"modal-header"},loadContent:function(){var i=this;switch(window.fireEvent("tips.hideall"),this.options.loadMethod){case"html":void 0===this.options.content?(fconsole("no content option set for window.html"),this.close()):("element"===typeOf(this.options.content)?a(this.options.content).appendTo(this.contentEl):this.contentEl.html(this.options.content),this.options.onContentLoaded.apply(this),this.watchTabs());break;case"xhr":i.window.width(i.options.width),i.window.height(i.options.height),i.onContentLoaded=i.options.onContentLoaded,l.loader.start(i.contentEl),new a.ajax({url:this.options.contentURL,data:a.extend(this.options.data,{fabrik_window_id:this.options.id}),method:"post",success:function(t){l.loader.stop(i.contentEl),i.contentEl.append(t),i.watchTabs(),i.center(),i.onContentLoaded.apply(i),Joomla.loadOptions()}});break;case"iframe":var t=parseInt(this.options.height,10)-40,n=this.contentEl[0].scrollWidth,n=n+40<a(window).width()?n+40:a(window).width(),o=this.window.find(".itemContent");l.loader.start(o),this.iframeEl&&this.iframeEl.remove(),this.iframeEl=a("<iframe />").addClass("fabrikWindowIframe").attr({id:this.options.id+"_iframe",name:this.options.id+"_iframe",class:"fabrikWindowIframe",src:this.options.contentURL,marginwidth:0,marginheight:0,frameBorder:0,scrolling:"auto"}).css({height:t+"px",width:n}).appendTo(o),this.iframeEl.hide(),this.iframeEl.on("load",function(){l.loader.stop(i.window.find(".itemContent")),i.iframeEl.show(),a(i).trigger("onContentLoaded",[i]),i.watchTabs()})}},titleHeight:function(){var t=0<(t=this.window.find("."+this.handleClass())).length?t.outerHeight():25;return t=isNaN(t)?0:t},footerHeight:function(){var t=parseInt(this.window.find(".bottomBar").outerHeight(),10);return t=isNaN(t)?0:t},drawWindow:function(){var t=this.titleHeight(),i=this.footerHeight(),n=this.contentHeight(),o=(0===this.window.find("*[data-draggable]").length?this.window:this.window.find("*[data-draggable]")).width();n>this.window.height()&&(n=this.window.height()-t-i),this.contentWrapperEl.css("height",n),this.contentWrapperEl.css("width",o-2),"iframe"===this.options.loadMethod&&(this.iframeEl.css("height",this.contentWrapperEl[0].offsetHeight),this.iframeEl.css("width",this.contentWrapperEl[0].offsetWidth-10))},fitToContent:function(t,i){t=void 0===t||t,i=void 0===i||i,"iframe"!==this.options.loadMethod&&(this.fitToHeight(),this.fitToWidth()),this.drawWindow(),i&&this.center(),!this.options.offset_y&&t&&a("body").scrollTop(this.window.offset().top)},fitToHeight:function(){var t=this.contentHeight()+this.footerHeight()+this.titleHeight(),i=a(window).height();this.window.css("height",t<i?t:i)},fitToWidth:function(){var t=this.window.find(".itemContent"),i=a(window).width(),t=t[0].scrollWidth;this.window.css("width",t+25<i?t+25:i)},close:function(t){t=t||!1,this.options.destroy||t?(this.window.remove(),delete l.Windows[this.options.id]):this.window.fadeOut({duration:0}),l.tips.hideAll(),this.options.onClose.apply(this),l.fireEvent("fabrik.window.close",[this])},open:function(t){t&&t.stopPropagation(),this.window.show(),this.options.onOpen.apply(this)}}),l.Modal=new Class({Extends:l.Window,modal:!0,classSuffix:"fabrikWindow-modal",getHandle:function(){return a("<div />").addClass(this.handleClass())},fitToHeight:function(){var t=this.contentHeight()+this.footerHeight()+this.titleHeight(),i=a(window).height(),t=t<i?t:i;this.window.css("height",Math.max(parseInt(this.options.height),t))},fitToWidth:function(){this.window.css("width",this.options.width)}}),l.RedirectWindow=new Class({Extends:l.Window,initialize:function(t){var i={id:"redirect",title:t.title||"",loadMethod:void 0,width:t.width||300,height:t.height||320,minimizable:!1,collapsible:!0,contentURL:t.contentURL||"",id:"redirect"},i=(t=a.merge(i,t)).contentURL;t.loadMethod="xhr",i.contains(l.liveSite)||!i.contains("http://")&&!i.contains("https://")?i.contains("tmpl=component")||(t.contentURL+=i.contains("?")?"&tmpl=component":"?tmpl=component"):t.loadMethod="iframe",this.options=a.extend(this.options,t),this.makeWindow()}}),l.Window});
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка