primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1,69 @@
@charset "UTF-8";
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status {
color: #555;
background: #fafafa;
border-bottom: 1px solid #ddd;
padding: 6px;
font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;
font-weight: bold;
}
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time, div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory, div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count, div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link, div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type {
float: right;
color: #888;
margin-left: 8px;
}
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-render-time, div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-memory, div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-param-count, div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status a.phpdebugbar-widgets-editor-link, div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-type {
color: #555;
}
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time:before, div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory:before, div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before, div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before, div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before, div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before {
margin-right: 4px;
font-family: PhpDebugbarFontAwesome;
font-size: 12px;
}
div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:hover {
color: #aaa;
}
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time:before {
content: "";
}
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory:before {
content: "";
}
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before {
content: "";
}
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before {
content: "";
}
div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before {
content: "";
margin-left: 4px;
}
div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params {
border-collapse: collapse;
border: 1px solid #ddd;
width: 70%;
margin: 10px;
font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace;
display: none;
}
div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params td {
border: 1px solid #ddd;
padding: 0 5px;
}
div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {
width: 20%;
font-weight: bold;
}

View File

@ -0,0 +1,103 @@
(function($) {
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-');
/**
* Widget for the displaying templates data
*
* Options:
* - data
*/
var TemplatesWidget = PhpDebugBar.Widgets.TemplatesWidget = PhpDebugBar.Widget.extend({
className: csscls('templates'),
render: function() {
this.$status = $('<div />').addClass(csscls('status')).appendTo(this.$el);
this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, tpl) {
$('<span />').addClass(csscls('name')).text(tpl.name).appendTo(li);
if (typeof tpl.xdebug_link !== 'undefined' && tpl.xdebug_link !== null) {
var header = $('<span />').addClass(csscls('filename')).text(tpl.xdebug_link.filename + ( tpl.xdebug_link.line ? "#" + tpl.xdebug_link.line : ''));
if (tpl.xdebug_link) {
if (tpl.xdebug_link.ajax) {
$('<a title="' + tpl.xdebug_link.url + '"></a>').on('click', function () {
fetch(tpl.xdebug_link.url);
}).addClass(csscls('editor-link')).appendTo(header);
} else {
$('<a href="' + tpl.xdebug_link.url + '"></a>').addClass(csscls('editor-link')).appendTo(header);
}
}
header.appendTo(li);
}
if (tpl.render_time_str) {
$('<span title="Render time" />').addClass(csscls('render-time')).text(tpl.render_time_str).appendTo(li);
}
if (tpl.memory_str) {
$('<span title="Memory usage" />').addClass(csscls('memory')).text(tpl.memory_str).appendTo(li);
}
if (typeof(tpl.param_count) != 'undefined') {
$('<span title="Parameter count" />').addClass(csscls('param-count')).text(tpl.param_count).appendTo(li);
}
if (typeof(tpl.type) != 'undefined' && tpl.type) {
$('<span title="Type" />').addClass(csscls('type')).text(tpl.type).appendTo(li);
}
if (typeof(tpl.editorLink) != 'undefined' && tpl.editorLink) {
$('<a href="'+ tpl.editorLink +'" />').on('click', function (event) {
event.stopPropagation();
}).addClass(csscls('editor-link')).text('file').appendTo(li);
}
if (tpl.params && !$.isEmptyObject(tpl.params)) {
var table = $('<table><tr><th colspan="2">Params</th></tr></table>').addClass(csscls('params')).appendTo(li);
for (var key in tpl.params) {
if (typeof tpl.params[key] !== 'function') {
table.append('<tr><td class="' + csscls('name') + '">' + key + '</td><td class="' + csscls('value') +
'"><pre><code>' + tpl.params[key] + '</code></pre></td></tr>');
}
}
li.css('cursor', 'pointer').click(function() {
if (window.getSelection().type == "Range") {
return''
}
if (table.is(':visible')) {
table.hide();
} else {
table.show();
}
});
}
}});
this.$list.$el.appendTo(this.$el);
this.$callgraph = $('<div />').addClass(csscls('callgraph')).appendTo(this.$el);
this.bindAttr('data', function(data) {
this.$list.set('data', data.templates);
this.$status.empty();
this.$callgraph.empty();
var sentence = data.sentence || "templates were rendered";
$('<span />').text(data.nb_templates + " " + sentence).appendTo(this.$status);
if (data.accumulated_render_time_str) {
this.$status.append($('<span title="Accumulated render time" />').addClass(csscls('render-time')).text(data.accumulated_render_time_str));
}
if (data.memory_usage_str) {
this.$status.append($('<span title="Memory usage" />').addClass(csscls('memory')).text(data.memory_usage_str));
}
if (data.nb_blocks > 0) {
$('<div />').text(data.nb_blocks + " blocks were rendered").appendTo(this.$status);
}
if (data.nb_macros > 0) {
$('<div />').text(data.nb_macros + " macros were rendered").appendTo(this.$status);
}
if (typeof data.callgraph !== 'undefined') {
this.$callgraph.html(data.callgraph);
}
});
}
});
})(PhpDebugBar.$);

View File

@ -0,0 +1 @@
@charset "UTF-8";div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status{color:#555;background:#fafafa;border-bottom:1px solid #ddd;padding:6px;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-weight:700}div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count,div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type{float:right;color:#888;margin-left:8px}div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-render-time,div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-memory,div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-param-count,div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status a.phpdebugbar-widgets-editor-link,div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-type{color:#555}div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time:before,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory:before,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before,div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before,div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before{margin-right:4px;font-family:PhpDebugbarFontAwesome;font-size:12px}div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:hover{color:#aaa}div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time:before{content:""}div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory:before{content:""}div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before{content:""}div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before{content:""}div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before{content:"";margin-left:4px}div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params{border-collapse:collapse;border:1px solid #ddd;width:70%;margin:10px;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;display:none}div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params td{border:1px solid #ddd;padding:0 5px}div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params .phpdebugbar-widgets-name{width:20%;font-weight:700}

Binary file not shown.

View File

@ -0,0 +1 @@
(function(t){var a=PhpDebugBar.utils.makecsscls("phpdebugbar-widgets-"),p=PhpDebugBar.Widgets.TemplatesWidget=PhpDebugBar.Widget.extend({className:a("templates"),render:function(){this.$status=t("<div />").addClass(a("status")).appendTo(this.$el),this.$list=new PhpDebugBar.Widgets.ListWidget({itemRenderer:function(s,e){if(t("<span />").addClass(a("name")).text(e.name).appendTo(s),typeof e.xdebug_link<"u"&&e.xdebug_link!==null){var i=t("<span />").addClass(a("filename")).text(e.xdebug_link.filename+(e.xdebug_link.line?"#"+e.xdebug_link.line:""));e.xdebug_link&&(e.xdebug_link.ajax?t('<a title="'+e.xdebug_link.url+'"></a>').on("click",function(){fetch(e.xdebug_link.url)}).addClass(a("editor-link")).appendTo(i):t('<a href="'+e.xdebug_link.url+'"></a>').addClass(a("editor-link")).appendTo(i)),i.appendTo(s)}if(e.render_time_str&&t('<span title="Render time" />').addClass(a("render-time")).text(e.render_time_str).appendTo(s),e.memory_str&&t('<span title="Memory usage" />').addClass(a("memory")).text(e.memory_str).appendTo(s),typeof e.param_count<"u"&&t('<span title="Parameter count" />').addClass(a("param-count")).text(e.param_count).appendTo(s),typeof e.type<"u"&&e.type&&t('<span title="Type" />').addClass(a("type")).text(e.type).appendTo(s),typeof e.editorLink<"u"&&e.editorLink&&t('<a href="'+e.editorLink+'" />').on("click",function(r){r.stopPropagation()}).addClass(a("editor-link")).text("file").appendTo(s),e.params&&!t.isEmptyObject(e.params)){var n=t('<table><tr><th colspan="2">Params</th></tr></table>').addClass(a("params")).appendTo(s);for(var d in e.params)typeof e.params[d]!="function"&&n.append('<tr><td class="'+a("name")+'">'+d+'</td><td class="'+a("value")+'"><pre><code>'+e.params[d]+"</code></pre></td></tr>");s.css("cursor","pointer").click(function(){if(window.getSelection().type=="Range")return"";n.is(":visible")?n.hide():n.show()})}}}),this.$list.$el.appendTo(this.$el),this.$callgraph=t("<div />").addClass(a("callgraph")).appendTo(this.$el),this.bindAttr("data",function(s){this.$list.set("data",s.templates),this.$status.empty(),this.$callgraph.empty();var e=s.sentence||"templates were rendered";t("<span />").text(s.nb_templates+" "+e).appendTo(this.$status),s.accumulated_render_time_str&&this.$status.append(t('<span title="Accumulated render time" />').addClass(a("render-time")).text(s.accumulated_render_time_str)),s.memory_usage_str&&this.$status.append(t('<span title="Memory usage" />').addClass(a("memory")).text(s.memory_usage_str)),s.nb_blocks>0&&t("<div />").text(s.nb_blocks+" blocks were rendered").appendTo(this.$status),s.nb_macros>0&&t("<div />").text(s.nb_macros+" macros were rendered").appendTo(this.$status),typeof s.callgraph<"u"&&this.$callgraph.html(s.callgraph)})}})})(PhpDebugBar.$);

Binary file not shown.