CoreFiles by mySites.guru
widget.min.js1 lines, 6,252 bytes, from Joomla_4.0.0-beta4-Beta-Full_Package.zip
Raw History Compare with 4.0.0-beta3
md5
a0978471a3813dfbae85c7e37974d0a7
sha1
8ddd9c07ccf4006edae8c893105e6a200eb6091e
sha256
59c15b665d3e7e574c35ba71f9987c4fab581c36ee915b6bb1df112ca5ee29b7
!function(t){var e=PhpDebugBar.utils.makecsscls("phpdebugbar-widgets-");PhpDebugBar.Widgets.SQLQueriesWidget=PhpDebugBar.Widget.extend({className:e("sqlqueries"),onFilterClick:function(a){t(a).toggleClass(e("excluded"));var s=[];this.$toolbar.find(e(".filter")+e(".excluded")).each(function(){s.push(this.rel)}),this.$list.$el.find("li[connection="+t(a).attr("rel")+"]").toggle(),this.set("exclude",s)},onFilterDupesClick:function(a){t(a).toggleClass(e("excluded"));var s=[];this.$toolbar.find(e(".filter")+e(".excluded")).each(function(){s.push(this.rel)}),this.$list.$el.find("li[dupeindex="+t(a).attr("rel")+"]").toggle(),this.set("exclude",s)},onCopyToClipboard:function(e){!function(t){if(document.selection)(e=document.body.createTextRange()).moveToElementText(t),e.select();else if(window.getSelection){var e;(e=document.createRange()).selectNodeContents(t),window.getSelection().removeAllRanges(),window.getSelection().addRange(e)}!function(){try{document.execCommand("copy"),alert("Query copied to the clipboard")}catch(t){console.log("Oops, unable to copy")}}(),window.getSelection().removeAllRanges()}(t(e).parent("li").find("code").get(0))},render:function(){this.$status=t("<div />").addClass(e("status")).appendTo(this.$el),this.$toolbar=t("<div></div>").addClass(e("toolbar")).appendTo(this.$el);var a=[],s=this;this.$list=new PhpDebugBar.Widgets.ListWidget({itemRenderer:function(i,n){if(t("<code />").addClass(e("sql")).html(PhpDebugBar.Widgets.highlight(n.sql,"sql")).appendTo(i),n.duration_str&&t('<span title="Duration" />').addClass(e("duration")).text(n.duration_str).appendTo(i),n.memory_str&&t('<span title="Memory usage" />').addClass(e("memory")).text(n.memory_str).appendTo(i),void 0!==n.row_count&&t('<span title="Row count" />').addClass(e("row-count")).text(n.row_count).appendTo(i),void 0!==n.stmt_id&&n.stmt_id&&t('<span title="Prepared statement ID" />').addClass(e("stmt-id")).text(n.stmt_id).appendTo(i),n.connection&&(t('<span title="Connection" />').addClass(e("database")).text(n.connection).appendTo(i),i.attr("connection",n.connection),-1==t.inArray(n.connection,a)&&(a.push(n.connection),t("<a />").addClass(e("filter")).text(n.connection).attr("rel",n.connection).on("click",function(){s.onFilterClick(this)}).appendTo(s.$toolbar),a.length>1&&(s.$toolbar.show(),s.$list.$el.css("margin-bottom","20px")))),void 0===n.is_success||n.is_success||(i.addClass(e("error")),i.append(t("<span />").addClass(e("error")).text("["+n.error_code+"] "+n.error_message))),n.params&&!t.isEmptyObject(n.params)){var l=t('<table><tr><th colspan="2">Params</th></tr></table>').addClass(e("params")).appendTo(i);for(var o in n.params)"function"!=typeof n.params[o]&&l.append('<tr><td class="'+e("name")+'">'+o+'</td><td class="'+e("value")+'">'+n.params[o]+"</td></tr>");i.css("cursor","pointer").click(function(){l.is(":visible")?l.hide():l.show()})}var d,r;if(n.explain&&!t.isEmptyObject(n.explain))var c=t('<span title="Explain" />').text("Explain").addClass(e("eye")).css("cursor","pointer").on("click",function(){d&&d.is(":visible")?(d.hide(),c.addClass(e("eye")),c.removeClass(e("eye-dash"))):(!function(){if(d)d.show();else{var a,s,l;for(a in(d=t("<table>").addClass(e("callstack")).appendTo(i)).append("<tr><th>"+n.explain_col.join("</th><th>")+"</th></tr>"),n.explain)l=[],s=n.explain[a],n.explain_col.forEach(function(t){l.push(s[t])}),d.append("<tr><td>"+l.join("</td><td>")+"</td></tr>");d.show()}}(),c.addClass(e("eye-dash")),c.removeClass(e("eye")))}).appendTo(i);if(n.callstack&&!t.isEmptyObject(n.callstack)){var p=t('<span title="Call Stack" />').text("Stack").addClass(e("eye")).css("cursor","pointer").on("click",function(){r.is(":visible")?(r.hide(),p.addClass(e("eye")),p.removeClass(e("eye-dash"))):(r.show(),p.addClass(e("eye-dash")),p.removeClass(e("eye")))}).appendTo(i);r=t('<table><thead><tr><th colspan="3">Call Stack</th></tr></thead></table>').addClass(e("callstack"))}if(void 0!==n.caller&&n.caller){var u=n.caller.replace(s.root_path,"");if(s.xdebug_link){var h=n.caller.split(":");t("<a />").text(u).addClass(e("editor-link")).attr("href",s.xdebug_link.replace("%f",h[0]).replace("%l",h[1])).appendTo(i)}else t('<span title="Caller" />').text(u).addClass(e("stmt-id")).appendTo(i)}if(t('<span title="Copy to clipboard" />').text("Copy").addClass(e("copy-clipboard")).css("cursor","pointer").on("click",function(t){s.onCopyToClipboard(this),t.stopPropagation()}).appendTo(i),r)for(var m in r.appendTo(i),n.callstack){var f=n.callstack[m],g=f[3]?f[3].replace(s.root_path,"")+":"+f[4]:"",C=(u=f[2].replace(s.root_path,""),f[1]?"caller":"");g&&s.xdebug_link&&(g='<a href="'+s.xdebug_link.replace("%f",f[3]).replace("%l",f[4])+'">'+g+"</a>"),r.append('<tr class="'+C+'"><th>'+f[0]+"</th><td>"+u+"</td><td>"+g+"</td></tr>")}i.attr("dupeindex","dupe-0")}}),this.$list.$el.appendTo(this.$el),this.bindAttr("data",function(a){if(a.length<=0)return!1;this.root_path=a.root_path,this.xdebug_link=a.xdebug_link,this.$list.set("data",a.statements),this.$status.empty();for(var i={},n=0,l=0,o=0;o<a.statements.length;o++){var d=a.statements[o].sql;a.statements[o].params&&!t.isEmptyObject(a.statements[o].params)&&(d+=" {"+t.param(a.statements[o].params,!1)+"}"),i[d]=i[d]||{keys:[]},i[d].keys.push(o)}var r=0;for(var d in i)if(i[d].keys.length>1){l+=i[d].keys.length,r++;for(o=0;o<i[d].keys.length;o++)this.$list.$el.find("."+e("list-item")).eq(i[d].keys[o]).addClass(e("sql-duplicate")).attr("dupeindex","dupe-"+r)}else n++;if(l){for(o=0;o<=r;o++)t("<a />").addClass(e("filter")).text(o?"Duplicates "+o:"Uniques").attr("rel","dupe-"+o).on("click",function(){s.onFilterDupesClick(this)}).appendTo(s.$toolbar);s.$toolbar.show(),s.$list.$el.css("margin-bottom","20px")}var c=t("<span />").text(a.nb_statements+" statements were executed").appendTo(this.$status);a.nb_failed_statements&&c.append(", "+a.nb_failed_statements+" of which failed"),l&&(c.append(", "+l+" of which were duplicates"),c.append(", "+n+" unique")),a.accumulated_duration_str&&this.$status.append(t('<span title="Accumulated duration" />').addClass(e("duration")).text(a.accumulated_duration_str)),a.memory_usage_str&&this.$status.append(t('<span title="Memory usage" />').addClass(e("memory")).text(a.memory_usage_str))})}})}(PhpDebugBar.$);

No other release has this exact content. See every version of this file.