[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/vendor/debugbar/ -> debugbar.min.js (source)

   1  if(void 0===PhpDebugBar){var PhpDebugBar={};PhpDebugBar.$=jQuery}!function(t){"undefined"==typeof localStorage&&(localStorage={setItem:function(t,e){},getItem:function(t){return null}}),void 0===PhpDebugBar.utils&&(PhpDebugBar.utils={});var e=PhpDebugBar.utils.getDictValue=function(t,e,i){for(var s=t,a=e.split("."),n=0;n<a.length;n++){if(!s[a[n]])return i;s=s[a[n]]}return s},i=PhpDebugBar.utils.getObjectSize=function(t){if(Object.keys)return Object.keys(t).length;var e=0;for(var i in t)t.hasOwnProperty(i)&&e++;return e};PhpDebugBar.utils.csscls=function(t,e){if(t.indexOf(" ")>-1){for(var i=t.split(" "),s=[],a=0,n=i.length;a<n;a++)s.push(PhpDebugBar.utils.csscls(i[a],e));return s.join(" ")}return 0===t.indexOf(".")?"."+e+t.substr(1):e+t},PhpDebugBar.utils.makecsscls=function(t){return function(e){return PhpDebugBar.utils.csscls(e,t)}};var s=PhpDebugBar.utils.makecsscls("phpdebugbar-"),a=PhpDebugBar.Widget=function(e){this._attributes=t.extend({},this.defaults),this._boundAttributes={},this.$el=t("<"+this.tagName+" />"),this.className&&this.$el.addClass(this.className),this.initialize.apply(this,[e||{}]),this.render.apply(this)};t.extend(a.prototype,{tagName:"div",className:null,defaults:{},initialize:function(t){this.set(t)},render:function(){},set:function(t,e){if("string"==typeof t){if(this._attributes[t]=e,void 0!==this._boundAttributes[t])for(var i=0,s=this._boundAttributes[t].length;i<s;i++)this._boundAttributes[t][i].apply(this,[e])}else for(var a in t)this.set(a,t[a])},has:function(t){return void 0!==this._attributes[t]&&null!==this._attributes[t]},get:function(t){return this._attributes[t]},bindAttr:function(e,i){if(t.isArray(e))for(var s=0,a=e.length;s<a;s++)this.bindAttr(e[s],i);else{if(void 0===this._boundAttributes[e]&&(this._boundAttributes[e]=[]),"object"==typeof i){var n=i;i=function(t){n.text(t||"")}}this._boundAttributes[e].push(i),this.has(e)&&i.apply(this,[this._attributes[e]])}}}),a.extend=function(e){var i=this,s=function(){return i.apply(this,arguments)};t.extend(s,i);var a=function(){this.constructor=s};return a.prototype=i.prototype,s.prototype=new a,t.extend(s.prototype,e),s.__super__=i.prototype,s};var n=a.extend({className:s("panel"),render:function(){this.$tab=t("<a />").addClass(s("tab")),this.$icon=t("<i />").appendTo(this.$tab),this.bindAttr("icon",(function(t){t?this.$icon.attr("class","phpdebugbar-fa phpdebugbar-fa-"+t):this.$icon.attr("class","")})),this.bindAttr("title",t("<span />").addClass(s("text")).appendTo(this.$tab)),this.$badge=t("<span />").addClass(s("badge")).appendTo(this.$tab),this.bindAttr("badge",(function(t){null!==t?(this.$badge.text(t),this.$badge.addClass(s("visible"))):this.$badge.removeClass(s("visible"))})),this.bindAttr("widget",(function(t){this.$el.empty().append(t.$el)})),this.bindAttr("data",(function(t){this.has("widget")&&this.get("widget").set("data",t)}))}}),r=a.extend({tagName:"span",className:s("indicator"),render:function(){this.$icon=t("<i />").appendTo(this.$el),this.bindAttr("icon",(function(t){t?this.$icon.attr("class","phpdebugbar-fa phpdebugbar-fa-"+t):this.$icon.attr("class","")})),this.bindAttr(["title","data"],t("<span />").addClass(s("text")).appendTo(this.$el)),this.$tooltip=t("<span />").addClass(s("tooltip disabled")).appendTo(this.$el),this.bindAttr("tooltip",(function(t){t?this.$tooltip.text(t).removeClass(s("disabled")):this.$tooltip.addClass(s("disabled"))}))}}),o=PhpDebugBar.DatasetTitleFormater=function(t){this.debugbar=t};t.extend(o.prototype,{format:function(t,e,s){s=s?" "+s:"";var a=i(this.debugbar.datasets)+1;if(void 0===e.__meta)return"#"+a+s;var n,r=e.__meta.uri;r.length&&"/"===r.charAt(r.length-1)?(n=(n=r.substr(0,r.length-1)).substr(n.lastIndexOf("/")+1),n+="/"):n=r.substr(r.lastIndexOf("/")+1);return n.length>150&&(n=n.substr(0,150)+"..."),"#"+a+" "+n+s+" ("+e.__meta.datetime.split(" ")[1]+")"}});var h=PhpDebugBar.DebugBar=a.extend({className:"phpdebugbar "+s("minimized"),options:{bodyMarginBottom:!0,bodyMarginBottomHeight:0},initialize:function(){this.controls={},this.dataMap={},this.datasets={},this.firstTabName=null,this.activePanelName=null,this.datesetTitleFormater=new o(this),this.options.bodyMarginBottomHeight=parseInt(t("body").css("margin-bottom")),this.registerResizeHandler()},registerResizeHandler:function(){if(void 0!==this.resize.bind){var e=this.resize.bind(this);this.respCSSSize=0,t(window).resize(e),setTimeout(e,20)}},resize:function(){var e=this.respCSSSize;0==this.respCSSSize&&this.$header.find("> div > *:visible").each((function(){e+=t(this).outerWidth()}));var i=this.$header.width(),s="phpdebugbar-mini-design",a=this.$header.hasClass(s);i<=e&&!a?(this.respCSSSize=e,this.$header.addClass(s)):e<i&&a&&(this.respCSSSize=0,this.$header.removeClass(s)),this.setHeight(this.$body.height())},render:function(){var e=this;this.$el.appendTo("body"),this.$dragCapture=t("<div />").addClass(s("drag-capture")).appendTo(this.$el),this.$resizehdle=t("<div />").addClass(s("resize-handle")).appendTo(this.$el),this.$header=t("<div />").addClass(s("header")).appendTo(this.$el),this.$headerLeft=t("<div />").addClass(s("header-left")).appendTo(this.$header),this.$headerRight=t("<div />").addClass(s("header-right")).appendTo(this.$header);var i,a,n=this.$body=t("<div />").addClass(s("body")).appendTo(this.$el);this.recomputeBottomOffset(),this.$resizehdle.on("mousedown",(function(t){a=n.height(),i=t.pageY,n.parents().on("mousemove",r).on("mouseup",o),e.$dragCapture.show(),t.preventDefault()}));var r=function(t){var s=a+(i-t.pageY);e.setHeight(s)},o=function(){n.parents().off("mousemove",r).off("mouseup",o),e.$dragCapture.hide()};this.$closebtn=t("<a />").addClass(s("close-btn")).appendTo(this.$headerRight),this.$closebtn.click((function(){e.close()})),this.$minimizebtn=t("<a />").addClass(s("minimize-btn")).appendTo(this.$headerRight),this.$minimizebtn.click((function(){e.minimize()})),this.$maximizebtn=t("<a />").addClass(s("maximize-btn")).appendTo(this.$headerRight),this.$maximizebtn.click((function(){e.restore()})),this.$restorebtn=t("<a />").addClass(s("restore-btn")).hide().appendTo(this.$el),this.$restorebtn.click((function(){e.restore()})),this.$openbtn=t("<a />").addClass(s("open-btn")).appendTo(this.$headerRight).hide(),this.$openbtn.click((function(){e.openHandler.show((function(t,i){e.addDataSet(i,t,"(opened)"),e.showTab()}))})),this.$datasets=t("<select />").addClass(s("datasets-switcher")).appendTo(this.$headerRight),this.$datasets.change((function(){e.dataChangeHandler(e.datasets[this.value]),e.showTab()}))},setHeight:function(e){var i=t(window).innerHeight()-this.$header.height()-10;e=Math.min(e,i),e=Math.max(e,40),this.$body.css("height",e),localStorage.setItem("phpdebugbar-height",e),this.recomputeBottomOffset()},restoreState:function(){var t=localStorage.getItem("phpdebugbar-height");this.setHeight(t||this.$body.height());var e=localStorage.getItem("phpdebugbar-open");if(e&&"0"==e)this.close();else{var i=localStorage.getItem("phpdebugbar-visible");if(i&&"1"==i){var s=localStorage.getItem("phpdebugbar-tab");this.isTab(s)&&this.showTab(s)}}},createTab:function(t,e,i){var s=new n({title:i||t.replace(/[_\-]/g," ").charAt(0).toUpperCase()+t.slice(1),widget:e});return this.addTab(t,s)},addTab:function(t,e){if(this.isControl(t))throw new Error(t+" already exists");var i=this;return e.$tab.appendTo(this.$headerLeft).click((function(){i.isMinimized()||i.activePanelName!=t?i.showTab(t):i.minimize()})),e.$el.appendTo(this.$body),this.controls[t]=e,null==this.firstTabName&&(this.firstTabName=t),e},createIndicator:function(t,e,i,s){var a=new r({icon:e,tooltip:i});return this.addIndicator(t,a,s)},addIndicator:function(t,e,i){if(this.isControl(t))throw new Error(t+" already exists");return"left"==i?e.$el.insertBefore(this.$headerLeft.children().first()):e.$el.appendTo(this.$headerRight),this.controls[t]=e,e},getControl:function(t){if(this.isControl(t))return this.controls[t]},isControl:function(t){return void 0!==this.controls[t]},isTab:function(t){return this.isControl(t)&&this.controls[t]instanceof n},isIndicator:function(t){return this.isControl(t)&&this.controls[t]instanceof r},reset:function(){this.minimize();var e=this;t.each(this.controls,(function(t,i){e.isTab(t)&&i.$tab.remove(),i.$el.remove()})),this.controls={}},showTab:function(e){if(e||(e=this.activePanelName?this.activePanelName:this.firstTabName),!this.isTab(e))throw new Error("Unknown tab '"+e+"'");this.$resizehdle.show(),this.$body.show(),this.recomputeBottomOffset(),t(this.$header).find("> div > ."+s("active")).removeClass(s("active")),t(this.$body).find("> ."+s("active")).removeClass(s("active")),this.controls[e].$tab.addClass(s("active")),this.controls[e].$el.addClass(s("active")),this.activePanelName=e,this.$el.removeClass(s("minimized")),localStorage.setItem("phpdebugbar-visible","1"),localStorage.setItem("phpdebugbar-tab",e),this.resize()},minimize:function(){this.$header.find("> div > ."+s("active")).removeClass(s("active")),this.$body.hide(),this.$resizehdle.hide(),this.recomputeBottomOffset(),localStorage.setItem("phpdebugbar-visible","0"),this.$el.addClass(s("minimized")),this.resize()},isMinimized:function(){return this.$el.hasClass(s("minimized"))},close:function(){this.$resizehdle.hide(),this.$header.hide(),this.$body.hide(),this.$restorebtn.show(),localStorage.setItem("phpdebugbar-open","0"),this.$el.addClass(s("closed")),this.recomputeBottomOffset()},isClosed:function(){return this.$el.hasClass(s("closed"))},restore:function(){this.$resizehdle.show(),this.$header.show(),this.$restorebtn.hide(),localStorage.setItem("phpdebugbar-open","1");var t=localStorage.getItem("phpdebugbar-tab");this.isTab(t)?this.showTab(t):this.showTab(),this.$el.removeClass(s("closed")),this.resize()},recomputeBottomOffset:function(){if(this.options.bodyMarginBottom){if(this.isClosed())return t("body").css("margin-bottom",this.options.bodyMarginBottomHeight||"");var e=parseInt(this.$el.height())+(this.options.bodyMarginBottomHeight||0);t("body").css("margin-bottom",e)}},setDataMap:function(t){this.dataMap=t},addDataMap:function(e){t.extend(this.dataMap,e)},setData:function(t){return this.datasets={},this.addDataSet(t)},addDataSet:function(e,s,a,n){var r=this.datesetTitleFormater.format(s,e,a);return s=s||i(this.datasets)+1,this.datasets[s]=e,this.$datasets.append(t('<option value="'+s+'">'+r+"</option>")),this.$datasets.children().length>1&&this.$datasets.show(),(void 0===n||n)&&this.showDataSet(s),s},loadDataSet:function(t,e,i,s){if(!this.openHandler)throw new Error("loadDataSet() needs an open handler");var a=this;this.openHandler.load(t,(function(n){a.addDataSet(n,t,e,s),a.resize(),i&&i(n)}))},getDataSet:function(t){return this.datasets[t]},showDataSet:function(t){this.dataChangeHandler(this.datasets[t]),this.$datasets.val(t)},dataChangeHandler:function(i){var s=this;t.each(this.dataMap,(function(t,a){var n=e(i,a[0],a[1]);-1!=t.indexOf(":")?(t=t.split(":"),s.getControl(t[0]).set(t[1],n)):s.getControl(t).set("data",n)}))},setOpenHandler:function(t){this.openHandler=t,null!==t?this.$openbtn.show():this.$openbtn.hide()},getOpenHandler:function(){return this.openHandler}});h.Tab=n,h.Indicator=r;var d=PhpDebugBar.AjaxHandler=function(t,e,i){this.debugbar=t,this.headerName=e||"phpdebugbar",this.autoShow=void 0===i||i};t.extend(d.prototype,{handle:function(t){return!(!this.isFetch(t)||t.headers.has(this.headerName+"-id"))||(!(!this.isXHR(t)||-1!==t.getAllResponseHeaders().indexOf(this.headerName))||(!!this.loadFromId(t)||this.loadFromData(t)))},getHeader:function(t,e){return this.isFetch(t)?t.headers.get(e):t.getResponseHeader(e)},isFetch:function(t){return"[object Response]"==Object.prototype.toString.call(t)},isXHR:function(t){return"[object XMLHttpRequest]"==Object.prototype.toString.call(t)},loadFromId:function(t){var e=this.extractIdFromHeaders(t);return!(!e||!this.debugbar.openHandler)&&(this.debugbar.loadDataSet(e,"(ajax)",void 0,this.autoShow),!0)},extractIdFromHeaders:function(t){return this.getHeader(t,this.headerName+"-id")},loadFromData:function(t){var e=this.extractDataFromHeaders(t);if(!e)return!1;var i=this.parseHeaders(e);if(i.error)throw new Error("Error loading debugbar data: "+i.error);return i.data&&this.debugbar.addDataSet(i.data,i.id,"(ajax)",this.autoShow),!0},extractDataFromHeaders:function(t){var e=this.getHeader(t,this.headerName);if(e){for(var i=1;;i++){var s=this.getHeader(t,this.headerName+"-"+i);if(!s)break;e+=s}return decodeURIComponent(e)}},parseHeaders:function(t){return JSON.parse(t)},bindToFetch:function(){var t=this,e=window.fetch;void 0!==e&&void 0!==e.polyfill||(window.fetch=function(){var i=e.apply(this,arguments);return i.then((function(e){t.handle(e)})),i})},bindToJquery:function(t){var e=this;t(document).ajaxComplete((function(t,i,s){s.ignoreDebugBarAjaxHandler||e.handle(i)}))},bindToXHR:function(){var t=this,e=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(i,s,a,n,r){var o=this;this.addEventListener("readystatechange",(function(){var e=t.debugbar.openHandler?t.debugbar.openHandler.get("url"):null;4==o.readyState&&0!==s.indexOf(e)&&t.handle(o)}),!1),e.apply(this,Array.prototype.slice.call(arguments))}}})}(PhpDebugBar.$);


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer