This commit is contained in:
AlexBa16
2026-06-08 15:29:52 +02:00
commit 27903eed4a
9931 changed files with 1535659 additions and 0 deletions
+593
View File
@@ -0,0 +1,593 @@
@charset "UTF-8";
@media print {
div.phpdebugbar {
display: none;
}
}
div.phpdebugbar, div.phpdebugbar-openhandler {
--debugbar-background: #fff;
--debugbar-background-alt: #fafafa;
--debugbar-text: #222;
--debugbar-text-muted: #888;
--debugbar-border: #eee;
--debugbar-header: #efefef;
--debugbar-header-text: #555;
--debugbar-header-border: #ddd;
--debugbar-active: #ccc;
--debugbar-active-text: #666;
--debugbar-icons: #555;
--debugbar-badge: #ccc;
--debugbar-badge-text: #555;
--debugbar-badge-active: #555;
--debugbar-badge-active-text: #fff;
--debugbar-link: #888;
--debugbar-hover: #aaa;
--debugbar-accent: #6bb7d8;
--debugbar-accent-border: #477e96;
--debugbar-font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--debugbar-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
div.phpdebugbar[data-theme="dark"], div.phpdebugbar-openhandler[data-theme="dark"] {
--debugbar-background: #2a2a2a;
--debugbar-background-alt: #333;
--debugbar-text: #e0e0e0;
--debugbar-text-muted: #aaa;
--debugbar-border: #3a3a3a;
--debugbar-header: #1e1e1e;
--debugbar-header-text: #ccc;
--debugbar-header-border: #444;
--debugbar-active: #444;
--debugbar-active-text: #e0e0e0;
--debugbar-icons: #ccc;
--debugbar-badge: #444;
--debugbar-badge-text: #ccc;
--debugbar-badge-active: #ccc;
--debugbar-badge-active-text: #1e1e1e;
--debugbar-accent: #4f8fb3;
--debugbar-accent-border: #3f7a94;
--debugbar-link: #aaa;
--debugbar-hover: #888;
}
div.phpdebugbar {
width: 100%;
font-family: var(--debugbar-font-sans);
background: var(--debugbar-background);
z-index: 2147483647;
color: var(--debugbar-text);
text-align: left;
letter-spacing: normal;
direction: ltr;
border-top: 0;
font-size: 14px;
line-height: 1.2em;
position: fixed;
bottom: 0;
left: 0;
}
div.phpdebugbar[data-openBtnPosition="bottomRight"].phpdebugbar-closed, div.phpdebugbar[data-openBtnPosition="topRight"].phpdebugbar-closed {
left: auto;
right: 0;
}
div.phpdebugbar[data-openBtnPosition="topRight"].phpdebugbar-closed, div.phpdebugbar[data-openBtnPosition="topLeft"].phpdebugbar-closed {
border-bottom: 1px solid var(--debugbar-header-border);
top: 0;
bottom: auto;
}
div.phpdebugbar[data-openBtnPosition="bottomRight"].phpdebugbar-closed, div.phpdebugbar[data-openBtnPosition="bottomLeft"].phpdebugbar-closed {
border-top: 1px solid var(--debugbar-header-border);
}
.phpdebugbar-closed[data-openBtnPosition="bottomLeft"], .phpdebugbar-closed[data-openBtnPosition="topLeft"] {
border-right: 1px solid var(--debugbar-header-border);
}
.phpdebugbar-closed[data-openBtnPosition="bottomRight"], .phpdebugbar-closed[data-openBtnPosition="topRight"] {
border-left: 1px solid var(--debugbar-header-border);
}
div.phpdebugbar a, div.phpdebugbar-openhandler {
cursor: pointer;
}
div.phpdebugbar-drag-capture {
z-index: 10001;
cursor: ns-resize;
background: none;
display: none;
position: fixed;
inset: 0;
}
div.phpdebugbar-closed {
width: auto;
}
div.phpdebugbar * {
clear: initial;
text-align: left;
-moz-box-sizing: content-box;
box-sizing: content-box;
direction: ltr;
border: 0;
width: auto;
margin: 0;
padding: 0;
font-weight: normal;
text-decoration: none;
}
div.phpdebugbar select, div.phpdebugbar input {
appearance: auto;
}
div.phpdebugbar ol, div.phpdebugbar ul {
list-style: none;
}
div.phpdebugbar ul li, div.phpdebugbar ol li, div.phpdebugbar dl li {
line-height: normal;
}
div.phpdebugbar table, .phpdebugbar-openhandler table {
border-collapse: collapse;
border-spacing: 0;
color: inherit;
}
div.phpdebugbar input[type="text"], div.phpdebugbar input[type="password"], div.phpdebugbar select {
font-family: var(--debugbar-font-sans);
background: var(--debugbar-background);
color: var(--debugbar-text);
border: 1px solid var(--debugbar-border);
border-radius: .25rem;
margin: 0;
padding: 0;
font-size: 14px;
}
div.phpdebugbar code, div.phpdebugbar pre, div.phpdebugbar samp {
font-family: var(--debugbar-font-mono);
background: none;
margin: 0;
padding: 0;
font-size: 1em;
border: 0 !important;
}
div.phpdebugbar code, div.phpdebugbar pre {
color: var(--debugbar-text);
}
div.phpdebugbar pre.sf-dump {
color: #a0a000;
outline: 0;
z-index: 0 !important;
background: none !important;
display: block !important;
}
div.phpdebugbar pre.sf-dump .sf-dump-private {
color: gray;
}
div.phpdebugbar[data-theme="dark"] pre.sf-dump .sf-dump-public {
color: #fc0;
}
div.phpdebugbar[data-theme="dark"] pre.sf-dump .sf-dump-protected {
color: #a0a000;
}
div.phpdebugbar[data-theme="dark"] pre.sf-dump .sf-dump-private {
color: #9d9266;
}
a.phpdebugbar-restore-btn {
float: left;
color: var(--debugbar-icons);
padding: 5px 8px;
font-size: 14px;
text-decoration: none;
}
div.phpdebugbar-resize-handle {
border-bottom: 1px solid var(--debugbar-header-border);
cursor: ns-resize;
background: none;
width: 100%;
height: 4px;
margin-top: -4px;
display: none;
}
div.phpdebugbar-minimized {
border-top: 1px solid var(--debugbar-header-border);
}
a.phpdebugbar-restore-btn:after {
background: var(--debugbar-header) 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 center / 20px 20px;
}
div.phpdebugbar-header {
background-color: var(--debugbar-header);
min-height: 32px;
line-height: 16px;
}
div.phpdebugbar-header:before, div.phpdebugbar-header:after {
content: "";
line-height: 0;
display: table;
}
div.phpdebugbar-header:after {
clear: both;
}
div.phpdebugbar-header-left {
float: left;
}
div.phpdebugbar-header-right {
float: right;
}
div.phpdebugbar-header > div > * {
height: 22px;
color: var(--debugbar-header-text);
padding: 5px;
font-size: 13px;
text-decoration: none;
}
div.phpdebugbar-header-left > *, div.phpdebugbar-header-right > * {
align-items: center;
line-height: 0;
display: flex;
}
div.phpdebugbar-header-left > * {
float: left;
}
div.phpdebugbar-header-right > * {
float: right;
}
div.phpdebugbar-header-right > select {
background-color: var(--debugbar-header);
color: var(--debugbar-header-text);
padding: 0;
line-height: 1em;
}
span.phpdebugbar-indicator, a.phpdebugbar-indicator {
border-right: 1px solid var(--debugbar-header-border);
}
.phpdebugbar[data-hideEmptyTabs="true"] .phpdebugbar-tab[data-empty="true"] {
display: none;
}
a.phpdebugbar-tab.phpdebugbar-active {
background: var(--debugbar-active);
color: var(--debugbar-active-text);
}
a.phpdebugbar-tab .phpdebugbar-text {
font-size: 14px;
}
a.phpdebugbar-tab span.phpdebugbar-badge {
background: var(--debugbar-badge);
color: var(--debugbar-badge-text);
text-shadow: none;
border-radius: 4px;
margin-left: 5px;
padding: 0 6px;
font-size: 11px;
font-weight: normal;
line-height: 14px;
display: none;
}
a.phpdebugbar-tab.phpdebugbar-active span.phpdebugbar-badge {
background: var(--debugbar-badge-active);
color: var(--debugbar-badge-active-text);
}
a.phpdebugbar-tab i {
vertical-align: middle;
display: none;
}
a.phpdebugbar-tab span.phpdebugbar-badge.phpdebugbar-visible {
display: inline;
}
a.phpdebugbar-tab span.phpdebugbar-badge.phpdebugbar-important {
color: #fff;
background: #ed6868;
}
a.phpdebugbar-close-btn, a.phpdebugbar-open-btn, a.phpdebugbar-restore-btn, a.phpdebugbar-minimize-btn, a.phpdebugbar-maximize-btn, a.phpdebugbar-tab.phpdebugbar-tab-history, a.phpdebugbar-tab.phpdebugbar-tab-settings {
width: 16px;
height: 22px;
}
a.phpdebugbar-close-btn, a.phpdebugbar-open-btn, a.phpdebugbar-restore-btn, a.phpdebugbar-minimize-btn, a.phpdebugbar-maximize-btn {
width: 16px;
height: 22px;
position: relative;
}
a.phpdebugbar-close-btn:after, a.phpdebugbar-open-btn:after, a.phpdebugbar-restore-btn:after, a.phpdebugbar-minimize-btn:after, a.phpdebugbar-maximize-btn:after {
background-color: var(--debugbar-icons);
content: " ";
width: 100%;
height: 100%;
display: block;
position: absolute;
top: 0;
left: 0;
}
a.phpdebugbar-restore-btn:after {
background-color: var(--debugbar-header);
}
a.phpdebugbar-maximize-btn {
display: none;
}
a.phpdebugbar-minimize-btn, div.phpdebugbar-minimized a.phpdebugbar-maximize-btn {
display: block;
}
div.phpdebugbar-minimized a.phpdebugbar-minimize-btn {
display: none;
}
a.phpdebugbar-minimize-btn:after {
mask: 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%23555000%22%2F%3E%3C%2Fsvg%3E") center / 14px 14px no-repeat;
}
a.phpdebugbar-maximize-btn:after {
mask: 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%23000%22%2F%3E%3C%2Fsvg%3E") center / 14px 14px no-repeat;
}
a.phpdebugbar-close-btn:after {
mask: 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%23000%22%2F%3E%3C%2Fsvg%3E") center / 14px 14px no-repeat;
}
a.phpdebugbar-open-btn:after {
mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 1792 1792'%3e%3cpath fill='%23000' 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") center / 14px 14px no-repeat;
}
.phpdebugbar-indicator {
cursor: pointer;
position: relative;
}
.phpdebugbar-indicator span.phpdebugbar-text {
margin-left: 5px;
}
.phpdebugbar-indicator span.phpdebugbar-tooltip {
background: var(--debugbar-header);
border: 1px solid var(--debugbar-header-border);
color: var(--debugbar-header-text);
z-index: 1000;
text-align: center;
white-space: nowrap;
-webkit-backdrop-filter: blur(5px);
padding: 2px 6px;
font-size: 11px;
line-height: 1.5;
display: none;
position: absolute;
bottom: 38px;
right: 0;
}
.phpdebugbar-indicator:hover span.phpdebugbar-tooltip:not(.phpdebugbar-disabled) {
display: block;
}
.phpdebugbar-indicator span.phpdebugbar-tooltip dl {
grid-gap: 4px 10px;
grid-template-columns: max-content;
display: grid;
}
.phpdebugbar-indicator span.phpdebugbar-tooltip dl dt {
text-align: left;
font-weight: bold;
}
.phpdebugbar-indicator span.phpdebugbar-tooltip dl dd {
text-align: left;
grid-column-start: 2;
margin: 0;
}
.phpdebugbar select.phpdebugbar-datasets-switcher {
float: right;
border: none;
max-width: 200px;
height: 22px;
padding: 4px 0;
display: none;
}
.phpdebugbar button, .phpdebugbar-openhandler button {
color: var(--debugbar-header-text);
background-color: var(--debugbar-header);
border: 1px solid var(--debugbar-header-border);
cursor: pointer;
border-radius: .25rem;
height: 20px;
margin: 0 5px;
padding: 0 12px;
line-height: normal;
}
div.phpdebugbar-body {
border-top: 1px solid var(--debugbar-header-border);
height: 300px;
display: none;
position: relative;
}
div.phpdebugbar-panel {
width: 100%;
height: 100%;
display: none;
overflow: auto;
}
div.phpdebugbar-panel.phpdebugbar-active {
display: block;
}
div.phpdebugbar-mini-design a.phpdebugbar-tab {
border-right: 1px solid var(--debugbar-header-border);
position: relative;
}
div.phpdebugbar-mini-design a.phpdebugbar-tab span.phpdebugbar-text {
display: none;
}
div.phpdebugbar-mini-design a.phpdebugbar-tab:hover span.phpdebugbar-text {
background: var(--debugbar-background);
opacity: 1;
border: 1px solid var(--debugbar-header-border);
color: var(--debugbar-header-text);
z-index: 1000;
text-align: center;
-webkit-backdrop-filter: blur(5px);
padding: 2px 6px;
font-size: 11px;
line-height: 1.5;
display: block;
position: absolute;
top: -30px;
right: 0;
}
div.phpdebugbar-mini-design a.phpdebugbar-tab i {
display: inline-block;
}
a.phpdebugbar-tab.phpdebugbar-tab-history {
width: auto;
min-width: 22px;
}
a.phpdebugbar-tab.phpdebugbar-tab-history, a.phpdebugbar-tab.phpdebugbar-tab-settings {
justify-content: center;
align-items: center;
display: flex;
}
a.phpdebugbar-tab.phpdebugbar-tab-history .phpdebugbar-text, a.phpdebugbar-tab.phpdebugbar-tab-settings .phpdebugbar-text {
white-space: nowrap;
display: none;
}
a.phpdebugbar-tab.phpdebugbar-tab-history i, a.phpdebugbar-tab.phpdebugbar-tab-settings i {
display: inline-block;
}
.phpdebugbar-widgets-dataset-history table {
table-layout: fixed;
width: 100%;
}
.phpdebugbar-widgets-dataset-history table th {
font-weight: bold;
}
.phpdebugbar-widgets-dataset-history table td, .phpdebugbar-widgets-dataset-history table th {
border-bottom: 1px solid var(--debugbar-border);
text-overflow: ellipsis;
white-space: nowrap;
padding: 6px 3px;
overflow: hidden;
}
.phpdebugbar-widgets-dataset-history table td a {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.phpdebugbar-widgets-dataset-history table tr.phpdebugbar-widgets-active {
background: var(--debugbar-active);
color: var(--debugbar-active-text);
}
.phpdebugbar-widgets-dataset-history span.phpdebugbar-badge {
background: var(--debugbar-badge);
color: var(--debugbar-badge-text);
text-shadow: none;
vertical-align: middle;
border-radius: 4px;
margin: 0 5px 0 2px;
padding: 0 6px;
font-size: 11px;
font-weight: normal;
line-height: 14px;
}
.phpdebugbar-widgets-dataset-history .phpdebugbar-widgets-dataset-actions {
text-align: center;
background: var(--debugbar-background);
padding: 7px 0;
position: sticky;
top: 0;
}
.phpdebugbar-widgets-dataset-history .phpdebugbar-widgets-dataset-actions a {
margin: 0 10px;
}
.phpdebugbar-widgets-dataset-history .phpdebugbar-widgets-dataset-actions input {
margin: 5px;
}
.phpdebugbar-settings .phpdebugbar-form-row {
border-top: 1px solid var(--debugbar-border);
min-height: 17px;
padding: 5px 10px;
display: block;
}
.phpdebugbar-settings .phpdebugbar-form-label {
clear: none;
width: 200px;
font-weight: bold;
display: inline-block;
}
.phpdebugbar-settings .phpdebugbar-form-input {
clear: none;
font-weight: bold;
display: inline-block;
}
.phpdebugbar-settings input[type="text"], .phpdebugbar-settings select {
min-width: 200px;
margin: 0 5px;
}
.phpdebugbar-settings input[type="checkbox"] {
margin: 0 5px;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
+115
View File
@@ -0,0 +1,115 @@
@charset "UTF-8";
div.phpdebugbar-openhandler-overlay {
opacity: .3;
z-index: 20000;
background: #000;
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
}
div.phpdebugbar-openhandler {
background: var(--debugbar-background);
width: 80%;
height: 70%;
color: var(--debugbar-text);
border: 2px solid var(--debugbar-header-border);
z-index: 20001;
font-family: var(--debugbar-font-sans);
margin: auto;
padding: 0;
font-size: 14px;
position: fixed;
inset: 0;
overflow: auto;
}
div.phpdebugbar-openhandler select, div.phpdebugbar-openhandler input {
appearance: auto;
}
div.phpdebugbar-openhandler input, div.phpdebugbar-openhandler select {
color: var(--debugbar-header-text);
background-color: var(--debugbar-header);
border: 1px solid var(--debugbar-header-border);
border-radius: .25rem;
height: 20px;
margin: 0 5px;
padding: 0;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions input[name="uri"] {
width: 200px;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions input[name="ip"] {
width: 90px;
}
div.phpdebugbar-openhandler a {
color: var(--debugbar-header-text);
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-header {
background: var(--debugbar-header) url("data:image/png;base64,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") no-repeat 5px 4px;
min-height: 26px;
color: var(--debugbar-header-text);
margin-bottom: 10px;
padding-left: 29px;
line-height: 25px;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-header a {
color: var(--debugbar-header-text);
float: right;
padding: 5px 8px;
font-size: 14px;
text-decoration: none;
}
div.phpdebugbar-openhandler table {
table-layout: fixed;
width: 100%;
font-size: 14px;
}
div.phpdebugbar-openhandler table td, div.phpdebugbar-openhandler table th {
border: 0px solid var(--debugbar-border);
padding: 2px 8px;
}
div.phpdebugbar-openhandler table th, div.phpdebugbar-openhandler table tr:nth-child(2n) {
background-color: var(--debugbar-background-alt);
}
div.phpdebugbar-openhandler table th:nth-child(2), div.phpdebugbar-openhandler table td:nth-child(2), div.phpdebugbar-openhandler table th:nth-child(4), div.phpdebugbar-openhandler table td:nth-child(4), div.phpdebugbar-openhandler table th:nth-child(5), div.phpdebugbar-openhandler table td:nth-child(5) {
text-align: center;
}
div.phpdebugbar-openhandler table td {
border-bottom: 1px solid var(--debugbar-border);
padding: 6px 3px;
}
div.phpdebugbar-openhandler table td a {
white-space: nowrap;
text-overflow: ellipsis;
display: block;
overflow: hidden;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions {
text-align: center;
padding: 7px 0;
}
div.phpdebugbar-openhandler .phpdebugbar-openhandler-actions a {
color: var(--debugbar-header-text);
background-color: var(--debugbar-header);
border: 1px solid var(--debugbar-header-border);
border-radius: .25rem;
margin: 5px;
padding: 4px 12px;
}
+208
View File
@@ -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="155">Date</th><th width="75">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('<select name="method"><option selected>(Method)</option><option>GET</option><option>POST</option><option>PUT</option><option>DELETE</option></select>')
.append('<input type="text" name="uri" placeholder="URI">')
.append('<input type="text" name="ip" placeholder="IP">')
.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 + ( url.includes('?') ? '&' : '?' ) + 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
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
if(typeof PhpDebugBar>"u"){var PhpDebugBar={};PhpDebugBar.$=jQuery}(function(n){var o=function(t){return PhpDebugBar.utils.csscls(t,"phpdebugbar-openhandler-")};PhpDebugBar.OpenHandler=PhpDebugBar.Widget.extend({className:"phpdebugbar-openhandler",defaults:{items_per_page:20},render:function(){var t=this;this.$el.appendTo("body").hide(),this.$closebtn=n('<a><i class="phpdebugbar-fa phpdebugbar-fa-times"></i></a>'),this.$table=n("<tbody />"),n("<div>PHP DebugBar | Open</div>").addClass(o("header")).append(this.$closebtn).appendTo(this.$el),n('<table><thead><tr><th width="155">Date</th><th width="75">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=n("<div />").addClass(o("actions")).appendTo(this.$el),this.$closebtn.on("click",function(){t.hide()}),this.$loadmorebtn=n("<a>Load more</a>").appendTo(this.$actions).on("click",function(){t.find(t.last_find_request,t.last_find_request.offset+t.get("items_per_page"),t.handleFind.bind(t))}),this.$showonlycurrentbtn=n("<a>Show only current URL</a>").appendTo(this.$actions).on("click",function(){t.$table.empty(),t.find({uri:window.location.pathname},0,t.handleFind.bind(t))}),this.$showallbtn=n("<a>Show all</a>").appendTo(this.$actions).on("click",function(){t.refresh()}),this.$clearbtn=n("<a>Delete all</a>").appendTo(this.$actions).on("click",function(){t.clear(function(){t.hide()})}),this.addSearch(),this.$overlay=n("<div />").addClass(o("overlay")).hide().appendTo("body"),this.$overlay.on("click",function(){t.hide()})},refresh:function(){this.$table.empty(),this.$loadmorebtn.show(),this.find({},0,this.handleFind.bind(this))},addSearch:function(){var t=this,e=n("<button />").text("Search").attr("type","submit").on("click",function(a){t.$table.empty();var i={},s=n(this).parent().serializeArray();n.each(s,function(){this.value&&(i[this.name]=this.value)}),t.find(i,0,t.handleFind.bind(t)),a.preventDefault()});n("<form />").append("<br/><b>Filter results</b><br/>").append('<select name="method"><option selected>(Method)</option><option>GET</option><option>POST</option><option>PUT</option><option>DELETE</option></select>').append('<input type="text" name="uri" placeholder="URI">').append('<input type="text" name="ip" placeholder="IP">').append(e).appendTo(this.$actions)},handleFind:function(t){var e=this;n.each(t,function(a,i){var s=n("<a />").text("Load dataset").on("click",function(d){e.hide(),e.load(i.id,function(h){e.callback(i.id,h)}),d.preventDefault()}),r=n("<a />").text(i.method).on("click",function(d){e.$table.empty(),e.find({method:i.method},0,e.handleFind.bind(e)),d.preventDefault()}),l=n("<a />").text(i.uri).on("click",function(d){e.hide(),e.load(i.id,function(h){e.callback(i.id,h)}),d.preventDefault()}),p=n("<a />").text(i.ip).on("click",function(d){e.$table.empty(),e.find({ip:i.ip},0,e.handleFind.bind(e)),d.preventDefault()}),c=n("<a />").text("Show URL").on("click",function(d){e.$table.empty(),e.find({uri:i.uri},0,e.handleFind.bind(e)),d.preventDefault()});n("<tr />").append("<td>"+i.datetime+"</td>").append("<td>"+i.method+"</td>").append(n("<td />").append(l)).append(n("<td />").append(p)).append(n("<td />").append(c)).appendTo(e.$table)}),t.length<this.get("items_per_page")&&this.$loadmorebtn.hide()},show:function(t){this.callback=t,this.$el.show(),this.$overlay.show(),this.refresh()},hide:function(){this.$el.hide(),this.$overlay.hide()},find:function(t,e,a){var i=n.extend({},t,{max:this.get("items_per_page"),offset:e||0});this.last_find_request=i,this.ajax(i,a)},load:function(t,e){this.ajax({op:"get",id:t},e)},clear:function(t){this.ajax({op:"clear"},t)},ajax:function(t,e){var a=this.get("url");t&&(a=a+(a.includes("?")?"&":"?")+new URLSearchParams(t)),fetch(a,{method:"GET",headers:{Accept:"application/json"}}).then(i=>i.json()).then(e)}})})(PhpDebugBar.$);
Binary file not shown.
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,136 @@
@charset "UTF-8";
div.phpdebugbar pre code.hljs {
padding: 1em;
display: block;
overflow-x: auto;
}
div.phpdebugbar code.hljs {
padding: 3px 5px;
}
div.phpdebugbar .hljs {
color: var(--debugbar-text);
}
div.phpdebugbar .hljs-doctag, div.phpdebugbar .hljs-keyword, div.phpdebugbar .hljs-meta div.phpdebugbar .hljs-keyword, div.phpdebugbar .hljs-template-tag, div.phpdebugbar .hljs-template-variable, div.phpdebugbar .hljs-type, div.phpdebugbar .hljs-variable.language_ {
color: #d73a49;
}
div.phpdebugbar .hljs-title, div.phpdebugbar .hljs-title.class_, div.phpdebugbar .hljs-title.class_.inherited__, div.phpdebugbar .hljs-title.function_ {
color: #6f42c1;
}
div.phpdebugbar .hljs-attr, div.phpdebugbar .hljs-attribute, div.phpdebugbar .hljs-literal, div.phpdebugbar .hljs-meta, div.phpdebugbar .hljs-number, div.phpdebugbar .hljs-operator, div.phpdebugbar .hljs-variable, div.phpdebugbar .hljs-selector-attr, div.phpdebugbar .hljs-selector-class, div.phpdebugbar .hljs-selector-id {
color: #005cc5;
}
div.phpdebugbar .hljs-regexp, div.phpdebugbar .hljs-string, div.phpdebugbar .hljs-meta div.phpdebugbar .hljs-string {
color: #032f62;
}
div.phpdebugbar .hljs-built_in, div.phpdebugbar .hljs-symbol {
color: #e36209;
}
div.phpdebugbar .hljs-comment, div.phpdebugbar .hljs-code, div.phpdebugbar .hljs-formula {
color: #6a737d;
}
div.phpdebugbar .hljs-name, div.phpdebugbar .hljs-quote, div.phpdebugbar .hljs-selector-tag, div.phpdebugbar .hljs-selector-pseudo {
color: #22863a;
}
div.phpdebugbar .hljs-subst {
color: #24292e;
}
div.phpdebugbar .hljs-section {
color: #005cc5;
font-weight: bold;
}
div.phpdebugbar .hljs-bullet {
color: #735c0f;
}
div.phpdebugbar .hljs-emphasis {
color: #24292e;
font-style: italic;
}
div.phpdebugbar .hljs-strong {
color: #24292e;
font-weight: bold;
}
div.phpdebugbar .hljs-addition {
color: #22863a;
background-color: #f0fff4;
}
div.phpdebugbar .hljs-deletion {
color: #b31d28;
background-color: #ffeef0;
}
div.phpdebugbar[data-theme="dark"] .hljs-doctag, div.phpdebugbar[data-theme="dark"] .hljs-keyword, div.phpdebugbar[data-theme="dark"] .hljs-meta div.phpdebugbar[data-theme="dark"] .hljs-keyword, div.phpdebugbar[data-theme="dark"] .hljs-template-tag, div.phpdebugbar[data-theme="dark"] .hljs-template-variable, div.phpdebugbar[data-theme="dark"] .hljs-type, div.phpdebugbar[data-theme="dark"] .hljs-variable.language_ {
color: #ff7b72;
}
div.phpdebugbar[data-theme="dark"] .hljs-title, div.phpdebugbar[data-theme="dark"] .hljs-title.class_, div.phpdebugbar[data-theme="dark"] .hljs-title.class_.inherited__, div.phpdebugbar[data-theme="dark"] .hljs-title.function_ {
color: #d2a8ff;
}
div.phpdebugbar[data-theme="dark"] .hljs-attr, div.phpdebugbar[data-theme="dark"] .hljs-attribute, div.phpdebugbar[data-theme="dark"] .hljs-literal, div.phpdebugbar[data-theme="dark"] .hljs-meta, div.phpdebugbar[data-theme="dark"] .hljs-number, div.phpdebugbar[data-theme="dark"] .hljs-operator, div.phpdebugbar[data-theme="dark"] .hljs-variable, div.phpdebugbar[data-theme="dark"] .hljs-selector-attr, div.phpdebugbar[data-theme="dark"] .hljs-selector-class, div.phpdebugbar[data-theme="dark"] .hljs-selector-id {
color: #79c0ff;
}
div.phpdebugbar[data-theme="dark"] .hljs-regexp, div.phpdebugbar[data-theme="dark"] .hljs-string, div.phpdebugbar[data-theme="dark"] .hljs-meta div.phpdebugbar[data-theme="dark"] .hljs-string {
color: #a5d6ff;
}
div.phpdebugbar[data-theme="dark"] .hljs-built_in, div.phpdebugbar[data-theme="dark"] .hljs-symbol {
color: #ffa657;
}
div.phpdebugbar[data-theme="dark"] .hljs-comment, div.phpdebugbar[data-theme="dark"] .hljs-code, div.phpdebugbar[data-theme="dark"] .hljs-formula {
color: #8b949e;
}
div.phpdebugbar[data-theme="dark"] .hljs-name, div.phpdebugbar[data-theme="dark"] .hljs-quote, div.phpdebugbar[data-theme="dark"] .hljs-selector-tag, div.phpdebugbar[data-theme="dark"] .hljs-selector-pseudo {
color: #7ee787;
}
div.phpdebugbar[data-theme="dark"] .hljs-subst {
color: #c9d1d9;
}
div.phpdebugbar[data-theme="dark"] .hljs-section {
color: #1f6feb;
font-weight: bold;
}
div.phpdebugbar[data-theme="dark"] .hljs-bullet {
color: #f2cc60;
}
div.phpdebugbar[data-theme="dark"] .hljs-emphasis {
color: #c9d1d9;
font-style: italic;
}
div.phpdebugbar[data-theme="dark"] .hljs-strong {
color: #c9d1d9;
font-weight: bold;
}
div.phpdebugbar[data-theme="dark"] .hljs-addition {
color: #aff5b4;
background-color: #033a16;
}
div.phpdebugbar[data-theme="dark"] .hljs-deletion {
color: #ffdcd7;
background-color: #67060c;
}
@@ -0,0 +1 @@
@charset "UTF-8";div.phpdebugbar pre code.hljs{padding:1em;display:block;overflow-x:auto}div.phpdebugbar code.hljs{padding:3px 5px}div.phpdebugbar .hljs{color:var(--debugbar-text)}div.phpdebugbar .hljs-doctag,div.phpdebugbar .hljs-keyword,div.phpdebugbar .hljs-meta div.phpdebugbar .hljs-keyword,div.phpdebugbar .hljs-template-tag,div.phpdebugbar .hljs-template-variable,div.phpdebugbar .hljs-type,div.phpdebugbar .hljs-variable.language_{color:#d73a49}div.phpdebugbar .hljs-title,div.phpdebugbar .hljs-title.class_,div.phpdebugbar .hljs-title.class_.inherited__,div.phpdebugbar .hljs-title.function_{color:#6f42c1}div.phpdebugbar .hljs-attr,div.phpdebugbar .hljs-attribute,div.phpdebugbar .hljs-literal,div.phpdebugbar .hljs-meta,div.phpdebugbar .hljs-number,div.phpdebugbar .hljs-operator,div.phpdebugbar .hljs-variable,div.phpdebugbar .hljs-selector-attr,div.phpdebugbar .hljs-selector-class,div.phpdebugbar .hljs-selector-id{color:#005cc5}div.phpdebugbar .hljs-regexp,div.phpdebugbar .hljs-string,div.phpdebugbar .hljs-meta div.phpdebugbar .hljs-string{color:#032f62}div.phpdebugbar .hljs-built_in,div.phpdebugbar .hljs-symbol{color:#e36209}div.phpdebugbar .hljs-comment,div.phpdebugbar .hljs-code,div.phpdebugbar .hljs-formula{color:#6a737d}div.phpdebugbar .hljs-name,div.phpdebugbar .hljs-quote,div.phpdebugbar .hljs-selector-tag,div.phpdebugbar .hljs-selector-pseudo{color:#22863a}div.phpdebugbar .hljs-subst{color:#24292e}div.phpdebugbar .hljs-section{color:#005cc5;font-weight:700}div.phpdebugbar .hljs-bullet{color:#735c0f}div.phpdebugbar .hljs-emphasis{color:#24292e;font-style:italic}div.phpdebugbar .hljs-strong{color:#24292e;font-weight:700}div.phpdebugbar .hljs-addition{color:#22863a;background-color:#f0fff4}div.phpdebugbar .hljs-deletion{color:#b31d28;background-color:#ffeef0}div.phpdebugbar[data-theme=dark] .hljs-doctag,div.phpdebugbar[data-theme=dark] .hljs-keyword,div.phpdebugbar[data-theme=dark] .hljs-meta div.phpdebugbar[data-theme=dark] .hljs-keyword,div.phpdebugbar[data-theme=dark] .hljs-template-tag,div.phpdebugbar[data-theme=dark] .hljs-template-variable,div.phpdebugbar[data-theme=dark] .hljs-type,div.phpdebugbar[data-theme=dark] .hljs-variable.language_{color:#ff7b72}div.phpdebugbar[data-theme=dark] .hljs-title,div.phpdebugbar[data-theme=dark] .hljs-title.class_,div.phpdebugbar[data-theme=dark] .hljs-title.class_.inherited__,div.phpdebugbar[data-theme=dark] .hljs-title.function_{color:#d2a8ff}div.phpdebugbar[data-theme=dark] .hljs-attr,div.phpdebugbar[data-theme=dark] .hljs-attribute,div.phpdebugbar[data-theme=dark] .hljs-literal,div.phpdebugbar[data-theme=dark] .hljs-meta,div.phpdebugbar[data-theme=dark] .hljs-number,div.phpdebugbar[data-theme=dark] .hljs-operator,div.phpdebugbar[data-theme=dark] .hljs-variable,div.phpdebugbar[data-theme=dark] .hljs-selector-attr,div.phpdebugbar[data-theme=dark] .hljs-selector-class,div.phpdebugbar[data-theme=dark] .hljs-selector-id{color:#79c0ff}div.phpdebugbar[data-theme=dark] .hljs-regexp,div.phpdebugbar[data-theme=dark] .hljs-string,div.phpdebugbar[data-theme=dark] .hljs-meta div.phpdebugbar[data-theme=dark] .hljs-string{color:#a5d6ff}div.phpdebugbar[data-theme=dark] .hljs-built_in,div.phpdebugbar[data-theme=dark] .hljs-symbol{color:#ffa657}div.phpdebugbar[data-theme=dark] .hljs-comment,div.phpdebugbar[data-theme=dark] .hljs-code,div.phpdebugbar[data-theme=dark] .hljs-formula{color:#8b949e}div.phpdebugbar[data-theme=dark] .hljs-name,div.phpdebugbar[data-theme=dark] .hljs-quote,div.phpdebugbar[data-theme=dark] .hljs-selector-tag,div.phpdebugbar[data-theme=dark] .hljs-selector-pseudo{color:#7ee787}div.phpdebugbar[data-theme=dark] .hljs-subst{color:#c9d1d9}div.phpdebugbar[data-theme=dark] .hljs-section{color:#1f6feb;font-weight:700}div.phpdebugbar[data-theme=dark] .hljs-bullet{color:#f2cc60}div.phpdebugbar[data-theme=dark] .hljs-emphasis{color:#c9d1d9;font-style:italic}div.phpdebugbar[data-theme=dark] .hljs-strong{color:#c9d1d9;font-weight:700}div.phpdebugbar[data-theme=dark] .hljs-addition{color:#aff5b4;background-color:#033a16}div.phpdebugbar[data-theme=dark] .hljs-deletion{color:#ffdcd7;background-color:#67060c}
+372
View File
@@ -0,0 +1,372 @@
@charset "UTF-8";
pre.phpdebugbar-widgets-code-block {
white-space: pre;
word-wrap: normal;
overflow: hidden;
}
pre.phpdebugbar-widgets-code-block code {
display: block;
overflow: auto hidden;
}
pre.phpdebugbar-widgets-code-block code.phpdebugbar-widgets-numbered-code {
padding: 5px;
line-height: normal;
}
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 {
background: var(--debugbar-text);
opacity: .15;
min-width: calc(100% - 85px);
margin-left: 10px;
position: absolute;
}
pre.phpdebugbar-widgets-code-block ul {
float: left;
border-right: 1px solid var(--debugbar-header-border);
text-align: right;
padding: 5px;
position: static;
}
.phpdebugbar-widgets-kvlist span.phpdebugbar-widgets-filename, li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-filename, table.phpdebugbar-widgets-tablevar span.phpdebugbar-widgets-filename {
float: right;
color: var(--debugbar-link);
margin-left: 8px;
font-style: italic;
display: block;
}
a.phpdebugbar-widgets-editor-link {
color: var(--debugbar-link);
}
.phpdebugbar-widgets-kvlist span.phpdebugbar-widgets-filename:hover, li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-filename:hover, a.phpdebugbar-widgets-editor-link:hover {
color: var(--debugbar-hover);
}
a.phpdebugbar-widgets-editor-link:before {
content: "";
margin-left: 4px;
margin-right: 4px;
font-family: PhpDebugbarFontAwesome;
font-size: 12px;
font-style: normal;
}
ul.phpdebugbar-widgets-list {
font-family: var(--debugbar-font-mono);
margin: 0;
padding: 0;
list-style: none;
}
ul.phpdebugbar-widgets-list li.phpdebugbar-widgets-list-item {
border-bottom: 1px solid var(--debugbar-border);
padding: 3px;
position: relative;
overflow: hidden;
}
div.phpdebugbar-widgets-messages {
height: 100%;
position: relative;
}
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 {
margin-right: 8px;
font-family: PhpDebugbarFontAwesome;
font-size: 11px;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-alert:before {
content: "";
color: #cbcf38;
}
div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-value.phpdebugbar-widgets-debug:before {
content: "";
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: "";
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: "";
}
.phpdebugbar-widgets-params .phpdebugbar-widgets-value pre.sf-dump, dl.phpdebugbar-widgets-kvlist dd.phpdebugbar-widgets-value pre.sf-dump, div.phpdebugbar-widgets-messages li.phpdebugbar-widgets-list-item pre.sf-dump {
padding-top: 0;
padding-bottom: 0;
display: inline-block !important;
}
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;
color: #888;
text-shadow: none;
background: none;
margin: 0 2px;
padding: 2px 4px;
font-size: 12px;
font-weight: normal;
text-decoration: none;
}
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 {
background: var(--debugbar-header);
width: 100%;
color: var(--debugbar-text);
border-top: 1px solid var(--debugbar-border);
border-bottom: 0;
height: 20px;
padding: 4px 0;
position: fixed;
bottom: 0;
}
div.phpdebugbar-widgets-messages li .phpdebugbar-widgets-label-called-from {
float: right;
color: var(--debugbar-text-muted);
border-bottom: 1px dotted var(--debugbar-border);
padding-left: 5px;
}
div.phpdebugbar-widgets-messages li .phpdebugbar-widgets-label-called-from:before {
content: "";
margin-right: 4px;
font-family: PhpDebugbarFontAwesome;
font-size: 12px;
}
div.phpdebugbar-widgets-messages div.phpdebugbar-widgets-toolbar input {
width: 30%;
box-shadow: none;
border: 0;
border-radius: 3px;
height: 15px;
margin: 0 0 0 7px;
padding: 2px 6px;
}
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;
color: var(--debugbar-background);
background: #7cacd5;
border-radius: 4px;
margin: 0 2px;
padding: 2px 4px;
font-size: 12px;
text-decoration: none;
}
div.phpdebugbar-widgets-messages div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter.phpdebugbar-widgets-excluded {
background: var(--debugbar-active);
color: var(--debugbar-text-muted);
}
dl.phpdebugbar-widgets-kvlist {
margin: 0;
}
dl.phpdebugbar-widgets-kvlist dt {
float: left;
border-top: 1px solid var(--debugbar-border);
clear: both;
text-overflow: ellipsis;
white-space: nowrap;
width: 150px;
padding: 5px;
font-weight: bold;
overflow: hidden;
}
dl.phpdebugbar-widgets-kvlist dd {
border-top: 1px solid var(--debugbar-border);
cursor: pointer;
min-height: 17px;
margin-left: 160px;
padding: 5px;
}
dl.phpdebugbar-widgets-varlist, dl.phpdebugbar-widgets-htmlvarlist {
font-family: var(--debugbar-font-mono);
}
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 {
border: none;
height: 20px;
display: block;
position: relative;
}
ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-label, ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-collector {
font-size: 12px;
font-family: var(--debugbar-font-mono);
color: var(--debugbar-text);
text-shadow: none;
white-space: pre;
background: none;
font-weight: normal;
position: absolute;
top: 4px;
left: 5px;
}
ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-collector {
left: initial;
right: 5px;
}
ul.phpdebugbar-widgets-timeline li span.phpdebugbar-widgets-value {
background-color: var(--debugbar-accent);
border-bottom: 2px solid var(--debugbar-accent-border);
border-radius: 3px;
min-width: 2px;
height: calc(100% - 4px);
display: block;
position: absolute;
top: 2px;
}
ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params {
border: 1px solid var(--debugbar-border);
width: 70%;
font-family: var(--debugbar-font-mono);
border-collapse: collapse;
margin: 10px;
display: none;
}
ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params td {
border: 1px solid var(--debugbar-border);
border-left: none;
border-right: none;
padding: 0 5px;
}
ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {
vertical-align: top;
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 {
color: red;
display: block;
}
div.phpdebugbar-widgets-exceptions li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-type {
font-weight: bold;
display: block;
position: absolute;
top: 4px;
right: 4px;
}
div.phpdebugbar-widgets-exceptions li.phpdebugbar-widgets-list-item pre.phpdebugbar-widgets-file {
border: 1px solid var(--debugbar-border);
font-family: var(--debugbar-font-mono);
margin: 10px;
padding: 5px;
display: none;
}
div.phpdebugbar-widgets-exceptions li.phpdebugbar-widgets-list-item span.phpdebugbar-widgets-filename {
float: none;
}
ul.phpdebugbar-widgets-timeline table.phpdebugbar-widgets-params {
border: 0;
width: 99%;
display: table;
}
div.phpdebugbar[data-theme="dark"] code.phpdebugbar-widgets-sql, div.phpdebugbar[data-theme="dark"] .phpdebugbar-widgets-name, div.phpdebugbar[data-theme="dark"] .phpdebugbar-widgets-key, div.phpdebugbar[data-theme="dark"] .phpdebugbar-widgets-success > pre.sf-dump > .sf-dump-note {
color: #fdfd96;
}
table.phpdebugbar-widgets-tablevar {
table-layout: auto;
width: 100%;
font-size: 1em;
}
table.phpdebugbar-widgets-tablevar td:first-child {
white-space: nowrap;
width: 150px;
font-family: var(--debugbar-font-mono);
}
table.phpdebugbar-widgets-tablevar td.phpdebugbar-widgets-editor {
white-space: nowrap;
text-align: right;
width: 5%;
}
table.phpdebugbar-widgets-tablevar tr.phpdebugbar-widgets-header td, table.phpdebugbar-widgets-tablevar tr.phpdebugbar-widgets-summary td {
font-weight: bold;
}
table.phpdebugbar-widgets-tablevar td {
border-bottom: 1px solid var(--debugbar-border);
text-overflow: ellipsis;
white-space: nowrap;
padding: 2px 4px;
font-weight: normal;
overflow: hidden;
}
div.phpdebugbar span.phpdebugbar-widgets-badge {
background: var(--debugbar-badge-active);
color: var(--debugbar-badge-active-text);
text-shadow: none;
vertical-align: middle;
border-radius: 4px;
margin: 0 5px 0 8px;
padding: 0 6px;
font-size: 11px;
font-weight: normal;
line-height: 14px;
}
+964
View File
@@ -0,0 +1,964 @@
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 && hljs.getLanguage(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 (window.getSelection().type == "Range") {
return '';
}
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);
}
}
});
// ------------------------------------------------------------------
/**
* Displays array element in a <table> list, columns keys map
* useful for showing a multiple values table
*
* Options:
* - data
* - key_map: list of keys to be displayed with an optional label
* example: {key1: label1, key2: label2} or [key1, key2]
*/
var TableVariableListWidget = PhpDebugBar.Widgets.TableVariableListWidget = PhpDebugBar.Widget.extend({
tagName: 'div',
className: csscls('tablevarlist'),
render: function() {
this.bindAttr('data', function(data) {
this.$el.empty();
if (!this.has('data')) {
return;
}
this.$table = $('<table />').addClass(csscls('tablevar')).appendTo(this.$el);
var $header = $('<tr />').addClass(csscls('header')).append('<td />').appendTo(this.$table);
var key_map = data.key_map || {value: 'Value'};
if (Array.isArray(key_map)) {
key_map = Object.fromEntries(key_map.map(k => [k, null]));
}
$.each(key_map, function(key, label) {
var colTitle = $('<td />').text(label ?? key).appendTo($header);
if (data.badges && data.badges[key]) {
$('<span />').text(data.badges[key]).addClass(csscls('badge')).appendTo(colTitle);
}
});
var self = this;
$.each(data.data, function(key, values) {
var $tr = $('<tr />').addClass(csscls('item')).appendTo(self.$table);
$('<td />').addClass(csscls('key')).text(key).appendTo($tr);
if (typeof values !== 'object' || values === null) {
$('<td />').addClass(csscls('value')).text(values ?? '').appendTo($tr);
return;
}
$.each(key_map, function(key) {
$('<td />').addClass(csscls('value')).text(values[key] ?? '').appendTo($tr);
});
if (values.xdebug_link) {
var filename = $('<span />').addClass(csscls('filename'))
.text(values.xdebug_link.filename + ( values.xdebug_link.line ? "#" + values.xdebug_link.line : ''))
.appendTo($('<td />').addClass(csscls('editor')).appendTo($tr));
if (values.xdebug_link.ajax) {
$('<a title="' + values.xdebug_link.url + '"></a>').on('click', function () {
$.ajax(values.xdebug_link.url);
}).addClass(csscls('editor-link')).appendTo(filename);
} else {
$('<a href="' + values.xdebug_link.url + '"></a>').addClass(csscls('editor-link')).appendTo(filename);
}
if (!data.xdebug_link) {
data.xdebug_link = true;
$header.append($('<td />'));
}
}
});
if (!data.summary) return;
var $tr = $('<tr />').addClass(csscls('summary')).appendTo(self.$table);
$('<td />').addClass(csscls('key')).appendTo($tr);
if (typeof data.summary !== 'object' || data.summary === null) {
$('<td />').addClass(csscls('value')).text(data.summary ?? '').appendTo($tr);
} else {
$.each(key_map, function(key) {
$('<td />').addClass(csscls('value')).text(data.summary[key] ?? '').appendTo($tr);
});
}
if (data.xdebug_link) {
$('<td />').appendTo($tr);
}
});
}
});
// ------------------------------------------------------------------
/**
* 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.prependTo(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];
var group = measure.group || measure.label;
if(!aggregate[group]) {
aggregate[group] = { count: 0, duration: 0, memory : 0 };
}
aggregate[group]['count'] += 1;
aggregate[group]['duration'] += measure.duration;
aggregate[group]['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.replace(/\s+/g, ' ') + ( measure.duration ? " (" + 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();
}
}).on('click', '.sf-dump', function(event) {
event.stopPropagation();
});
}
}
// 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.replace(/\s+/g, ' ')).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)
.prepend(e.count>1 ? $('<span />').addClass(csscls('badge')).text(e.count+'x') : '').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.find('samp[data-depth="1"]').removeClass('sf-dump-expanded').addClass('sf-dump-compact').parent()
.find('>.sf-dump-note').html((_, t) => t.replace(/^array:/, '<span class="sf-dump-key">Stack Trace:</span> ') + ' files');
$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;
var debugbar = self.get('debugbar');
this.$autoshow = $('<input type=checkbox>')
.on('click', function() {
if (debugbar.ajaxHandler) {
debugbar.ajaxHandler.setAutoShow($(this).is(':checked'));
}
if (debugbar.controls['__settings']) {
debugbar.controls['__settings'].get('widget').set('autoshow', this.autoShow);
}
});
$('<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);
} else if (key[1] === 'tooltip') {
debugbar.getControl(key[0]).set('tooltip', d);
}
}
});
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.$);
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,12 @@
@charset "UTF-8";
div.phpdebugbar-widgets-mails span.phpdebugbar-widgets-subject {
display: block;
}
div.phpdebugbar-widgets-mails li.phpdebugbar-widgets-list-item pre.phpdebugbar-widgets-headers {
border: 1px solid var(--debugbar-border);
font-family: var(--debugbar-font-mono);
margin: 10px;
padding: 5px;
display: none;
}
@@ -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 @@
@charset "UTF-8";div.phpdebugbar-widgets-mails span.phpdebugbar-widgets-subject{display:block}div.phpdebugbar-widgets-mails li.phpdebugbar-widgets-list-item pre.phpdebugbar-widgets-headers{border:1px solid var(--debugbar-border);font-family:var(--debugbar-font-mono);margin:10px;padding:5px;display:none}
Binary file not shown.
@@ -0,0 +1 @@
(function(e){var s=PhpDebugBar.utils.makecsscls("phpdebugbar-widgets-"),c=PhpDebugBar.Widgets.MailsWidget=PhpDebugBar.Widget.extend({className:s("mails"),render:function(){this.$list=new PhpDebugBar.Widgets.ListWidget({itemRenderer:function(d,t){if(e("<span />").addClass(s("subject")).text(t.subject).appendTo(d),e("<span />").addClass(s("to")).text(t.to).appendTo(d),t.body||t.html){var o=e("<span />").addClass(s("filename")).text("");e('<a title="Mail Preview">View Mail</a>').on("click",function(){var n=window.open("about:blank","Mail Preview","width=650,height=440,scrollbars=yes"),r=n.document,l=t.headers?e('<pre style="border: 1px solid #ddd; padding: 5px;" />').append(e("<code />").text(t.headers)):"",p=e('<pre style="border: 1px solid #ddd; padding: 5px;" />').text(t.body),i=null;t.html&&(p=e("<details />").append(e("<summary>Text version</summary>")).append(p),i=e('<iframe width="100%" height="400px" sandbox="" referrerpolicy="no-referrer"/>').attr("srcdoc",t.html)),r.open(),r.write(l.prop("outerHTML")+p.prop("outerHTML")+(i?i.prop("outerHTML"):"")),r.close()}).addClass(s("editor-link")).appendTo(o),o.appendTo(d)}if(t.headers){var a=e("<pre />").addClass(s("headers")).appendTo(d);e("<code />").text(t.headers).appendTo(a),d.click(function(){a.is(":visible")?a.hide():a.show()})}}}),this.$list.$el.appendTo(this.$el),this.bindAttr("data",function(d){this.$list.set("data",d)})}})})(PhpDebugBar.$);
Binary file not shown.
@@ -0,0 +1,172 @@
@charset "UTF-8";
div.phpdebugbar-widgets-sqlqueries .phpdebugbar-widgets-status {
font-family: var(--debugbar-font-mono);
border-bottom: 1px solid var(--debugbar-border);
color: var(--debugbar-text);
background-color: var(--debugbar-background-alt);
padding: 6px;
font-weight: bold;
}
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;
color: var(--debugbar-text-muted);
margin-left: 8px;
}
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: var(--debugbar-text);
}
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 {
margin-right: 4px;
font-family: PhpDebugbarFontAwesome;
font-size: 12px;
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-database:before {
content: "";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-duration:before {
content: "";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-memory:before {
content: "";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-row-count:before {
content: "";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-stmt-id:before {
content: "";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard:before {
content: "";
}
div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard-check:before {
content: "";
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:before {
content: "";
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link {
color: var(--debugbar-link);
}
div.phpdebugbar-widgets-sqlqueries a.phpdebugbar-widgets-editor-link:hover {
color: var(--debugbar-hover);
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params {
border: 1px solid var(--debugbar-border);
width: 70%;
font-family: var(--debugbar-font-mono);
border-collapse: collapse;
margin: 10px;
display: none;
}
div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params td {
border: 1px solid var(--debugbar-border);
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 {
font-weight: bold;
display: block;
}
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-slow {
background-color: #ffe4e4;
}
div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate {
background-color: #fdfdcd;
}
div.phpdebugbar[data-theme="dark"] div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-slow {
background-color: #623100;
}
div.phpdebugbar[data-theme="dark"] div.phpdebugbar-widgets-sqlqueries li.phpdebugbar-widgets-list-item.phpdebugbar-widgets-sql-duplicate {
background-color: #565602;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar {
z-index: 1;
width: calc(100% - 30px);
margin-bottom: 5px;
display: none;
position: fixed;
bottom: 0;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter {
float: right;
color: #fff;
background: #7cacd5;
border-radius: 4px;
margin: 0 2px;
padding: 2px 4px;
font-size: 12px;
text-decoration: none;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-toolbar a.phpdebugbar-widgets-filter.phpdebugbar-widgets-excluded {
background: var(--debugbar-background);
color: var(--debugbar-text);
}
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 {
pointer-events: none;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
}
div.phpdebugbar-widgets-sqlqueries div.phpdebugbar-widgets-bg-measure div.phpdebugbar-widgets-value {
opacity: 1;
background: var(--debugbar-accent-border);
height: 1px;
position: absolute;
bottom: 0;
}
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: var(--debugbar-text-muted);
}
@@ -0,0 +1,244 @@
(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 {
if (document.execCommand('copy')) {
$(el).addClass(csscls('copy-clipboard-check'));
setTimeout(function(){
$(el).removeClass(csscls('copy-clipboard-check'));
}, 2000)
}
} 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;', $span.clone().text(value).html()]
).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.slow) {
li.addClass(csscls('sql-slow'))
}
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 ((!stmt.type || stmt.type === 'query')) {
$('<span title="Copy to clipboard" />')
.addClass(csscls('copy-clipboard'))
.css('cursor', 'pointer')
.html("&#8203;")
.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 : ''));
$('<a href="' + stmt.xdebug_link.url + '"></a>').on('click', function () {
event.stopPropagation();
if (stmt.xdebug_link.ajax) {
fetch(stmt.xdebug_link.url);
event.preventDefault();
}
}).addClass(csscls('editor-link')).appendTo(header);
header.appendTo(li);
}
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 (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));
}
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.$);
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,74 @@
@charset "UTF-8";
div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status {
font-family: var(--debugbar-font-mono);
border-bottom: 1px solid var(--debugbar-border);
color: var(--debugbar-text);
background-color: var(--debugbar-background-alt);
padding: 6px;
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: var(--debugbar-text);
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: var(--debugbar-text);
}
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: var(--debugbar-hover);
}
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: 1px solid var(--debugbar-border);
width: 70%;
font-family: var(--debugbar-font-mono);
border-collapse: collapse;
margin: 10px;
display: none;
}
div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params td {
border: 1px solid var(--debugbar-border);
padding: 0 5px;
}
div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params .phpdebugbar-widgets-name {
vertical-align: top;
width: 20%;
font-weight: bold;
}
div.phpdebugbar[data-theme="dark"] div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-callgraph > pre * {
background-color: inherit !important;
}
@@ -0,0 +1,108 @@
(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) {
var name = $('<span />').addClass(csscls('name')).appendTo(li);
if (tpl.html) {
name.html(tpl.html);
} else {
name.text(tpl.name);
}
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) {
$('<a href="' + tpl.xdebug_link.url + '"></a>').on('click', function () {
event.stopPropagation();
if (tpl.xdebug_link.ajax) {
fetch(tpl.xdebug_link.url);
event.preventDefault();
}
}).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.$);
@@ -0,0 +1 @@
@charset "UTF-8";div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-status{font-family:var(--debugbar-font-mono);border-bottom:1px solid var(--debugbar-border);color:var(--debugbar-text);background-color:var(--debugbar-background-alt);padding:6px;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:var(--debugbar-text);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:var(--debugbar-text)}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:var(--debugbar-hover)}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:1px solid var(--debugbar-border);width:70%;font-family:var(--debugbar-font-mono);border-collapse:collapse;margin:10px;display:none}div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params td{border:1px solid var(--debugbar-border);padding:0 5px}div.phpdebugbar-widgets-templates table.phpdebugbar-widgets-params .phpdebugbar-widgets-name{vertical-align:top;width:20%;font-weight:700}div.phpdebugbar[data-theme=dark] div.phpdebugbar-widgets-templates div.phpdebugbar-widgets-callgraph>pre *{background-color:inherit!important}
@@ -0,0 +1 @@
(function(s){var a=PhpDebugBar.utils.makecsscls("phpdebugbar-widgets-"),p=PhpDebugBar.Widgets.TemplatesWidget=PhpDebugBar.Widget.extend({className:a("templates"),render:function(){this.$status=s("<div />").addClass(a("status")).appendTo(this.$el),this.$list=new PhpDebugBar.Widgets.ListWidget({itemRenderer:function(t,e){var r=s("<span />").addClass(a("name")).appendTo(t);if(e.html?r.html(e.html):r.text(e.name),typeof e.xdebug_link<"u"&&e.xdebug_link!==null){var d=s("<span />").addClass(a("filename")).text(e.xdebug_link.filename+(e.xdebug_link.line?"#"+e.xdebug_link.line:""));e.xdebug_link&&s('<a href="'+e.xdebug_link.url+'"></a>').on("click",function(){event.stopPropagation(),e.xdebug_link.ajax&&(fetch(e.xdebug_link.url),event.preventDefault())}).addClass(a("editor-link")).appendTo(d),d.appendTo(t)}if(e.render_time_str&&s('<span title="Render time" />').addClass(a("render-time")).text(e.render_time_str).appendTo(t),e.memory_str&&s('<span title="Memory usage" />').addClass(a("memory")).text(e.memory_str).appendTo(t),typeof e.param_count<"u"&&s('<span title="Parameter count" />').addClass(a("param-count")).text(e.param_count).appendTo(t),typeof e.type<"u"&&e.type&&s('<span title="Type" />').addClass(a("type")).text(e.type).appendTo(t),typeof e.editorLink<"u"&&e.editorLink&&s('<a href="'+e.editorLink+'" />').on("click",function(o){o.stopPropagation()}).addClass(a("editor-link")).text("file").appendTo(t),e.params&&!s.isEmptyObject(e.params)){var n=s('<table><tr><th colspan="2">Params</th></tr></table>').addClass(a("params")).appendTo(t);for(var i in e.params)typeof e.params[i]!="function"&&n.append('<tr><td class="'+a("name")+'">'+i+'</td><td class="'+a("value")+'"><pre><code>'+e.params[i]+"</code></pre></td></tr>");t.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=s("<div />").addClass(a("callgraph")).appendTo(this.$el),this.bindAttr("data",function(t){this.$list.set("data",t.templates),this.$status.empty(),this.$callgraph.empty();var e=t.sentence||"templates were rendered";s("<span />").text(t.nb_templates+" "+e).appendTo(this.$status),t.accumulated_render_time_str&&this.$status.append(s('<span title="Accumulated render time" />').addClass(a("render-time")).text(t.accumulated_render_time_str)),t.memory_usage_str&&this.$status.append(s('<span title="Memory usage" />').addClass(a("memory")).text(t.memory_usage_str)),t.nb_blocks>0&&s("<div />").text(t.nb_blocks+" blocks were rendered").appendTo(this.$status),t.nb_macros>0&&s("<div />").text(t.nb_macros+" macros were rendered").appendTo(this.$status),typeof t.callgraph<"u"&&this.$callgraph.html(t.callgraph)})}})})(PhpDebugBar.$);