vendor and env first commit

This commit is contained in:
2025-03-28 08:52:46 +01:00
parent f8388bc81b
commit 8f26283832
10976 changed files with 1349952 additions and 2 deletions
@@ -0,0 +1,381 @@
/* Hide debugbar when printing a page */
@media print {
div.phpdebugbar {
display: none;
}
}
div.phpdebugbar {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
border-top: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
background: #fff;
z-index: 10000;
font-size: 14px;
color: #000;
text-align: left;
line-height: 1;
letter-spacing: normal;
direction: ltr;
}
div.phpdebugbar a,
div.phpdebugbar-openhandler {
cursor: pointer;
}
div.phpdebugbar-drag-capture {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 10001;
background: none;
display: none;
cursor: ns-resize;
}
div.phpdebugbar-closed {
width: auto;
}
div.phpdebugbar * {
margin: 0;
padding: 0;
border: 0;
font-weight: normal;
text-decoration: none;
clear: initial;
width: auto;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
div.phpdebugbar ol, div.phpdebugbar ul {
list-style: none;
}
div.phpdebugbar ul li, div.phpdebugbar ol li, div.phpdebugbar dl li {
line-height: 1;
}
div.phpdebugbar table, .phpdebugbar-openhandler table {
border-collapse: collapse;
border-spacing: 0;
color: inherit;
}
div.phpdebugbar input[type='text'], div.phpdebugbar input[type='password'] {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
background: #fff;
font-size: 14px;
color: #000;
border: 0;
padding: 0;
margin: 0;
}
div.phpdebugbar code, div.phpdebugbar pre, div.phpdebugbar samp {
background: none;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 1em;
border: 0;
padding: 0;
margin: 0;
}
div.phpdebugbar code, div.phpdebugbar pre {
color: #000;
}
div.phpdebugbar pre.sf-dump {
color: #a0a000;
outline: 0;
}
a.phpdebugbar-restore-btn {
float: left;
padding: 5px 8px;
font-size: 14px;
color: #555;
text-decoration: none;
border-right: 1px solid #ddd;
}
div.phpdebugbar-resize-handle {
display: none;
height: 4px;
margin-top: -4px;
width: 100%;
background: none;
border-bottom: 1px solid #ccc;
cursor: ns-resize;
}
div.phpdebugbar-closed, div.phpdebugbar-minimized{
border-top: 1px solid #ccc;
}
/* -------------------------------------- */
a.phpdebugbar-restore-btn {
background: #efefef url(data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2020%2020%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20fill%3D%22%23000%22%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M6.039%208.342c.463%200%20.772.084.927.251.154.168.191.455.11.862-.084.424-.247.727-.487.908-.241.182-.608.272-1.1.272h-.743l.456-2.293h.837zm-2.975%204.615h1.22l.29-1.457H5.62c.461%200%20.84-.047%201.139-.142.298-.095.569-.254.812-.477.205-.184.37-.387.497-.608.127-.222.217-.466.27-.734.13-.65.032-1.155-.292-1.518-.324-.362-.84-.543-1.545-.543H4.153l-1.089%205.479zM9.235%206.02h1.21l-.289%201.458h1.079c.679%200%201.147.115%201.405.347.258.231.335.607.232%201.125l-.507%202.55h-1.23l.481-2.424c.055-.276.035-.464-.06-.565-.095-.1-.298-.15-.608-.15H9.98L9.356%2011.5h-1.21l1.089-5.48M15.566%208.342c.464%200%20.773.084.928.251.154.168.19.455.11.862-.084.424-.247.727-.488.908-.24.182-.607.272-1.1.272h-.742l.456-2.293h.836zm-2.974%204.615h1.22l.29-1.457h1.046c.461%200%20.84-.047%201.139-.142.298-.095.569-.254.812-.477.205-.184.37-.387.497-.608.127-.222.217-.466.27-.734.129-.65.032-1.155-.292-1.518-.324-.362-.84-.543-1.545-.543H13.68l-1.089%205.479z%22%20fill%3D%22%23FFF%22%2F%3E%3C%2Fsvg%3E) no-repeat 5px 4px / 20px 20px;
}
div.phpdebugbar-header {
min-height: 26px;
line-height: 16px;
}
div.phpdebugbar-header:before, div.phpdebugbar-header:after {
display: table;
line-height: 0;
content: "";
}
div.phpdebugbar-header:after {
clear: both;
}
div.phpdebugbar-header-left {
float: left;
}
div.phpdebugbar-header-right {
float: right;
}
div.phpdebugbar-header > div > * {
padding: 5px 5px;
font-size: 14px;
color: #555;
text-decoration: none;
}
div.phpdebugbar-header-left > * {
float: left;
}
div.phpdebugbar-header-right > * {
float: right;
}
div.phpdebugbar-header-right > select {
padding: 0;
line-height: 1em;
}
/* -------------------------------------- */
span.phpdebugbar-indicator,
a.phpdebugbar-indicator,
a.phpdebugbar-close-btn {
border-right: 1px solid #ddd;
}
a.phpdebugbar-tab.phpdebugbar-active {
background: #ccc;
color: #444;
background-image: linear-gradient(bottom, rgb(173,173,173) 41%, rgb(209,209,209) 71%);
background-image: -o-linear-gradient(bottom, rgb(173,173,173) 41%, rgb(209,209,209) 71%);
background-image: -moz-linear-gradient(bottom, rgb(173,173,173) 41%, rgb(209,209,209) 71%);
background-image: -webkit-linear-gradient(bottom, rgb(173,173,173) 41%, rgb(209,209,209) 71%);
background-image: -ms-linear-gradient(bottom, rgb(173,173,173) 41%, rgb(209,209,209) 71%);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.41, rgb(173,173,173)), color-stop(0.71, rgb(209,209,209)));
}
a.phpdebugbar-tab span.phpdebugbar-badge {
display: none;
margin-left: 5px;
font-size: 11px;
line-height: 14px;
padding: 0 6px;
background: #ccc;
border-radius: 4px;
color: #555;
font-weight: normal;
text-shadow: none;
vertical-align: middle;
}
a.phpdebugbar-tab i {
display: none;
vertical-align: middle;
}
a.phpdebugbar-tab span.phpdebugbar-badge.phpdebugbar-visible {
display: inline;
}
a.phpdebugbar-tab span.phpdebugbar-badge.phpdebugbar-important {
background: #ed6868;
color: white;
}
a.phpdebugbar-close-btn, a.phpdebugbar-open-btn, a.phpdebugbar-restore-btn, a.phpdebugbar-minimize-btn , a.phpdebugbar-maximize-btn {
width: 16px;
height: 16px;
}
a.phpdebugbar-maximize-btn { display: none}
a.phpdebugbar-minimize-btn { display: block}
div.phpdebugbar-minimized a.phpdebugbar-maximize-btn { display: block}
div.phpdebugbar-minimized a.phpdebugbar-minimize-btn { display: none}
a.phpdebugbar-minimize-btn {
background:url(data:image/svg+xml,%3Csvg%20viewBox=%220%200%201792%201792%22%20fill=%22none%22%20xmlns=%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d=%22m1683%20653.5-742%20741c-12.667%2012.67-27.667%2019-45%2019s-32.333-6.33-45-19l-742-741c-12.667-12.667-19-27.833-19-45.5s6.333-32.833%2019-45.5l166-165c12.667-12.667%2027.667-19%2045-19s32.333%206.333%2045%2019l531%20531%20531-531c12.67-12.667%2027.67-19%2045-19s32.33%206.333%2045%2019l166%20165c12.67%2012.667%2019%2027.833%2019%2045.5s-6.33%2032.833-19%2045.5Z%22%20fill=%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 14px 14px;
}
a.phpdebugbar-maximize-btn {
background: url(data:image/svg+xml,%3Csvg%20viewBox=%220%200%201792%201792%22%20fill=%22none%22%20xmlns=%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d=%22m1683%201229.5-166%20165c-12.67%2012.67-27.67%2019-45%2019s-32.33-6.33-45-19l-531-531-531%20531c-12.667%2012.67-27.667%2019-45%2019s-32.333-6.33-45-19l-166-165c-12.667-12.67-19-27.83-19-45.5s6.333-32.83%2019-45.5l742-741c12.667-12.667%2027.667-19%2045-19s32.333%206.333%2045%2019l742%20741c12.67%2012.67%2019%2027.83%2019%2045.5s-6.33%2032.83-19%2045.5Z%22%20fill=%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 14px 14px;
}
a.phpdebugbar-close-btn {
background: url(data:image/svg+xml,%3Csvg%20viewBox=%220%200%201792%201792%22%20fill=%22none%22%20xmlns=%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d=%22M1490%201258c0%2026.67-9.33%2049.33-28%2068l-136%20136c-18.67%2018.67-41.33%2028-68%2028s-49.33-9.33-68-28l-294-294-294%20294c-18.667%2018.67-41.333%2028-68%2028s-49.333-9.33-68-28l-136-136c-18.667-18.67-28-41.33-28-68s9.333-49.33%2028-68l294-294-294-294c-18.667-18.667-28-41.333-28-68s9.333-49.333%2028-68l136-136c18.667-18.667%2041.333-28%2068-28s49.333%209.333%2068%2028l294%20294%20294-294c18.67-18.667%2041.33-28%2068-28s49.33%209.333%2068%2028l136%20136c18.67%2018.667%2028%2041.333%2028%2068s-9.33%2049.333-28%2068l-294%20294%20294%20294c18.67%2018.67%2028%2041.33%2028%2068Z%22%20fill=%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat center / 14px 14px;
}
a.phpdebugbar-open-btn {
background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 1792 1792'%3e%3cpath fill='%23555' d='M1646 991.796c0 16.494-8.25 34.064-24.75 52.684l-268.22 316.13c-22.89 27.14-54.95 50.16-96.2 69.05S1177.4 1458 1142.27 1458H273.728c-18.095 0-34.194-3.46-48.297-10.38-14.104-6.92-21.155-18.36-21.155-34.32 0-16.5 8.249-34.06 24.747-52.69l268.228-316.13c22.884-27.14 54.949-50.156 96.194-69.049 41.246-18.893 79.431-28.34 114.556-28.34h868.549c18.09 0 34.19 3.459 48.3 10.378 14.1 6.918 21.15 18.361 21.15 34.327Zm-273.82-274.615v127.728H708.001c-50.027 0-102.448 12.64-157.264 37.919-54.817 25.28-98.457 57.078-130.921 95.397L150.79 1294.35l-3.992 4.79c0-2.13-.133-5.46-.399-9.98-.266-4.52-.399-7.85-.399-9.98V512.817c0-48.962 17.563-91.005 52.688-126.13 35.125-35.126 77.168-52.688 126.131-52.688h255.455c48.962 0 91.005 17.562 126.13 52.688 35.126 35.125 52.688 77.168 52.688 126.13v25.546h434.278c48.96 0 91 17.563 126.13 52.688 35.12 35.125 52.68 77.168 52.68 126.13Z'/%3e%3c/svg%3e") no-repeat center / 14px 14px;
}
.phpdebugbar-indicator {
position: relative;
cursor: pointer;
}
.phpdebugbar-indicator span.phpdebugbar-text {
margin-left: 5px;
}
.phpdebugbar-indicator span.phpdebugbar-tooltip {
display: none;
position: absolute;
top: -30px;
background: #efefef;
opacity: .7;
border: 1px solid #ccc;
color: #555;
font-size: 11px;
padding: 2px 3px;
z-index: 1000;
text-align: center;
width: 200%;
right: 0;
}
.phpdebugbar-indicator:hover span.phpdebugbar-tooltip:not(.phpdebugbar-disabled) {
display: block;
}
select.phpdebugbar-datasets-switcher {
float: right;
display: none;
margin: 2px 0 0 7px;
max-width: 200px;
max-height: 23px;
padding: 0;
}
/* -------------------------------------- */
div.phpdebugbar-body {
border-top: 1px solid #ccc;
display: none;
position: relative;
height: 300px;
}
/* -------------------------------------- */
div.phpdebugbar-panel {
display: none;
height: 100%;
overflow: auto;
width: 100%;
}
div.phpdebugbar-panel.phpdebugbar-active {
display: block;
}
/* -------------------------------------- */
div.phpdebugbar-mini-design a.phpdebugbar-tab {
position: relative;
border-right: 1px solid #ddd;
}
div.phpdebugbar-mini-design a.phpdebugbar-tab span.phpdebugbar-text {
display: none;
}
div.phpdebugbar-mini-design a.phpdebugbar-tab:hover span.phpdebugbar-text {
display: block;
position: absolute;
top: -30px;
background: #efefef;
opacity: .7;
border: 1px solid #ccc;
color: #555;
font-size: 11px;
padding: 2px 3px;
z-index: 1000;
text-align: center;
right: 0;
}
div.phpdebugbar-mini-design a.phpdebugbar-tab i {
display:inline-block;
}
/* -------------------------------------- */
a.phpdebugbar-tab.phpdebugbar-tab-history {
min-width: 16px;
height: 16px;
display: flex;
justify-content: center;
align-items: center;
}
a.phpdebugbar-tab.phpdebugbar-tab-history .phpdebugbar-text {
display: none;
}
a.phpdebugbar-tab.phpdebugbar-tab-history i {
display:inline-block;
}
.phpdebugbar-widgets-dataset-history table {
width: 100%;
table-layout: fixed;
}
.phpdebugbar-widgets-dataset-history table th {
font-weight: bold;
}
.phpdebugbar-widgets-dataset-history table td, .phpdebugbar-widgets-dataset-history table th {
padding: 6px 3px;
border-bottom: 1px solid #ddd;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.phpdebugbar-widgets-dataset-history table td a{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.phpdebugbar-widgets-dataset-history table tr.phpdebugbar-widgets-active {
background: #ccc;
color: #444;
}
.phpdebugbar-widgets-dataset-history span.phpdebugbar-badge {
margin: 0 5px 0 2px;
font-size: 11px;
line-height: 14px;
padding: 0 6px;
background: #ccc;
border-radius: 4px;
color: #555;
font-weight: normal;
text-shadow: none;
vertical-align: middle;
}
.phpdebugbar-widgets-dataset-history .phpdebugbar-widgets-dataset-actions {
text-align: center;
padding: 7px 0;
position: sticky;
top: 0;
background: #fff;
}
.phpdebugbar-widgets-dataset-history .phpdebugbar-widgets-dataset-actions a {
margin: 0 10px;
}
.phpdebugbar-widgets-dataset-history .phpdebugbar-widgets-dataset-actions input {
appearance: checkbox !important;
margin: 5px;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,70 @@
div.phpdebugbar-openhandler-overlay {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: #000;
opacity: .3;
z-index: 20000;
}
div.phpdebugbar-openhandler {
position: fixed;
margin: auto;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 70%;
height: 70%;
background: #fff;
color: #000;
border: 2px solid #888;
overflow: auto;
z-index: 20001;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
padding-bottom: 10px;
}
div.phpdebugbar-openhandler a {
color: #555;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-header {
background: #efefef url(data:image/png;base64,iVBORw0KGgoA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fb1CNpulNWyiqAr2xi0A5nN5QiEDze+n0QAkmic7/+diZ6K7bXLyTTxNKr19T/Hq+Css5Be4vpinWCwS8BsEQi3UajVMM45t24zsHaKv72leG59gcuINFKEsC6/X+13cfOT1S1cu8u03x8jl8ti2zfT0NCMjo9RqFS5fyhAMBejp6WZsbD9mLM6pk7+gqio/Hf+Ret1hLpv5Xhgh4+WwEZmey84ykO5HuuqWMwXgOA6ffzHF1NQR5jJ5FPWuxZaWCwcEEHzs0cfPeVtangwGjQdOfbVSpcXrRd0ktFZazVzLzw8rQHlpuXA4FAo/lIU0v3aPkBCCxesLh4Gyeic2c+Ov5d0xM57arsWtcF2XCxdnvpJSfgygbrr7wbJWioYRfqm5uXlH+6iqSr1eJ3P1yjuudD/cbp8BJIUQX/enBoYbjcaWQr//8ds5KeXbQG6n5biZXcABIDaYHkn+ev5sDvgbmAYW+L/5B5NrVZNHcIujAAAAAElFTkSuQmCC) no-repeat 5px 4px;
padding-left: 29px;
min-height: 26px;
line-height: 25px;
color: #555;
margin-bottom: 10px;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-header a {
font-size: 14px;
color: #555;
text-decoration: none;
float: right;
padding: 5px 8px;
}
div.phpdebugbar-openhandler table {
width: 100%;
table-layout: fixed;
font-size: 14px;
}
div.phpdebugbar-openhandler table td {
padding: 6px 3px;
border-bottom: 1px solid #ddd;
}
div.phpdebugbar-openhandler table td a{
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions {
text-align: center;
padding: 7px 0;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions a {
margin: 0 10px;
color: #555;
}
@@ -0,0 +1,208 @@
if (typeof(PhpDebugBar) == 'undefined') {
// namespace
var PhpDebugBar = {};
PhpDebugBar.$ = jQuery;
}
(function($) {
var csscls = function(cls) {
return PhpDebugBar.utils.csscls(cls, 'phpdebugbar-openhandler-');
};
PhpDebugBar.OpenHandler = PhpDebugBar.Widget.extend({
className: 'phpdebugbar-openhandler',
defaults: {
items_per_page: 20
},
render: function() {
var self = this;
this.$el.appendTo('body').hide();
this.$closebtn = $('<a><i class="phpdebugbar-fa phpdebugbar-fa-times"></i></a>');
this.$table = $('<tbody />');
$('<div>PHP DebugBar | Open</div>').addClass(csscls('header')).append(this.$closebtn).appendTo(this.$el);
$('<table><thead><tr><th width="150">Date</th><th width="55">Method</th><th>URL</th><th width="125">IP</th><th width="100">Filter data</th></tr></thead></table>').append(this.$table).appendTo(this.$el);
this.$actions = $('<div />').addClass(csscls('actions')).appendTo(this.$el);
this.$closebtn.on('click', function() {
self.hide();
});
this.$loadmorebtn = $('<a>Load more</a>')
.appendTo(this.$actions)
.on('click', function() {
self.find(self.last_find_request, self.last_find_request.offset + self.get('items_per_page'), self.handleFind.bind(self));
});
this.$showonlycurrentbtn = $('<a>Show only current URL</a>')
.appendTo(this.$actions)
.on('click', function() {
self.$table.empty();
self.find({uri: window.location.pathname}, 0, self.handleFind.bind(self));
});
this.$showallbtn = $('<a>Show all</a>')
.appendTo(this.$actions)
.on('click', function() {
self.refresh();
});
this.$clearbtn = $('<a>Delete all</a>')
.appendTo(this.$actions)
.on('click', function() {
self.clear(function() {
self.hide();
});
});
this.addSearch();
this.$overlay = $('<div />').addClass(csscls('overlay')).hide().appendTo('body');
this.$overlay.on('click', function() {
self.hide();
});
},
refresh: function() {
this.$table.empty();
this.$loadmorebtn.show();
this.find({}, 0, this.handleFind.bind(this));
},
addSearch: function(){
var self = this;
var searchBtn = $('<button />')
.text('Search')
.attr('type', 'submit')
.on('click', function(e) {
self.$table.empty();
var search = {};
var a = $(this).parent().serializeArray();
$.each(a, function() {
if(this.value){
search[this.name] = this.value;
}
});
self.find(search, 0, self.handleFind.bind(self));
e.preventDefault();
});
$('<form />')
.append('<br/><b>Filter results</b><br/>')
.append('Method: <select name="method"><option></option><option>GET</option><option>POST</option><option>PUT</option><option>DELETE</option></select><br/>')
.append('Uri: <input type="text" name="uri"><br/>')
.append('IP: <input type="text" name="ip"><br/>')
.append(searchBtn)
.appendTo(this.$actions);
},
handleFind: function(data) {
var self = this;
$.each(data, function(i, meta) {
var a = $('<a />')
.text('Load dataset')
.on('click', function(e) {
self.hide();
self.load(meta['id'], function(data) {
self.callback(meta['id'], data);
});
e.preventDefault();
});
var method = $('<a />')
.text(meta['method'])
.on('click', function(e) {
self.$table.empty();
self.find({method: meta['method']}, 0, self.handleFind.bind(self));
e.preventDefault();
});
var uri = $('<a />')
.text(meta['uri'])
.on('click', function(e) {
self.hide();
self.load(meta['id'], function(data) {
self.callback(meta['id'], data);
});
e.preventDefault();
});
var ip = $('<a />')
.text(meta['ip'])
.on('click', function(e) {
self.$table.empty();
self.find({ip: meta['ip']}, 0, self.handleFind.bind(self));
e.preventDefault();
});
var search = $('<a />')
.text('Show URL')
.on('click', function(e) {
self.$table.empty();
self.find({uri: meta['uri']}, 0, self.handleFind.bind(self));
e.preventDefault();
});
$('<tr />')
.append('<td>' + meta['datetime'] + '</td>')
.append('<td>' + meta['method'] + '</td>')
.append($('<td />').append(uri))
.append($('<td />').append(ip))
.append($('<td />').append(search))
.appendTo(self.$table);
});
if (data.length < this.get('items_per_page')) {
this.$loadmorebtn.hide();
}
},
show: function(callback) {
this.callback = callback;
this.$el.show();
this.$overlay.show();
this.refresh();
},
hide: function() {
this.$el.hide();
this.$overlay.hide();
},
find: function(filters, offset, callback) {
var data = $.extend({}, filters, {max: this.get('items_per_page'), offset: offset || 0});
this.last_find_request = data;
this.ajax(data, callback);
},
load: function(id, callback) {
this.ajax({op: "get", id: id}, callback);
},
clear: function(callback) {
this.ajax({op: "clear"}, callback);
},
ajax: function(data, callback) {
var url = this.get('url');
if (data) {
url = url + '?' + new URLSearchParams(data);
}
fetch(url, {
method: "GET",
headers: {
"Accept": "application/json",
},
})
.then((data) => data.json())
.then(callback);
}
});
})(PhpDebugBar.$);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,82 @@
/*
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
*/
div.phpdebugbar pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em;
}
div.phpdebugbar code.hljs {
padding: 3px 5px;
}
div.phpdebugbar .hljs {
background: #f3f3f3;
color: #444;
}
div.phpdebugbar .hljs-comment {
color: #697070;
}
div.phpdebugbar .hljs-punctuation,
div.phpdebugbar .hljs-tag {
color: #444a;
}
div.phpdebugbar .hljs-tag .hljs-attr,
div.phpdebugbar .hljs-tag .hljs-name {
color: #444;
}
div.phpdebugbar .hljs-attribute,
div.phpdebugbar .hljs-doctag,
div.phpdebugbar .hljs-keyword,
div.phpdebugbar .hljs-meta .hljs-keyword,
div.phpdebugbar .hljs-name,
div.phpdebugbar .hljs-selector-tag {
font-weight: 700;
}
div.phpdebugbar .hljs-deletion,
div.phpdebugbar .hljs-number,
div.phpdebugbar .hljs-quote,
div.phpdebugbar .hljs-selector-class,
div.phpdebugbar .hljs-selector-id,
div.phpdebugbar .hljs-string,
div.phpdebugbar .hljs-template-tag,
div.phpdebugbar .hljs-type {
color: #800;
}
div.phpdebugbar .hljs-section,
div.phpdebugbar .hljs-title {
color: #800;
font-weight: 700;
}
div.phpdebugbar .hljs-link,
div.phpdebugbar .hljs-operator,
div.phpdebugbar .hljs-regexp,
div.phpdebugbar .hljs-selector-attr,
div.phpdebugbar .hljs-selector-pseudo,
div.phpdebugbar .hljs-symbol,
div.phpdebugbar .hljs-template-variable,
div.phpdebugbar .hljs-variable {
color: #ab5656;
}
div.phpdebugbar .hljs-literal {
color: #695;
}
div.phpdebugbar .hljs-addition,
div.phpdebugbar .hljs-built_in,
div.phpdebugbar .hljs-bullet,
div.phpdebugbar .hljs-code {
color: #397300;
}
div.phpdebugbar .hljs-meta {
color: #1f7199;
}
div.phpdebugbar .hljs-meta .hljs-string {
color: #38a;
}
div.phpdebugbar .hljs-emphasis {
font-style: italic;
}
div.phpdebugbar .hljs-strong {
font-weight: 700;
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,302 @@
pre.phpdebugbar-widgets-code-block {
white-space: pre;
word-wrap: normal;
overflow: hidden;
}
pre.phpdebugbar-widgets-code-block code {
display: block;
overflow-x: auto;
overflow-y: hidden;
}
pre.phpdebugbar-widgets-code-block code.phpdebugbar-widgets-numbered-code {
padding: 5px;
}
pre.phpdebugbar-widgets-code-block ul li.phpdebugbar-widgets-highlighted-line {
font-weight: bolder;
text-decoration: underline;
}
pre.phpdebugbar-widgets-code-block ul li.phpdebugbar-widgets-highlighted-line span {
position: absolute;
background: #800000;
min-width: calc(100% - 85px);
margin-left: 10px;
opacity: 0.15;
}
pre.phpdebugbar-widgets-code-block ul {
position: static;
float: left;
padding: 5px;
background: #cacaca;
border-right: 1px solid #aaa;
text-align: right;
}
.phpdebugbar-widgets-kvlist span.phpdebugbar-widgets-filename,
li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-filename {
display: block;
font-style: italic;
float: right;
margin-left: 8px;
color: #888;
}
a.phpdebugbar-widgets-editor-link:hover {
color: #aaaaaa;
}
a.phpdebugbar-widgets-editor-link:before {
font-family: PhpDebugbarFontAwesome;
margin-right: 4px;
font-size: 12px;
font-style: normal;
}
a.phpdebugbar-widgets-editor-link:before {
content: "\f08e";
margin-left: 4px;
}
/* -------------------------------------- */
ul.phpdebugbar-widgets-list {
margin: 0;
padding: 0;
list-style: none;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
ul.phpdebugbar-widgets-list li.phpdebugbar-widgets-list-item {
padding: 3px;
border-bottom: 1px solid #eee;
position: relative;
overflow: hidden;
}
ul.phpdebugbar-widgets-list li.phpdebugbar-widgets-list-item:hover {
background: #fafafa;
}
/* -------------------------------------- */
div.phpdebugbar-widgets-messages {
position: relative;
height: 100%;
}
div.phpdebugbar-widgets-messages ul.phpdebugbar-widgets-list {
padding-bottom: 45px;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value:before {
font-family: PhpDebugbarFontAwesome;
margin-right: 8px;
font-size: 11px;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-alert:before {
content: "\f0f3";
color: #cbcf38;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-debug:before {
content: "\f188";
color: #78d79a;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-warning:before,
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-emergency:before,
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-notice:before {
content: "\f071";
color: #ecb03d;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-error,
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-critical:before {
color: red;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-error:before,
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-critical:before {
content: "\f057";
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item pre.sf-dump {
display: inline;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-collector,
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-label {
float: right;
font-size: 12px;
padding: 2px 4px;
color: #888;
margin: 0 2px;
text-decoration: none;
text-shadow: none;
background: none;
font-weight: normal;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-collector {
color: #555;
font-style: italic;
}
div.phpdebugbar-widgets-messages div.phpdebugbar-widgets-toolbar {
position: fixed;
bottom: 0;
width: 100%;
background: #fff;
}
div.phpdebugbar-widgets-messages li .phpdebugbar-widgets-label-called-from {
float: right;
color: #666;
padding-left: 5px;
border-bottom: 1px dotted #666;
}
div.phpdebugbar-widgets-messages li .phpdebugbar-widgets-label-called-from:before {
content: "\f08d";
font-family: PhpDebugbarFontAwesome;
margin-right: 4px;
font-size: 12px;
}
div.phpdebugbar-widgets-messages div.phpdebugbar-widgets-toolbar input {
border: 0;
margin: 0;
margin-left: 7px;
width: 50%;
box-shadow: none;
}
div.phpdebugbar-widgets-messages div.phpdebugbar-widgets-toolbar input:focus {
outline: none;
}
div.phpdebugbar-widgets-messages div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter {
float: right;
font-size: 12px;
padding: 2px 4px;
background: #7cacd5;
margin: 0 2px;
border-radius: 4px;
color: #fff;
text-decoration: none;
}
div.phpdebugbar-widgets-messages div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter.phpdebugbar-widgets-excluded {
background: #eee;
color: #888;
}
/* -------------------------------------- */
dl.phpdebugbar-widgets-kvlist {
margin: 0;
}
dl.phpdebugbar-widgets-kvlist dt {
float: left;
width: 150px;
padding: 5px;
border-top: 1px solid #eee;
font-weight: bold;
clear: both;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
dl.phpdebugbar-widgets-kvlist dd {
margin-left: 160px;
padding: 5px;
border-top: 1px solid #eee;
cursor: pointer;
min-height: 17px;
}
/* -------------------------------------- */
dl.phpdebugbar-widgets-varlist,
dl.phpdebugbar-widgets-htmlvarlist {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
dl.phpdebugbar-widgets-htmlvarlist dd {
cursor: initial;
}
/* -------------------------------------- */
ul.phpdebugbar-widgets-timeline {
margin: 0;
padding: 0;
list-style: none;
}
ul.phpdebugbar-widgets-timeline .phpdebugbar-widgets-measure {
height: 20px;
position: relative;
border-bottom: 1px solid #eee;
display: block;
}
ul.phpdebugbar-widgets-timeline li:hover {
background: #fafafa;
}
ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-label,
ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-collector {
position: absolute;
font-size: 12px;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
color: #555;
top: 4px;
left: 5px;
background: none;
text-shadow: none;
font-weight: normal;
white-space: pre;
}
ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-collector {
left: initial;
right: 5px;
}
ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-value {
display: block;
position: absolute;
height: 10px;
background: #3db9ec;
top: 5px;
border-radius: 2px;
min-width: 1px;
}
ul.phpdebugbar-widgets-timeline 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;
}
ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params td {
border: 1px solid #ddd;
padding: 0 5px;
}
ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {
width: 20%;
font-weight: bold;
}
/* -------------------------------------- */
div.phpdebugbar-widgets-exceptions li.phpdebugbar-widgets-list-item {
cursor: pointer;
}
div.phpdebugbar-widgets-exceptions li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-message {
display: block;
color: red;
}
div.phpdebugbar-widgets-exceptions li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-type {
display: block;
position: absolute;
right: 4px;
top: 4px;
font-weight: bold;
}
div.phpdebugbar-widgets-exceptions li.phpdebugbar-widgets-list-item pre.phpdebugbar-widgets-file {
display: none;
margin: 10px;
padding: 5px;
border: 1px solid #ddd;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
div.phpdebugbar-widgets-exceptions li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-filename {
float: none;
}
ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params {
display: table;
border: 0;
width: 99%;
}
@@ -0,0 +1,853 @@
if (typeof(PhpDebugBar) == 'undefined') {
// namespace
var PhpDebugBar = {};
PhpDebugBar.$ = jQuery;
}
(function($) {
/**
* @namespace
*/
PhpDebugBar.Widgets = {};
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-');
/**
* Replaces spaces with &nbsp; and line breaks with <br>
*
* @param {String} text
* @return {String}
*/
var htmlize = PhpDebugBar.Widgets.htmlize = function(text) {
return text.replace(/\n/g, '<br>').replace(/\s/g, "&nbsp;")
};
/**
* Returns a string representation of value, using JSON.stringify
* if it's an object.
*
* @param {Object} value
* @param {Boolean} prettify Uses htmlize() if true
* @return {String}
*/
var renderValue = PhpDebugBar.Widgets.renderValue = function(value, prettify) {
if (typeof(value) !== 'string') {
if (prettify) {
return htmlize(JSON.stringify(value, undefined, 2));
}
return JSON.stringify(value);
}
return value;
};
/**
* Highlights a block of code
*
* @param {String} code
* @param {String} lang
* @return {String}
*/
var highlight = PhpDebugBar.Widgets.highlight = function(code, lang) {
if (typeof(code) === 'string') {
if (typeof(hljs) === 'undefined') {
return htmlize(code);
}
if (lang) {
return hljs.highlight(code, {language: lang}).value;
}
return hljs.highlightAuto(code).value;
}
if (typeof(hljs) === 'object') {
code.each(function(i, e) { hljs.highlightElement(e); });
}
return code;
};
/**
* Creates a <pre> element with a block of code
*
* @param {String} code
* @param {String} lang
* @param {Number} [firstLineNumber] If provided, shows line numbers beginning with the given value.
* @param {Number} [highlightedLine] If provided, the given line number will be highlighted.
* @return {String}
*/
var createCodeBlock = PhpDebugBar.Widgets.createCodeBlock = function(code, lang, firstLineNumber, highlightedLine) {
var pre = $('<pre />').addClass(csscls('code-block'));
// Add a newline to prevent <code> element from vertically collapsing too far if the last
// code line was empty: that creates problems with the horizontal scrollbar being
// incorrectly positioned - most noticeable when line numbers are shown.
var codeElement = $('<code />').text(code + '\n').appendTo(pre);
// Format the code
if (lang) {
codeElement.addClass("language-" + lang);
}
highlight(codeElement).removeClass('hljs');
// Show line numbers in a list
if (!isNaN(parseFloat(firstLineNumber))) {
var lineCount = code.split('\n').length;
var $lineNumbers = $('<ul />').prependTo(pre);
pre.children().addClass(csscls('numbered-code'));
for (var i = firstLineNumber; i < firstLineNumber + lineCount; i++) {
var li = $('<li />').text(i).appendTo($lineNumbers);
// Add a span with a special class if we are supposed to highlight a line.
if (highlightedLine === i) {
li.addClass(csscls('highlighted-line')).append('<span>&nbsp;</span>');
}
}
}
return pre;
};
var getDictValue = PhpDebugBar.utils.getDictValue = function(dict, key, default_value) {
var d = dict, parts = key.split('.');
for (var i = 0; i < parts.length; i++) {
if (!d[parts[i]]) {
return default_value;
}
d = d[parts[i]];
}
return d;
}
// ------------------------------------------------------------------
// Generic widgets
// ------------------------------------------------------------------
/**
* Displays array element in a <ul> list
*
* Options:
* - data
* - itemRenderer: a function used to render list items (optional)
*/
var ListWidget = PhpDebugBar.Widgets.ListWidget = PhpDebugBar.Widget.extend({
tagName: 'ul',
className: csscls('list'),
initialize: function(options) {
if (!options['itemRenderer']) {
options['itemRenderer'] = this.itemRenderer;
}
this.set(options);
},
render: function() {
this.bindAttr(['itemRenderer', 'data'], function() {
this.$el.empty();
if (!this.has('data')) {
return;
}
var data = this.get('data');
for (var i = 0; i < data.length; i++) {
var li = $('<li />').addClass(csscls('list-item')).appendTo(this.$el);
this.get('itemRenderer')(li, data[i]);
}
});
},
/**
* Renders the content of a <li> element
*
* @param {jQuery} li The <li> element as a jQuery Object
* @param {Object} value An item from the data array
*/
itemRenderer: function(li, value) {
li.html(renderValue(value));
}
});
// ------------------------------------------------------------------
/**
* Displays object property/value paris in a <dl> list
*
* Options:
* - data
* - itemRenderer: a function used to render list items (optional)
*/
var KVListWidget = PhpDebugBar.Widgets.KVListWidget = ListWidget.extend({
tagName: 'dl',
className: csscls('kvlist'),
render: function() {
this.bindAttr(['itemRenderer', 'data'], function() {
this.$el.empty();
if (!this.has('data')) {
return;
}
var self = this;
$.each(this.get('data'), function(key, value) {
var dt = $('<dt />').addClass(csscls('key')).appendTo(self.$el);
var dd = $('<dd />').addClass(csscls('value')).appendTo(self.$el);
self.get('itemRenderer')(dt, dd, key, value);
});
});
},
/**
* Renders the content of the <dt> and <dd> elements
*
* @param {jQuery} dt The <dt> element as a jQuery Object
* @param {jQuery} dd The <dd> element as a jQuery Object
* @param {String} key Property name
* @param {Object} value Property value
*/
itemRenderer: function(dt, dd, key, value) {
dt.text(key);
dd.html(htmlize(value));
}
});
// ------------------------------------------------------------------
/**
* An extension of KVListWidget where the data represents a list
* of variables
*
* Options:
* - data
*/
var VariableListWidget = PhpDebugBar.Widgets.VariableListWidget = KVListWidget.extend({
className: csscls('kvlist varlist'),
itemRenderer: function(dt, dd, key, value) {
$('<span />').attr('title', key).text(key).appendTo(dt);
var v = value && value.value || value;
if (v && v.length > 100) {
v = v.substr(0, 100) + "...";
}
var prettyVal = null;
dd.text(v).click(function() {
if (dd.hasClass(csscls('pretty'))) {
dd.text(v).removeClass(csscls('pretty'));
} else {
prettyVal = prettyVal || createCodeBlock(value);
dd.addClass(csscls('pretty')).empty().append(prettyVal);
}
});
}
});
// ------------------------------------------------------------------
/**
* An extension of KVListWidget where the data represents a list
* of variables whose contents are HTML; this is useful for showing
* variable output from VarDumper's HtmlDumper.
*
* Options:
* - data
*/
var HtmlVariableListWidget = PhpDebugBar.Widgets.HtmlVariableListWidget = KVListWidget.extend({
className: csscls('kvlist htmlvarlist'),
itemRenderer: function(dt, dd, key, value) {
$('<span />').attr('title', $('<i />').html(key || '').text()).html(key || '').appendTo(dt);
dd.html(value && value.value || value);
if (value && value.xdebug_link) {
var header = $('<span />').addClass(csscls('filename')).text(value.xdebug_link.filename + ( value.xdebug_link.line ? "#" + value.xdebug_link.line : ''));
if (value.xdebug_link) {
if (value.xdebug_link.ajax) {
$('<a title="' + value.xdebug_link.url + '"></a>').on('click', function () {
$.ajax(value.xdebug_link.url);
}).addClass(csscls('editor-link')).appendTo(header);
} else {
$('<a href="' + value.xdebug_link.url + '"></a>').addClass(csscls('editor-link')).appendTo(header);
}
}
header.appendTo(dd);
}
}
});
// ------------------------------------------------------------------
/**
* Iframe widget
*
* Options:
* - data
*/
var IFrameWidget = PhpDebugBar.Widgets.IFrameWidget = PhpDebugBar.Widget.extend({
tagName: 'iframe',
className: csscls('iframe'),
render: function() {
this.$el.attr({
seamless: "seamless",
border: "0",
width: "100%",
height: "100%"
});
this.bindAttr('data', function(url) { this.$el.attr('src', url); });
}
});
// ------------------------------------------------------------------
// Collector specific widgets
// ------------------------------------------------------------------
/**
* Widget for the MessagesCollector
*
* Uses ListWidget under the hood
*
* Options:
* - data
*/
var MessagesWidget = PhpDebugBar.Widgets.MessagesWidget = PhpDebugBar.Widget.extend({
className: csscls('messages'),
render: function() {
var self = this;
this.$list = new ListWidget({ itemRenderer: function(li, value) {
if (value.message_html) {
var val = $('<span />').addClass(csscls('value')).html(value.message_html).appendTo(li);
} else {
var m = value.message;
if (m.length > 100) {
m = m.substr(0, 100) + "...";
}
var val = $('<span />').addClass(csscls('value')).text(m).appendTo(li);
if (!value.is_string || value.message.length > 100) {
var prettyVal = value.message;
if (!value.is_string) {
prettyVal = null;
}
li.css('cursor', 'pointer').click(function () {
if (window.getSelection().type == "Range") {
return''
}
if (val.hasClass(csscls('pretty'))) {
val.text(m).removeClass(csscls('pretty'));
} else {
prettyVal = prettyVal || createCodeBlock(value.message, 'php');
val.addClass(csscls('pretty')).empty().append(prettyVal);
}
});
}
}
if (value.xdebug_link) {
var header = $('<span />').addClass(csscls('filename')).text(value.xdebug_link.filename + ( value.xdebug_link.line ? "#" + value.xdebug_link.line : ''));
if (value.xdebug_link) {
if (value.xdebug_link.ajax) {
$('<a title="' + value.xdebug_link.url + '"></a>').on('click', function () {
$.ajax(value.xdebug_link.url);
}).addClass(csscls('editor-link')).appendTo(header);
} else {
$('<a href="' + value.xdebug_link.url + '"></a>').addClass(csscls('editor-link')).appendTo(header);
}
}
header.appendTo(li);
}
if (value.collector) {
$('<span />').addClass(csscls('collector')).text(value.collector).prependTo(li);
}
if (value.label) {
val.addClass(csscls(value.label));
$('<span />').addClass(csscls('label')).text(value.label).prependTo(li);
}
}});
this.$list.$el.appendTo(this.$el);
this.$toolbar = $('<div><i class="phpdebugbar-fa phpdebugbar-fa-search"></i></div>').addClass(csscls('toolbar')).appendTo(this.$el);
$('<input type="text" name="search" aria-label="Search" placeholder="Search" />')
.on('change', function() { self.set('search', this.value); })
.appendTo(this.$toolbar);
this.bindAttr('data', function(data) {
this.set({excludelabel: [], excludecollector: [], search: ''});
this.$toolbar.find(csscls('.filter')).remove();
var labels = [], collectors = [], self = this,
createFilterItem = function (type, value) {
$('<a />')
.addClass(csscls('filter')).addClass(csscls(type))
.text(value).attr('rel', value)
.on('click', function() { self.onFilterClick(this, type); })
.appendTo(self.$toolbar)
};
data.forEach(function (item) {
if (!labels.includes(item.label || 'none')) {
labels.push(item.label || 'none');
}
if (!collectors.includes(item.collector || 'none')) {
collectors.push(item.collector || 'none');
}
});
if (labels.length > 1) {
labels.forEach(label => createFilterItem('label', label));
}
if (collectors.length === 1) {
return;
}
$('<a />').addClass(csscls('filter')).css('visibility', 'hidden').appendTo(self.$toolbar);
collectors.forEach(collector => createFilterItem('collector', collector));
});
this.bindAttr(['excludelabel', 'excludecollector', 'search'], function() {
var excludelabel = this.get('excludelabel') || [],
excludecollector = this.get('excludecollector') || [],
search = this.get('search'),
caseless = false,
fdata = [];
if (search && search === search.toLowerCase()) {
caseless = true;
}
this.get('data').forEach(function (item) {
var message = caseless ? item.message.toLowerCase() : item.message;
if (
!excludelabel.includes(item.label || undefined) &&
!excludecollector.includes(item.collector || undefined) &&
(!search || message.indexOf(search) > -1)
) {
fdata.push(item);
}
});
this.$list.set('data', fdata);
});
},
onFilterClick: function(el, type) {
$(el).toggleClass(csscls('excluded'));
var excluded = [];
this.$toolbar.find(csscls('.filter') + csscls('.excluded') + csscls('.' + type)).each(function() {
excluded.push(this.rel === 'none' || !this.rel ? undefined : this.rel);
});
this.set('exclude' + type, excluded);
}
});
// ------------------------------------------------------------------
/**
* Widget for the TimeDataCollector
*
* Options:
* - data
*/
var TimelineWidget = PhpDebugBar.Widgets.TimelineWidget = PhpDebugBar.Widget.extend({
tagName: 'ul',
className: csscls('timeline'),
render: function() {
this.bindAttr('data', function(data) {
// ported from php DataFormatter
var formatDuration = function(seconds) {
if (seconds < 0.001)
return (seconds * 1000000).toFixed() + 'μs';
else if (seconds < 0.1)
return (seconds * 1000).toFixed(2) + 'ms';
else if (seconds < 1)
return (seconds * 1000).toFixed() + 'ms';
return (seconds).toFixed(2) + 's';
};
// ported from php DataFormatter
var formatBytes = function formatBytes(size) {
if (size === 0 || size === null) {
return '0B';
}
var sign = size < 0 ? '-' : '',
size = Math.abs(size),
base = Math.log(size) / Math.log(1024),
suffixes = ['B', 'KB', 'MB', 'GB', 'TB'];
return sign + (Math.round(Math.pow(1024, base - Math.floor(base)) * 100) / 100) + suffixes[Math.floor(base)];
}
this.$el.empty();
if (data.measures) {
var aggregate = {};
for (var i = 0; i < data.measures.length; i++) {
var measure = data.measures[i];
if(!aggregate[measure.label])
aggregate[measure.label] = { count: 0, duration: 0, memory : 0 };
aggregate[measure.label]['count'] += 1;
aggregate[measure.label]['duration'] += measure.duration;
aggregate[measure.label]['memory'] += (measure.memory || 0);
var m = $('<div />').addClass(csscls('measure')),
li = $('<li />'),
left = (measure.relative_start * 100 / data.duration).toFixed(2),
width = Math.min((measure.duration * 100 / data.duration).toFixed(2), 100 - left);
m.append($('<span />').addClass(csscls('value')).css({
left: left + "%",
width: width + "%"
}));
m.append($('<span />').addClass(csscls('label'))
.text(measure.label + " (" + measure.duration_str +(measure.memory ? '/' + measure.memory_str: '') + ")"));
if (measure.collector) {
$('<span />').addClass(csscls('collector')).text(measure.collector).appendTo(m);
}
m.appendTo(li);
this.$el.append(li);
if (measure.params && !$.isEmptyObject(measure.params)) {
var table = $('<table><tr><th colspan="2">Params</th></tr></table>').hide().addClass(csscls('params')).appendTo(li);
for (var key in measure.params) {
if (typeof measure.params[key] !== 'function') {
table.append('<tr><td class="' + csscls('name') + '">' + key + '</td><td class="' + csscls('value') +
'"><pre><code>' + measure.params[key] + '</code></pre></td></tr>');
}
}
li.css('cursor', 'pointer').click(function() {
if (window.getSelection().type == "Range") {
return''
}
var table = $(this).find('table');
if (table.is(':visible')) {
table.hide();
} else {
table.show();
}
});
}
}
// convert to array and sort by duration
aggregate = $.map(aggregate, function(data, label) {
return {
label: label,
data: data
}
}).sort(function(a, b) {
return b.data.duration - a.data.duration
});
// build table and add
var aggregateTable = $('<table></table>').addClass(csscls('params'));
$.each(aggregate, function(i, aggregate) {
width = Math.min((aggregate.data.duration * 100 / data.duration).toFixed(2), 100);
aggregateTable.append('<tr><td class="' + csscls('name') + '">' +
aggregate.data.count + ' x ' + $('<i />').text(aggregate.label).html() + ' (' + width + '%)</td><td class="' + csscls('value') + '">' +
'<div class="' + csscls('measure') +'">' +
'<span class="' + csscls('value') + '"></span>' +
'<span class="' + csscls('label') + '">' + formatDuration(aggregate.data.duration) + (aggregate.data.memory ? '/' + formatBytes(aggregate.data.memory) : '') + '</span>' +
'</div></td></tr>');
aggregateTable.find('span.' + csscls('value') + ':last').css({width: width + "%" });
});
this.$el.append('<li/>').find('li:last').append(aggregateTable);
}
});
}
});
// ------------------------------------------------------------------
/**
* Widget for the displaying exceptions
*
* Options:
* - data
*/
var ExceptionsWidget = PhpDebugBar.Widgets.ExceptionsWidget = PhpDebugBar.Widget.extend({
className: csscls('exceptions'),
render: function() {
this.$list = new ListWidget({ itemRenderer: function(li, e) {
$('<span />').addClass(csscls('message')).text(e.message).appendTo(li);
if (e.file) {
var header = $('<span />').addClass(csscls('filename')).text(e.file + "#" + e.line);
if (e.xdebug_link) {
if (e.xdebug_link.ajax) {
$('<a title="' + e.xdebug_link.url + '"></a>').on('click', function () {
fetch(e.xdebug_link.url);
}).addClass(csscls('editor-link')).appendTo(header);
} else {
$('<a href="' + e.xdebug_link.url + '"></a>').addClass(csscls('editor-link')).appendTo(header);
}
}
header.appendTo(li);
}
if (e.type) {
$('<span />').addClass(csscls('type')).text(e.type).appendTo(li);
}
if (e.surrounding_lines) {
var startLine = (e.line - 3) <= 0 ? 1 : e.line - 3;
var pre = createCodeBlock(e.surrounding_lines.join(""), 'php', startLine, e.line).addClass(csscls('file')).appendTo(li);
if (!e.stack_trace_html) {
// This click event makes the var-dumper hard to use.
li.click(function () {
if (pre.is(':visible')) {
pre.hide();
} else {
pre.show();
}
});
}
}
if (e.stack_trace_html) {
var $trace = $('<span />').addClass(csscls('filename')).html(e.stack_trace_html);
$trace.appendTo(li);
} else if (e.stack_trace) {
e.stack_trace.split("\n").forEach(function (trace) {
var $traceLine = $('<div />');
$('<span />').addClass(csscls('filename')).text(trace).appendTo($traceLine);
$traceLine.appendTo(li);
});
}
}});
this.$list.$el.appendTo(this.$el);
this.bindAttr('data', function(data) {
this.$list.set('data', data);
if (data.length == 1) {
this.$list.$el.children().first().find(csscls('.file')).show();
}
});
}
});
/**
* Displays datasets in a table
*
*/
var DatasetWidget = PhpDebugBar.Widgets.DatasetWidget = PhpDebugBar.Widget.extend({
initialize: function(options) {
if (!options['itemRenderer']) {
options['itemRenderer'] = this.itemRenderer;
}
this.set(options);
this.set('autoshow', null);
this.set('id', null);
this.set('sort', localStorage.getItem('debugbar-history-sort') || 'asc');
this.$el.addClass(csscls('dataset-history'))
this.renderHead();
},
renderHead: function() {
this.$el.empty();
this.$actions = $('<div />').addClass(csscls('dataset-actions')).appendTo(this.$el);
var self = this;
this.$autoshow = $('<input type=checkbox>')
.on('click', function() {
if (self.get('debugbar').ajaxHandler) {
self.get('debugbar').ajaxHandler.setAutoShow($(this).is(':checked'));
}
});
$('<label>Autoshow</label>')
.append(this.$autoshow)
.appendTo(this.$actions)
this.$clearbtn = $('<a>Clear</a>')
.appendTo(this.$actions)
.on('click', function() {
self.$table.empty();
});
this.$showBtn = $('<a>Show all</a>')
.appendTo(this.$actions)
.on('click', function() {
self.searchInput.val(null);
self.methodInput.val(null);
self.set('search', null);
self.set('method', null);
});
this.methodInput = $('<select name="method" style="width:100px"><option>(method)</option><option>GET</option><option>POST</option><option>PUT</option><option>DELETE</option></select>')
.on('change', function() { self.set('method', this.value)})
.appendTo(this.$actions)
this.searchInput = $('<input type="text" name="search" aria-label="Search" placeholder="Search" />')
.on('input', function() { self.set('search', this.value); })
.appendTo(this.$actions);
this.$table = $('<tbody />');
$('<table/>')
.append($('<thead/>')
.append($('<tr/>')
.append($('<th></th>').css('width', '30px'))
.append($('<th>Date ↕</th>').css('width', '175px').click(function() {
self.set('sort', self.get('sort') === 'asc' ? 'desc' : 'asc')
localStorage.setItem('debugbar-history-sort', self.get('sort'))
}))
.append($('<th>Method</th>').css('width', '80px'))
.append($('<th>URL</th>'))
.append($('<th width="40%">Data</th>')))
)
.append(this.$table)
.appendTo(this.$el);
},
renderDatasets: function() {
this.$table.empty();
var self = this;
$.each(this.get('data'), function(key, data) {
if (!data.__meta) {
return;
}
self.get('itemRenderer')(self, data);
});
},
render: function() {
this.bindAttr('data', function() {
if (this.get('autoshow') === null && this.get('debugbar').ajaxHandler) {
this.set('autoshow', this.get('debugbar').ajaxHandler.autoShow);
}
if (!this.has('data')) {
return;
}
// Render the latest item
var datasets = this.get('data');
var data = datasets[Object.keys(datasets)[Object.keys(datasets).length - 1]]
if (!data.__meta) {
return;
}
this.get('itemRenderer')(this, data);
});
this.bindAttr(['itemRenderer', 'search', 'method', 'sort'], function() {
this.renderDatasets();
})
this.bindAttr('autoshow', function() {
var autoshow = this.get('autoshow');
this.$autoshow.prop('checked', autoshow);
})
this.bindAttr('id', function() {
var id = this.get('id');
this.$table.find('.' + csscls('active')).removeClass(csscls('active'));
this.$table.find('tr[data-id=' + id+']').addClass(csscls('active'));
})
},
/**
* Renders the content of a dataset item
*
* @param {Object} value An item from the data array
*/
itemRenderer: function(widget, data) {
var meta = data.__meta;
var $badges = $('<td />');
var tr = $('<tr />');
if (widget.get('sort') === 'asc') {
tr.appendTo(widget.$table);
} else {
tr.prependTo(widget.$table);
}
var clickHandler = function() {
var debugbar = widget.get('debugbar');
debugbar.showDataSet(meta.id, debugbar.datesetTitleFormater.format('', data, meta.suffix, meta.nb));
widget.$table.find('.' + csscls('active')).removeClass(csscls('active'));
tr.addClass(csscls('active'));
if ($(this).data('tab')) {
debugbar.showTab($(this).data('tab'));
}
}
tr.attr('data-id', meta['id'])
.append($('<td>#' + meta['nb'] + '</td>').click(clickHandler))
.append($('<td>' + meta['datetime'] + '</td>').click(clickHandler))
.append($('<td>' + meta['method'] + '</td>').click(clickHandler))
.append($('<td />').append(meta['uri'] + (meta['suffix'] ? ' ' + meta['suffix'] : '')).click(clickHandler))
.css('cursor', 'pointer')
.addClass(csscls('table-row'))
var debugbar = widget.get('debugbar');
$.each(debugbar.dataMap, function(key, def) {
var d = getDictValue(data, def[0], def[1]);
if (key.indexOf(':') != -1) {
key = key.split(':');
if (key[1] === 'badge' && d > 0) {
var control = debugbar.getControl(key[0]);
var $a = $('<a>').attr('title', control.get('title')).data('tab', key[0]);
if (control.$icon) {
$a.append(debugbar.getControl(key[0]).$icon.clone());
}
if (control.$badge) {
$a.append(debugbar.getControl(key[0]).$badge.clone().css('display', 'inline-block').text(d));
}
$a.appendTo($badges).click(clickHandler);
}
}
});
tr.append($badges);
if (debugbar.activeDatasetId === meta['id']) {
tr.addClass(csscls('active'));
}
var search = widget.get('search');
var method = widget.get('method');
if ((search && meta['uri'].indexOf(search) == -1) || (method && meta['method'] !== method)) {
tr.hide();
}
}
});
})(PhpDebugBar.$);
@@ -0,0 +1,12 @@
div.phpdebugbar-widgets-mails span.phpdebugbar-widgets-subject {
display: block;
}
div.phpdebugbar-widgets-mails li.phpdebugbar-widgets-list-item pre.phpdebugbar-widgets-headers {
display: none;
margin: 10px;
padding: 5px;
border: 1px solid #ddd;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
@@ -0,0 +1,63 @@
(function($) {
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-');
/**
* Widget for the displaying mails data
*
* Options:
* - data
*/
var MailsWidget = PhpDebugBar.Widgets.MailsWidget = PhpDebugBar.Widget.extend({
className: csscls('mails'),
render: function() {
this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, mail) {
$('<span />').addClass(csscls('subject')).text(mail.subject).appendTo(li);
$('<span />').addClass(csscls('to')).text(mail.to).appendTo(li);
if (mail.body || mail.html) {
var header = $('<span />').addClass(csscls('filename')).text('');
$('<a title="Mail Preview">View Mail</a>').on('click', function () {
var popup = window.open('about:blank', 'Mail Preview', 'width=650,height=440,scrollbars=yes');
var documentToWriteTo = popup.document;
var headers = !mail.headers ? '' : $('<pre style="border: 1px solid #ddd; padding: 5px;" />')
.append($('<code />').text(mail.headers));
var body = $('<pre style="border: 1px solid #ddd; padding: 5px;" />').text(mail.body)
var html = null;
if (mail.html) {
body = $('<details />').append($('<summary>Text version</summary>')).append(body);
html = $('<iframe width="100%" height="400px" sandbox="" referrerpolicy="no-referrer"/>').attr("srcdoc", mail.html)
}
documentToWriteTo.open();
documentToWriteTo.write(headers.prop('outerHTML') + body.prop('outerHTML') + (html ? html.prop('outerHTML') : ''));
documentToWriteTo.close();
}).addClass(csscls('editor-link')).appendTo(header);
header.appendTo(li);
}
if (mail.headers) {
var headers = $('<pre />').addClass(csscls('headers')).appendTo(li);
$('<code />').text(mail.headers).appendTo(headers);
li.click(function() {
if (headers.is(':visible')) {
headers.hide();
} else {
headers.show();
}
});
}
}});
this.$list.$el.appendTo(this.$el);
this.bindAttr('data', function(data) {
this.$list.set('data', data);
});
}
});
})(PhpDebugBar.$);
@@ -0,0 +1,153 @@
div.phpdebugbar-widgets-sqlqueries .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-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-error {
color: red;
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-database,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id {
float: right;
margin-left: 8px;
color: #888;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-database,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-duration,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-memory,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-row-count,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-copy-clipboard,
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-status span.phpdebugbar-widgets-stmt-id {
color: #555;
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-database:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard:before,
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before,
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:before {
font-family: PhpDebugbarFontAwesome;
margin-right: 4px;
font-size: 12px;
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-database:before {
content: "\f1c0";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration:before {
content: "\f017";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory:before {
content: "\f085";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count:before {
content: "\f0ce";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before {
content: "\f08d";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard:before {
content: "\f0c5";
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:before {
content: "\f08e";
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link {
color: #888;
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:hover {
color: #aaaaaa;
}
div.phpdebugbar-widgets-sqlqueries 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-sqlqueries table.phpdebugbar-widgets-params td {
border: 1px solid #ddd;
text-align: center;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {
width: 20%;
font-weight: bold;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-error {
display: block;
font-weight: bold;
}
code.phpdebugbar-widgets-sql {
white-space: pre-wrap;
overflow-wrap: break-word;
word-wrap: break-word;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate {
background-color: #edeff0;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate:hover {
background-color: #ffc;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar {
display:none;
position: fixed;
bottom: 0;
width: calc(100% - 30px);
margin-bottom: 5px;
z-index: 1;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter {
float: right;
font-size: 12px;
padding: 2px 4px;
background: #7cacd5;
margin: 0 2px;
border-radius: 4px;
color: #fff;
text-decoration: none;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter.phpdebugbar-widgets-excluded {
background: #eee;
color: #888;
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-duplicates {
font-weight: bold;
text-decoration: underline;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item div.phpdebugbar-widgets-bg-measure {
position: absolute;
top: 0;
width: 100%;
height: 100%;
overflow: hidden;
pointer-events: none;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-bg-measure div.phpdebugbar-widgets-value {
position: absolute;
height: 100%;
opacity: 0.2;
background: red;
}
div.phpdebugbar-widgets-sqlqueries td.phpdebugbar-widgets-value li.phpdebugbar-widgets-table-list-item {
text-align: left;
padding-left: 6px;
}
div.phpdebugbar-widgets-sqlqueries .phpdebugbar-text-muted {
color: #888;
}
@@ -0,0 +1,236 @@
(function($) {
var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-');
/**
* Widget for the displaying sql queries
*
* Options:
* - data
*/
var SQLQueriesWidget = PhpDebugBar.Widgets.SQLQueriesWidget = PhpDebugBar.Widget.extend({
className: csscls('sqlqueries'),
onFilterClick: function(el) {
$(el).toggleClass(csscls('excluded'));
this.$list.$el.find("li[connection=" + $(el).attr("rel") + "]").toggle();
},
onCopyToClipboard: function (el) {
var code = $(el).parent('li').find('code').get(0);
var copy = function () {
try {
document.execCommand('copy');
alert('Query copied to the clipboard');
} catch (err) {
console.log('Oops, unable to copy');
}
};
var select = function (node) {
if (document.selection) {
var range = document.body.createTextRange();
range.moveToElementText(node);
range.select();
} else if (window.getSelection) {
var range = document.createRange();
range.selectNodeContents(node);
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
}
copy();
window.getSelection().removeAllRanges();
};
select(code);
},
renderList: function (caption, icon, data) {
var $ul = $('<ul />').addClass(csscls('table-list')), $parts;
var $li = $('<li />').addClass(csscls('table-list-item'));
var $span = $('<span />').addClass('phpdebugbar-text-muted');
for (var key in data) {
var value = typeof data[key] === 'function' ? data[key].name + ' {}' : data[key];
$li.clone().append(typeof value === 'object' && value !== null
? [$span.clone().text(value.index || key).append('.'), '&nbsp;']
.concat(value.namespace ? [value.namespace + '::'] : [])
.concat([value.name || value.file])
.concat(value.line ? [$span.clone().text(':' + value.line)] : [])
: [$span.clone().text(key + ':'), '&nbsp;', value]
).appendTo($ul);
}
caption += icon ? ' <i class="phpdebugbar-fa phpdebugbar-fa-' + icon + ' phpdebugbar-text-muted"></i>' : '';
return $('<tr />').append(
$('<td />').addClass(csscls('name')).html(caption),
$('<td />').addClass(csscls('value')).append($ul)
);
},
render: function() {
this.$status = $('<div />').addClass(csscls('status')).appendTo(this.$el);
this.$toolbar = $('<div />').addClass(csscls('toolbar')).appendTo(this.$el);
var filters = [], self = this;
this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, stmt) {
if (stmt.type === 'transaction') {
$('<strong />').addClass(csscls('sql')).addClass(csscls('name')).text(stmt.sql).appendTo(li);
} else {
$('<code />').addClass(csscls('sql')).html(PhpDebugBar.Widgets.highlight(stmt.sql, 'sql')).appendTo(li);
}
if (stmt.width_percent) {
$('<div />').addClass(csscls('bg-measure')).append(
$('<div />').addClass(csscls('value')).css({
left: stmt.start_percent + '%',
width: Math.max(stmt.width_percent, 0.01) + '%',
})
).appendTo(li);
}
if (stmt.duration_str) {
$('<span title="Duration" />').addClass(csscls('duration')).text(stmt.duration_str).appendTo(li);
}
if (stmt.memory_str) {
$('<span title="Memory usage" />').addClass(csscls('memory')).text(stmt.memory_str).appendTo(li);
}
if (typeof(stmt.row_count) != 'undefined') {
$('<span title="Row count" />').addClass(csscls('row-count')).text(stmt.row_count).appendTo(li);
}
if (typeof(stmt.stmt_id) != 'undefined' && stmt.stmt_id) {
$('<span title="Prepared statement ID" />').addClass(csscls('stmt-id')).text(stmt.stmt_id).appendTo(li);
}
if (stmt.connection) {
$('<span title="Connection" />').addClass(csscls('database')).text(stmt.connection).appendTo(li);
li.attr("connection",stmt.connection);
if ( $.inArray(stmt.connection, filters) == -1 ) {
filters.push(stmt.connection);
$('<a />')
.addClass(csscls('filter'))
.text(stmt.connection)
.attr('rel', stmt.connection)
.on('click', function() { self.onFilterClick(this); })
.appendTo(self.$toolbar);
if (filters.length>1) {
self.$toolbar.show();
self.$list.$el.css("margin-bottom","20px");
}
}
}
if (typeof(stmt.is_success) != 'undefined' && !stmt.is_success) {
li.addClass(csscls('error'));
li.append($('<span />').addClass(csscls('error')).text("[" + stmt.error_code + "] " + stmt.error_message));
}
if ((!stmt.type || stmt.type === 'query') && stmt.show_copy !== false) {
$('<span title="Copy to clipboard" />')
.addClass(csscls('copy-clipboard'))
.css('cursor', 'pointer')
.on('click', function (event) {
self.onCopyToClipboard(this);
event.stopPropagation();
})
.appendTo(li);
}
if (typeof(stmt.xdebug_link) !== 'undefined' && stmt.xdebug_link) {
var header = $('<span title="Filename" />').addClass(csscls('filename')).text(stmt.xdebug_link.filename + ( stmt.xdebug_link.line ? "#" + stmt.xdebug_link.line : ''));
if (stmt.xdebug_link.ajax) {
$('<a title="' + stmt.xdebug_link.url + '"></a>').on('click', function () {
fetch(stmt.xdebug_link.url);
}).addClass(csscls('editor-link')).appendTo(header);
} else {
$('<a href="' + stmt.xdebug_link.url + '"></a>').addClass(csscls('editor-link')).appendTo(header);
}
header.appendTo(li);
}
var table = $('<table></table>').addClass(csscls('params'));
if (stmt.params && !$.isEmptyObject(stmt.params)) {
self.renderList('Params', 'thumb-tack', stmt.params).appendTo(table);
}
if (stmt.bindings && !$.isEmptyObject(stmt.bindings)) {
self.renderList('Bindings', 'thumb-tack', stmt.bindings).appendTo(table);
}
if (stmt.hints && !$.isEmptyObject(stmt.hints)) {
self.renderList('Hints', 'question-circle', stmt.hints).appendTo(table);
}
if (stmt.backtrace && !$.isEmptyObject(stmt.backtrace)) {
self.renderList('Backtrace', 'list-ul', stmt.backtrace).appendTo(table);
}
if (table.find('tr').length) {
table.appendTo(li);
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.bindAttr('data', function(data) {
// the PDO collector maybe is empty
if (data.length <= 0 || !data.statements) {
return false;
}
filters = [];
this.$toolbar.hide().find(csscls('.filter')).remove();
this.$list.set('data', data.statements);
this.$status.empty();
// Search for duplicate statements.
for (var sql = {}, duplicate = 0, i = 0; i < data.statements.length; i++) {
if (data.statements[i].type && data.statements[i].type !== 'query') {
continue;
}
var stmt = data.statements[i].sql;
if (data.statements[i].params && !$.isEmptyObject(data.statements[i].params)) {
stmt += JSON.stringify(data.statements[i].params);
}
if (data.statements[i].bindings && !$.isEmptyObject(data.statements[i].bindings)) {
stmt += JSON.stringify(data.statements[i].bindings);
}
if (data.statements[i].connection) {
stmt += '@' + data.statements[i].connection;
}
sql[stmt] = sql[stmt] || { keys: [] };
sql[stmt].keys.push(i);
}
// Add classes to all duplicate SQL statements.
for (var stmt in sql) {
if (sql[stmt].keys.length > 1) {
duplicate += sql[stmt].keys.length;
for (var i = 0; i < sql[stmt].keys.length; i++) {
this.$list.$el.find('.' + csscls('list-item')).eq(sql[stmt].keys[i])
.addClass(csscls('sql-duplicate'));
}
}
}
var t = $('<span />').text(data.nb_statements + " statements were executed").appendTo(this.$status);
if (data.nb_failed_statements) {
t.append(", " + data.nb_failed_statements + " of which failed");
}
if (duplicate) {
t.append(", " + duplicate + " of which were duplicates");
t.append(", " + (data.nb_statements - duplicate) + " unique. ");
// add toggler for displaying only duplicated queries
var duplicatedText = 'Show only duplicated';
$('<a />').addClass(csscls('duplicates')).click(function () {
$(this).toggleClass('shown-duplicated')
.text($(this).hasClass('shown-duplicated') ? 'Show All' : duplicatedText);
$('.' + self.className + ' .' + csscls('list-item'))
.not('.' + csscls('sql-duplicate')).toggle();
}).text(duplicatedText).appendTo(t);
}
if (data.accumulated_duration_str) {
this.$status.append($('<span title="Accumulated duration" />').addClass(csscls('duration')).text(data.accumulated_duration_str));
}
if (data.memory_usage_str) {
this.$status.append($('<span title="Memory usage" />').addClass(csscls('memory')).text(data.memory_usage_str));
}
});
}
});
})(PhpDebugBar.$);
@@ -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;
}
@@ -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.$);