first commit
This commit is contained in:
73
media/vendor/debugbar/widgets/templates/widget.css
vendored
Normal file
73
media/vendor/debugbar/widgets/templates/widget.css
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
|
||||
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status {
|
||||
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||
padding: 6px 6px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
font-weight: bold;
|
||||
color: #555;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
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;
|
||||
margin-left: 8px;
|
||||
color: #888;
|
||||
}
|
||||
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
|
||||
{
|
||||
font-family: PhpDebugbarFontAwesome;
|
||||
margin-right: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:hover
|
||||
{
|
||||
color: #aaaaaa;
|
||||
}
|
||||
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time:before {
|
||||
content: "\f017";
|
||||
}
|
||||
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory:before {
|
||||
content: "\f085";
|
||||
}
|
||||
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before {
|
||||
content: "\f0ce";
|
||||
}
|
||||
div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before {
|
||||
content: "\f121";
|
||||
}
|
||||
div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before {
|
||||
content: "\f08e";
|
||||
margin-left: 4px;
|
||||
}
|
||||
div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params {
|
||||
display: none;
|
||||
width: 70%;
|
||||
margin: 10px;
|
||||
border: 1px solid #ddd;
|
||||
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
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;
|
||||
}
|
||||
98
media/vendor/debugbar/widgets/templates/widget.js
vendored
Normal file
98
media/vendor/debugbar/widgets/templates/widget.js
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
(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) {
|
||||
if (tpl.xdebug_link.ajax) {
|
||||
$('<a title="' + tpl.xdebug_link.url + '"></a>').on('click', function (event) {
|
||||
event.stopPropagation();
|
||||
$.ajax(tpl.xdebug_link.url);
|
||||
}).addClass(csscls('editor-link')).appendTo(li);
|
||||
} else {
|
||||
$('<a href="' + tpl.xdebug_link.url + '"></a>').on('click', function (event) {
|
||||
event.stopPropagation();
|
||||
}).addClass(csscls('editor-link')).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 (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.$);
|
||||
1
media/vendor/debugbar/widgets/templates/widget.min.css
vendored
Normal file
1
media/vendor/debugbar/widgets/templates/widget.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status{background:#fafafa;border-bottom:1px solid #ddd;color:#555;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-weight:700;padding:6px}div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type{color:#888;float:right;margin-left:8px}div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status a.phpdebugbar-widgets-editor-link,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 span.phpdebugbar-widgets-render-time,div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status span.phpdebugbar-widgets-type{color:#555}div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link: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-render-time:before,div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before{font-family:PhpDebugbarFontAwesome;font-size:12px;margin-right:4px}div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:hover{color:#aaa}div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-render-time:before{content:"\f017"}div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-memory:before{content:"\f085"}div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-param-count:before{content:"\f0ce"}div.phpdebugbar-widgets-templates span.phpdebugbar-widgets-type:before{content:"\f121"}div.phpdebugbar-widgets-templates a.phpdebugbar-widgets-editor-link:before{content:"\f08e";margin-left:4px}div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params{border:1px solid #ddd;border-collapse:collapse;display:none;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;margin:10px;width:70%}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{font-weight:700;width:20%}
|
||||
BIN
media/vendor/debugbar/widgets/templates/widget.min.css.gz
vendored
Normal file
BIN
media/vendor/debugbar/widgets/templates/widget.min.css.gz
vendored
Normal file
Binary file not shown.
1
media/vendor/debugbar/widgets/templates/widget.min.js
vendored
Normal file
1
media/vendor/debugbar/widgets/templates/widget.min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
!function(e){var t=PhpDebugBar.utils.makecsscls("phpdebugbar-widgets-");PhpDebugBar.Widgets.TemplatesWidget=PhpDebugBar.Widget.extend({className:t("templates"),render:function(){this.$status=e("<div />").addClass(t("status")).appendTo(this.$el),this.$list=new PhpDebugBar.Widgets.ListWidget({itemRenderer:function(a,s){if(e("<span />").addClass(t("name")).text(s.name).appendTo(a),void 0!==s.xdebug_link&&null!==s.xdebug_link&&(s.xdebug_link.ajax?e('<a title="'+s.xdebug_link.url+'"></a>').on("click",(function(t){t.stopPropagation(),e.ajax(s.xdebug_link.url)})).addClass(t("editor-link")).appendTo(a):e('<a href="'+s.xdebug_link.url+'"></a>').on("click",(function(e){e.stopPropagation()})).addClass(t("editor-link")).appendTo(a)),s.render_time_str&&e('<span title="Render time" />').addClass(t("render-time")).text(s.render_time_str).appendTo(a),s.memory_str&&e('<span title="Memory usage" />').addClass(t("memory")).text(s.memory_str).appendTo(a),void 0!==s.param_count&&e('<span title="Parameter count" />').addClass(t("param-count")).text(s.param_count).appendTo(a),void 0!==s.type&&s.type&&e('<span title="Type" />').addClass(t("type")).text(s.type).appendTo(a),void 0!==s.editorLink&&s.editorLink&&e('<a href="'+s.editorLink+'" />').on("click",(function(e){e.stopPropagation()})).addClass(t("editor-link")).text("file").appendTo(a),s.params&&!e.isEmptyObject(s.params)){var d=e('<table><tr><th colspan="2">Params</th></tr></table>').addClass(t("params")).appendTo(a);for(var r in s.params)"function"!=typeof s.params[r]&&d.append('<tr><td class="'+t("name")+'">'+r+'</td><td class="'+t("value")+'"><pre><code>'+s.params[r]+"</code></pre></td></tr>");a.css("cursor","pointer").click((function(){d.is(":visible")?d.hide():d.show()}))}}}),this.$list.$el.appendTo(this.$el),this.$callgraph=e("<div />").addClass(t("callgraph")).appendTo(this.$el),this.bindAttr("data",(function(a){this.$list.set("data",a.templates),this.$status.empty(),this.$callgraph.empty();var s=a.sentence||"templates were rendered";e("<span />").text(a.nb_templates+" "+s).appendTo(this.$status),a.accumulated_render_time_str&&this.$status.append(e('<span title="Accumulated render time" />').addClass(t("render-time")).text(a.accumulated_render_time_str)),a.memory_usage_str&&this.$status.append(e('<span title="Memory usage" />').addClass(t("memory")).text(a.memory_usage_str)),a.nb_blocks>0&&e("<div />").text(a.nb_blocks+" blocks were rendered").appendTo(this.$status),a.nb_macros>0&&e("<div />").text(a.nb_macros+" macros were rendered").appendTo(this.$status),void 0!==a.callgraph&&this.$callgraph.html(a.callgraph)}))}})}(PhpDebugBar.$);
|
||||
BIN
media/vendor/debugbar/widgets/templates/widget.min.js.gz
vendored
Normal file
BIN
media/vendor/debugbar/widgets/templates/widget.min.js.gz
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user