Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion system/Debug/Toolbar/Views/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ var ciDebugBar = {
icon: null,

init: function () {
this.toolbarContainer = document.getElementById("toolbarContainer");
// Standalone debugbar pages do not have #toolbarContainer, use body as fallback.
this.toolbarContainer = document.getElementById("toolbarContainer") || document.body;
Comment thread
michalsn marked this conversation as resolved.
Outdated
this.toolbar = document.getElementById("debug-bar");
this.icon = document.getElementById("debug-icon");

Expand Down
1 change: 1 addition & 0 deletions system/Debug/Toolbar/Views/toolbar.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<script id="toolbar_js">
var ciSiteURL = "<?= rtrim(site_url(), '/') ?>"
<?= file_get_contents(__DIR__ . '/toolbar.js') ?>
<?= file_get_contents(__DIR__ . '/toolbarstandalone.js') ?>
</script>
<div id="debug-icon" class="debug-bar-ndisplay">
<a id="debug-icon-link">
Expand Down
37 changes: 37 additions & 0 deletions system/Debug/Toolbar/Views/toolbarstandalone.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Bootstrap for standalone Debug Toolbar pages (?debugbar_time=...).
*/

if (! document.getElementById('debugbar_loader')) {
if (typeof loadDoc !== 'function') {
window.loadDoc = function (time) {
if (isNaN(time)) {
return;
}

localStorage.setItem('debugbar-time', time);
localStorage.setItem('debugbar-time-new', time);
window.location.href = ciSiteURL + '?debugbar_time=' + time;
};
}

(function () {
function initStandaloneToolbar() {
if (typeof ciDebugBar !== 'object') {
return;
}

if (! document.getElementById('debug-bar') || ! document.getElementById('debug-icon')) {
return;
}

ciDebugBar.init();
}

if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initStandaloneToolbar, false);
} else {
initStandaloneToolbar();
}
})();
}
1 change: 1 addition & 0 deletions user_guide_src/source/changelogs/v4.7.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Bugs Fixed

- **ContentSecurityPolicy:** Fixed a bug where ``generateNonces()`` produces corrupted JSON responses by replacing CSP nonce placeholders with unescaped double quotes. The method now automatically JSON-escapes nonce attributes when the response Content-Type is JSON.
- **Session:** Fixed a bug in ``MemcachedHandler`` where the constructor incorrectly threw an exception when ``savePath`` was not empty.
- **Toolbar:** Fixed a bug where the standalone toolbar page loaded from ``?debugbar_time=...`` was not interactive.

See the repo's
`CHANGELOG.md <https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md>`_
Expand Down
Loading